Merge "Fast transform properties setters. Bug #3413510" into honeycomb
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 9db43a1..1ecf320 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -6407,6 +6407,53 @@
}
/**
+ * @hide
+ */
+ public void setFastX(float x) {
+ mTranslationX = x - mLeft;
+ mMatrixDirty = true;
+ }
+
+ /**
+ * @hide
+ */
+ public void setFastY(float y) {
+ mTranslationY = y - mTop;
+ mMatrixDirty = true;
+ }
+
+ /**
+ * @hide
+ */
+ public void setFastScaleX(float x) {
+ mScaleX = x;
+ mMatrixDirty = true;
+ }
+
+ /**
+ * @hide
+ */
+ public void setFastScaleY(float y) {
+ mScaleY = y;
+ mMatrixDirty = true;
+ }
+
+ /**
+ * @hide
+ */
+ public void setFastAlpha(float alpha) {
+ mAlpha = alpha;
+ }
+
+ /**
+ * @hide
+ */
+ public void setFastRotationY(float y) {
+ mRotationY = y;
+ mMatrixDirty = true;
+ }
+
+ /**
* Hit rectangle in parent's coordinates
*
* @param outRect The hit rectangle of the view.
@@ -6947,6 +6994,25 @@
}
/**
+ * @hide
+ */
+ public void fastInvalidate() {
+ if ((mPrivateFlags & (DRAWN | HAS_BOUNDS)) == (DRAWN | HAS_BOUNDS) ||
+ (mPrivateFlags & DRAWING_CACHE_VALID) == DRAWING_CACHE_VALID ||
+ (mPrivateFlags & INVALIDATED) != INVALIDATED) {
+ if (mParent instanceof View) {
+ ((View) mParent).mPrivateFlags |= INVALIDATED;
+ }
+ mPrivateFlags &= ~DRAWN;
+ mPrivateFlags |= INVALIDATED;
+ mPrivateFlags &= ~DRAWING_CACHE_VALID;
+ if (mParent != null && mAttachInfo != null && mAttachInfo.mHardwareAccelerated) {
+ mParent.invalidateChild(this, null);
+ }
+ }
+ }
+
+ /**
* Used to indicate that the parent of this view should clear its caches. This functionality
* is used to force the parent to rebuild its display list (when hardware-accelerated),
* which is necessary when various parent-managed properties of the view change, such as