Move DeferredDisplayState out of ops

bug:9969358

Instead of storing DeferredDisplayState within an op (thus forcing ops
to be tied to a single state instance), associate each op with a new
state at DeferredDisplayList insertion time.

Now, DisplayLists (and the ops within) can be reused in a single
DeferredDisplayList draw call, as ops will use different state
instances at different points in the frame.

Change-Id: I525ab2abe0c3883679f2fa00b219b293e9ec53d9
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 54f6d76..f74df97 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -98,24 +98,11 @@
     kClipSide_ConservativeFull = 0x1F
 };
 
-struct DeferredDisplayState {
-    // global op bounds, mapped by mMatrix to be in screen space coordinates, clipped
-    Rect mBounds;
-
-    // the below are set and used by the OpenGLRenderer at record and deferred playback
-    bool mClipValid;
-    Rect mClip;
-    int mClipSideFlags; // specifies which sides of the bounds are clipped, unclipped if cleared
-    bool mClipped;
-    mat4 mMatrix;
-    DrawModifiers mDrawModifiers;
-    float mAlpha;
-};
-
 ///////////////////////////////////////////////////////////////////////////////
 // Renderer
 ///////////////////////////////////////////////////////////////////////////////
 
+class DeferredDisplayState;
 class DisplayList;
 class TextSetupFunctor;
 class VertexBuffer;
@@ -423,7 +410,7 @@
         return getXfermode(paint->getXfermode());
     }
 
-    static inline int getAlphaDirect(SkPaint* paint) {
+    static inline int getAlphaDirect(const SkPaint* paint) {
         if (!paint) return 255;
         return paint->getAlpha();
     }