Fix "Battery/Status/Clock status bar area flickers when dragging down"

The crop is now handled like a resize, it's latched only when we
receive a new buffer in the case we have a resize in the same
transaction.

Bug: 6498869
Change-Id: I9f3cbbe08fb19443899461ec441c714748a4fd1a
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index c52b49c..7c6a28a 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -173,10 +173,10 @@
     return true;
 }
 bool LayerBase::setCrop(const Rect& crop) {
-    if (mCurrentState.active.crop == crop)
+    if (mCurrentState.requested.crop == crop)
         return false;
     mCurrentState.sequence++;
-    mCurrentState.active.crop = crop;
+    mCurrentState.requested.crop = crop;
     requestTransaction();
     return true;
 }
@@ -201,15 +201,13 @@
     const Layer::State& front(drawingState());
     const Layer::State& temp(currentState());
 
-    if ((front.requested.w != temp.requested.w) ||
-        (front.requested.h != temp.requested.h))  {
-        // resize the layer, set the physical size to the requested size
+    if (front.requested != temp.requested)  {
+        // geometry of the layer has changed, set the active geometry
+        // to the requested geometry.
         Layer::State& editTemp(currentState());
-        editTemp.active.w = temp.requested.w;
-        editTemp.active.h = temp.requested.h;
+        editTemp.active = temp.requested;
     }
-
-    if ((front.active.w != temp.active.w) || (front.active.h != temp.active.h)) {
+    if (front.active != temp.active) {
         // invalidate and recompute the visible regions if needed
         flags |= Layer::eVisibleRegion;
     }