Corrected drawingTransformMatrix

The transformMatrix needed to be calculated in prepareClientComposition
so storing it in BufferInfo was incorrect. Instead, allow the transformMatrix
to get calculated when prepareClientComposition but avoid using the consumer
for BufferQueueLayer.

Also combined getDrawingTransformMatrix and setFilteringEnabled since
setFilteringEnabled was only used to update the transformMatrix before getting
it. BufferQueueLayers no longer go through the consumer to get the
transformMatrix and just directly calculate the matrix using the GLUtils class.

Fixes: 140759442
Test: atest android.view.cts.ASurfaceControlTest
Change-Id: I09179de275bd905960fb366e45e36fb9874bc0b3
diff --git a/services/surfaceflinger/BufferLayer.h b/services/surfaceflinger/BufferLayer.h
index a685ea2..f0a30e3 100644
--- a/services/surfaceflinger/BufferLayer.h
+++ b/services/surfaceflinger/BufferLayer.h
@@ -127,6 +127,10 @@
 
     PixelFormat getPixelFormat() const;
 
+    // Computes the transform matrix using the setFilteringEnabled to determine whether the
+    // transform matrix should be computed for use with bilinear filtering.
+    void getDrawingTransformMatrix(bool filteringEnabled, float outMatrix[16]);
+
     virtual uint64_t getFrameNumber(nsecs_t expectedPresentTime) const = 0;
 
     virtual bool getAutoRefresh() const = 0;
@@ -137,8 +141,6 @@
 
     virtual bool hasFrameUpdate() const = 0;
 
-    virtual void setFilteringEnabled(bool enabled) = 0;
-
     virtual status_t bindTextureImage() = 0;
     virtual status_t updateTexImage(bool& recomputeVisibleRegions, nsecs_t latchTime,
                                     nsecs_t expectedPresentTime) = 0;
@@ -151,9 +153,8 @@
         nsecs_t mDesiredPresentTime;
         std::shared_ptr<FenceTime> mFenceTime;
         sp<Fence> mFence;
-        float mTransformMatrix[16];
         uint32_t mTransform{0};
-        ui::Dataspace mDataspace;
+        ui::Dataspace mDataspace{ui::Dataspace::UNKNOWN};
         Rect mCrop;
         uint32_t mScaleMode{NATIVE_WINDOW_SCALING_MODE_FREEZE};
         Region mSurfaceDamage;