SF: Remove layer mRefreshPending tracking

This flag was used to ensure we do not latch a
second buffer without going through the
composition stage. This flag is not needed because
if we latch a buffer, then we are guaranteed to go
into the composition stage.

Incentive for this change: to rebuild the layer state,
via layertracegenerator, we invoke the commit stage
over and over again. This flag prevents us from
latching another buffer because the tool does not
call composite.

Test: presubmit, also presubmit with fatal log if we ever try
to latch when mRefreshPending is true (ag/16790650)

Bug: 200284593
Change-Id: I332349865b19ae7a205002167f26f5a2f76688af
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3459a8f..d5f340b 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3563,11 +3563,9 @@
         for (const auto& layer : mLayersWithQueuedFrames) {
             if (layer->latchBuffer(visibleRegions, latchTime, expectedPresentTime)) {
                 mLayersPendingRefresh.push_back(layer);
-            }
-            layer->useSurfaceDamage();
-            if (layer->isBufferLatched()) {
                 newDataLatched = true;
             }
+            layer->useSurfaceDamage();
         }
     }