blast: BufferStateLayer

Adds the initial foundation for supporting buffers on
transactions as well as the other metadata that had been passed
over BufferQueue.

Bug: 80477568
Test: Transaction_test.cpp
Change-Id: I61e44462c66c1a912adbabf62015e66bde44c216
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index 6484245..e724666 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -136,7 +136,7 @@
  * onDraw will draw the current layer onto the presentable buffer
  */
 void BufferLayer::onDraw(const RenderArea& renderArea, const Region& clip,
-                         bool useIdentityTransform) const {
+                         bool useIdentityTransform) {
     ATRACE_CALL();
 
     CompositionInfo& compositionInfo = getBE().compositionInfo;
@@ -232,7 +232,7 @@
     engine.disableTexturing();
 }
 
-void BufferLayer::drawNow(const RenderArea& renderArea, bool useIdentityTransform) const {
+void BufferLayer::drawNow(const RenderArea& renderArea, bool useIdentityTransform) {
     CompositionInfo& compositionInfo = getBE().compositionInfo;
     auto& engine(mFlinger->getRenderEngine());
 
@@ -518,7 +518,7 @@
 
     // FIXME: postedRegion should be dirty & bounds
     // transform the dirty region to window-manager space
-    return getTransform().transform(Region(Rect(s.active_legacy.w, s.active_legacy.h)));
+    return getTransform().transform(Region(Rect(getActiveWidth(s), getActiveHeight(s))));
 }
 
 // transaction
@@ -641,9 +641,10 @@
 
     Transform t = getTransform();
     Rect win = bounds;
-    if (!s.finalCrop_legacy.isEmpty()) {
+    Rect finalCrop = getFinalCrop(s);
+    if (!finalCrop.isEmpty()) {
         win = t.transform(win);
-        if (!win.intersect(s.finalCrop_legacy, &win)) {
+        if (!win.intersect(finalCrop, &win)) {
             win.clear();
         }
         win = t.inverse().transform(win);
@@ -652,10 +653,10 @@
         }
     }
 
-    float left = float(win.left) / float(s.active_legacy.w);
-    float top = float(win.top) / float(s.active_legacy.h);
-    float right = float(win.right) / float(s.active_legacy.w);
-    float bottom = float(win.bottom) / float(s.active_legacy.h);
+    float left = float(win.left) / float(getActiveWidth(s));
+    float top = float(win.top) / float(getActiveHeight(s));
+    float right = float(win.right) / float(getActiveWidth(s));
+    float bottom = float(win.bottom) / float(getActiveHeight(s));
 
     // TODO: we probably want to generate the texture coords with the mesh
     // here we assume that we only have 4 vertices