Expose display list APIs

The exposed APIs are slightly simpler than the full APIs used internally.
Only APIs useful to applications are exposed.

Change-Id: Ie03014628d40ad5ef63dedbc52ce3def84429d54
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp
index 8aac628..6fab8da 100644
--- a/libs/hwui/DisplayList.cpp
+++ b/libs/hwui/DisplayList.cpp
@@ -263,6 +263,16 @@
     ALOGD("%*sDone (%p, %s)", level * 2, "", this, mName.string());
 }
 
+float DisplayList::getPivotX() {
+    updateMatrix();
+    return mPivotX;
+}
+
+float DisplayList::getPivotY() {
+    updateMatrix();
+    return mPivotY;
+}
+
 void DisplayList::updateMatrix() {
     if (mMatrixDirty) {
         if (!mTransformMatrix) {
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index d06827d..86c9ec0 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -105,6 +105,10 @@
         }
     }
 
+    const char* getName() const {
+        return mName.string();
+    }
+
     void setClipChildren(bool clipChildren) {
         mClipChildren = clipChildren;
     }
@@ -114,6 +118,11 @@
         mStaticMatrix = new SkMatrix(*matrix);
     }
 
+    // Can return NULL
+    SkMatrix* getStaticMatrix() {
+        return mStaticMatrix;
+    }
+
     void setAnimationMatrix(SkMatrix* matrix) {
         delete mAnimationMatrix;
         if (matrix) {
@@ -131,10 +140,18 @@
         }
     }
 
+    float getAlpha() const {
+        return mAlpha;
+    }
+
     void setHasOverlappingRendering(bool hasOverlappingRendering) {
         mHasOverlappingRendering = hasOverlappingRendering;
     }
 
+    bool hasOverlappingRendering() const {
+        return mHasOverlappingRendering;
+    }
+
     void setTranslationX(float translationX) {
         if (translationX != mTranslationX) {
             mTranslationX = translationX;
@@ -147,6 +164,10 @@
         }
     }
 
+    float getTranslationX() const {
+        return mTranslationX;
+    }
+
     void setTranslationY(float translationY) {
         if (translationY != mTranslationY) {
             mTranslationY = translationY;
@@ -159,6 +180,10 @@
         }
     }
 
+    float getTranslationY() const {
+        return mTranslationY;
+    }
+
     void setRotation(float rotation) {
         if (rotation != mRotation) {
             mRotation = rotation;
@@ -171,6 +196,10 @@
         }
     }
 
+    float getRotation() const {
+        return mRotation;
+    }
+
     void setRotationX(float rotationX) {
         if (rotationX != mRotationX) {
             mRotationX = rotationX;
@@ -183,6 +212,10 @@
         }
     }
 
+    float getRotationX() const {
+        return mRotationX;
+    }
+
     void setRotationY(float rotationY) {
         if (rotationY != mRotationY) {
             mRotationY = rotationY;
@@ -195,6 +228,10 @@
         }
     }
 
+    float getRotationY() const {
+        return mRotationY;
+    }
+
     void setScaleX(float scaleX) {
         if (scaleX != mScaleX) {
             mScaleX = scaleX;
@@ -207,6 +244,10 @@
         }
     }
 
+    float getScaleX() const {
+        return mScaleX;
+    }
+
     void setScaleY(float scaleY) {
         if (scaleY != mScaleY) {
             mScaleY = scaleY;
@@ -219,6 +260,10 @@
         }
     }
 
+    float getScaleY() const {
+        return mScaleY;
+    }
+
     void setPivotX(float pivotX) {
         mPivotX = pivotX;
         mMatrixDirty = true;
@@ -230,6 +275,8 @@
         mPivotExplicitlySet = true;
     }
 
+    ANDROID_API float getPivotX();
+
     void setPivotY(float pivotY) {
         mPivotY = pivotY;
         mMatrixDirty = true;
@@ -241,6 +288,8 @@
         mPivotExplicitlySet = true;
     }
 
+    ANDROID_API float getPivotY();
+
     void setCameraDistance(float distance) {
         if (distance != mCameraDistance) {
             mCameraDistance = distance;
@@ -253,6 +302,10 @@
         }
     }
 
+    float getCameraDistance() const {
+        return mCameraDistance;
+    }
+
     void setLeft(int left) {
         if (left != mLeft) {
             mLeft = left;
@@ -263,6 +316,10 @@
         }
     }
 
+    float getLeft() const {
+        return mLeft;
+    }
+
     void setTop(int top) {
         if (top != mTop) {
             mTop = top;
@@ -273,6 +330,10 @@
         }
     }
 
+    float getTop() const {
+        return mTop;
+    }
+
     void setRight(int right) {
         if (right != mRight) {
             mRight = right;
@@ -283,6 +344,10 @@
         }
     }
 
+    float getRight() const {
+        return mRight;
+    }
+
     void setBottom(int bottom) {
         if (bottom != mBottom) {
             mBottom = bottom;
@@ -293,6 +358,10 @@
         }
     }
 
+    float getBottom() const {
+        return mBottom;
+    }
+
     void setLeftTop(int left, int top) {
         if (left != mLeft || top != mTop) {
             mLeft = left;
@@ -319,7 +388,7 @@
         }
     }
 
-    void offsetLeftRight(int offset) {
+    void offsetLeftRight(float offset) {
         if (offset != 0) {
             mLeft += offset;
             mRight += offset;
@@ -329,7 +398,7 @@
         }
     }
 
-    void offsetTopBottom(int offset) {
+    void offsetTopBottom(float offset) {
         if (offset != 0) {
             mTop += offset;
             mBottom += offset;
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index d11558f..e5fd7b9 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -280,7 +280,7 @@
 void OpenGLRenderer::startTiling(const Rect& clip, int windowHeight, bool opaque) {
     if (!mSuppressTiling) {
         mCaches.startTiling(clip.left, windowHeight - clip.bottom,
-                    clip.right - clip.left, clip.bottom - clip.top, opaque);
+                clip.right - clip.left, clip.bottom - clip.top, opaque);
     }
 }