Move crop outside of geometry state.

Prior to this CL, if Layer crop is changed while a
surface resize is pending, the crop will not be
applied until a buffer latches at the new size. This
CL makes the crop apply immediately. We can see this
is the desired behavior by looking at the two cases
where a resize is pending.

1. A resize is pending to make the surface smaller.
  In this case we need to be able to immediately update the crop so that
  we can shrink the visible region of the surface at an interactive rate
  with input. The window manager currently uses big surfaces and scaling
  modes to accomplish this.
2. A resize is pending to make the surface larger.
  In this case it doesn't matter. If we expand the crop immediately to
  the new surface size, then we have simply uncropped an area which is
  by definition transparent pixels (as we haven't latched a buffer
  at the new size yet).

This change has conceptual soundness as well. We can see that the
scaling mode will not affect properties that affect scaling (transform,
width/height) but not properties which do not (crop).

Bug: 27729195
Bug: 27687126
Change-Id: Ieafdc14aeecb23085793e3056a746d6f344781df
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 34857c2..1d73b43 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -93,12 +93,10 @@
     struct Geometry {
         uint32_t w;
         uint32_t h;
-        Rect crop;
-        Rect finalCrop;
         Transform transform;
 
         inline bool operator ==(const Geometry& rhs) const {
-            return (w == rhs.w && h == rhs.h && crop == rhs.crop);
+          return (w == rhs.w && h == rhs.h);
         }
         inline bool operator !=(const Geometry& rhs) const {
             return !operator ==(rhs);
@@ -121,6 +119,9 @@
         int32_t sequence; // changes when visible regions can change
         bool modified;
 
+        Rect crop;
+        Rect finalCrop;
+
         // If set, defers this state update until the Layer identified by handle
         // receives a frame with the given frameNumber
         sp<IBinder> handle;