Update transform hint from relayout window (2/2)

The transform hint is used to prevent allocating a buffer of a different
size when a window is rotated. We return the fixed rotation transform
and pass it to BLASTBufferQueue so the producer can choose to consume
the hint and allocate the buffer with the same size.

Bug: 188893403
Bug: 177029197
Test: atest WmTests
Test: gfxbenchmark
Test: atest libsurfaceflinger_unittest SurfaceFlinger_test
Change-Id: I9fee3ab443e5f81d0209c62ad95c6355fa8dacee
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index b9a293f..68514cf 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -201,6 +201,11 @@
         applyTransaction = true;
     }
 
+    if (mSurfaceControl != nullptr) {
+        mTransformHint = mSurfaceControl->getTransformHint();
+        mBufferItemConsumer->setTransformHint(mTransformHint);
+    }
+
     ui::Size newSize(width, height);
     if (mRequestedSize != newSize) {
         mRequestedSize.set(newSize);