Clipping performance improvements

Create a ClipArea class to handle tracking clip regions. This class can
select the most efficient implementation depending on the types of
clipping presented.

ClipArea re-used the rectangle and region-based clipping
implementations as well as adding a "list of rotated rectangles"
approach that is more efficient for rotated views with children.

Change-Id: I2133761a2462ebc0852b394220e265974b3086f0
diff --git a/libs/hwui/CanvasState.h b/libs/hwui/CanvasState.h
index 9e6a9c3..121112b 100644
--- a/libs/hwui/CanvasState.h
+++ b/libs/hwui/CanvasState.h
@@ -120,10 +120,6 @@
     bool clipPath(const SkPath* path, SkRegion::Op op);
     bool clipRegion(const SkRegion* region, SkRegion::Op op);
 
-    bool isCurrentClipSimple() const {
-        return currentSnapshot()->clipRegion->isEmpty();
-    }
-
     /**
      * Sets a "clipping outline", which is independent from the regular clip.
      * Currently only supports rectangles or rounded rectangles; passing in a
@@ -150,7 +146,7 @@
     void setInvisible(bool value) { mSnapshot->invisible = value; }
 
     inline const mat4* currentTransform() const { return currentSnapshot()->transform; }
-    inline const Rect* currentClipRect() const { return currentSnapshot()->clipRect; }
+    inline const Rect& currentClipRect() const { return currentSnapshot()->getClipRect(); }
     inline Region* currentRegion() const { return currentSnapshot()->region; }
     inline int currentFlags() const { return currentSnapshot()->flags; }
     const Vector3& currentLightCenter() const { return currentSnapshot()->getRelativeLightCenter(); }