SF: Use compositionInfo after HWC changedTypes

Bug: 112259502
Test: cts -m CtsViewTestCases
      SurfaceFlinger_test
      vrflinger_test

Change-Id: I908f439eedfab9ee8241f8ac594465527f93408a
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index d0ccabb..44305df 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -138,8 +138,6 @@
                          bool useIdentityTransform) {
     ATRACE_CALL();
 
-    CompositionInfo& compositionInfo = getBE().compositionInfo;
-
     if (CC_UNLIKELY(mActiveBuffer == 0)) {
         // the texture has not been created yet, this Layer has
         // in fact never been drawn into. This happens frequently with
@@ -221,7 +219,6 @@
         mTexture.setDimensions(mActiveBuffer->getWidth(), mActiveBuffer->getHeight());
         mTexture.setFiltering(useFiltering);
         mTexture.setMatrix(textureMatrix);
-        compositionInfo.re.texture = mTexture;
 
         engine.setupLayerTexturing(mTexture);
     } else {
@@ -231,23 +228,6 @@
     engine.disableTexturing();
 }
 
-void BufferLayer::drawNow(const RenderArea& renderArea, bool useIdentityTransform) {
-    CompositionInfo& compositionInfo = getBE().compositionInfo;
-    auto& engine(mFlinger->getRenderEngine());
-
-    draw(renderArea, useIdentityTransform);
-
-    engine.setupLayerTexturing(compositionInfo.re.texture);
-    engine.setupLayerBlending(compositionInfo.re.preMultipliedAlpha, compositionInfo.re.opaque,
-            false, compositionInfo.re.color);
-    engine.setSourceDataSpace(compositionInfo.hwc.dataspace);
-    engine.setSourceY410BT2020(compositionInfo.re.Y410BT2020);
-    engine.drawMesh(getBE().getMesh());
-    engine.disableBlending();
-    engine.disableTexturing();
-    engine.setSourceY410BT2020(false);
-}
-
 bool BufferLayer::isHdrY410() const {
     // pixel format is HDR Y410 masquerading as RGBA_1010102
     return (mCurrentDataSpace == ui::Dataspace::BT2020_ITU_PQ &&
@@ -340,6 +320,7 @@
 bool BufferLayer::onPostComposition(const std::shared_ptr<FenceTime>& glDoneFence,
                                     const std::shared_ptr<FenceTime>& presentFence,
                                     const CompositorTiming& compositorTiming) {
+
     // mFrameLatencyNeeded is true when a new frame was latched for the
     // composition.
     if (!mFrameLatencyNeeded) return false;