@@ -1530,14 +1530,6 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
15301530 */
15311531 static final ThreadLocal<Rect> sThreadLocal = new ThreadLocal<Rect>();
15321532
1533- /**
1534- * Temporary flag, used to enable processing of View properties in the native DisplayList
1535- * object instead of during draw(). Soon to be enabled by default for hardware-accelerated
1536- * apps.
1537- * @hide
1538- */
1539- public static final boolean USE_DISPLAY_LIST_PROPERTIES = true;
1540-
15411533 /**
15421534 * Map used to store views' tags.
15431535 */
@@ -8269,7 +8261,7 @@ public void setCameraDistance(float distance) {
82698261 info.mMatrixDirty = true;
82708262
82718263 invalidateViewProperty(false, false);
8272- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8264+ if (mDisplayList != null) {
82738265 mDisplayList.setCameraDistance(-Math.abs(distance) / dpi);
82748266 }
82758267 }
@@ -8311,7 +8303,7 @@ public void setRotation(float rotation) {
83118303 info.mRotation = rotation;
83128304 info.mMatrixDirty = true;
83138305 invalidateViewProperty(false, true);
8314- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8306+ if (mDisplayList != null) {
83158307 mDisplayList.setRotation(rotation);
83168308 }
83178309 }
@@ -8358,7 +8350,7 @@ public void setRotationY(float rotationY) {
83588350 info.mRotationY = rotationY;
83598351 info.mMatrixDirty = true;
83608352 invalidateViewProperty(false, true);
8361- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8353+ if (mDisplayList != null) {
83628354 mDisplayList.setRotationY(rotationY);
83638355 }
83648356 }
@@ -8405,7 +8397,7 @@ public void setRotationX(float rotationX) {
84058397 info.mRotationX = rotationX;
84068398 info.mMatrixDirty = true;
84078399 invalidateViewProperty(false, true);
8408- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8400+ if (mDisplayList != null) {
84098401 mDisplayList.setRotationX(rotationX);
84108402 }
84118403 }
@@ -8444,7 +8436,7 @@ public void setScaleX(float scaleX) {
84448436 info.mScaleX = scaleX;
84458437 info.mMatrixDirty = true;
84468438 invalidateViewProperty(false, true);
8447- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8439+ if (mDisplayList != null) {
84488440 mDisplayList.setScaleX(scaleX);
84498441 }
84508442 }
@@ -8483,7 +8475,7 @@ public void setScaleY(float scaleY) {
84838475 info.mScaleY = scaleY;
84848476 info.mMatrixDirty = true;
84858477 invalidateViewProperty(false, true);
8486- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8478+ if (mDisplayList != null) {
84878479 mDisplayList.setScaleY(scaleY);
84888480 }
84898481 }
@@ -8530,7 +8522,7 @@ public void setPivotX(float pivotX) {
85308522 info.mPivotX = pivotX;
85318523 info.mMatrixDirty = true;
85328524 invalidateViewProperty(false, true);
8533- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8525+ if (mDisplayList != null) {
85348526 mDisplayList.setPivotX(pivotX);
85358527 }
85368528 }
@@ -8576,7 +8568,7 @@ public void setPivotY(float pivotY) {
85768568 info.mPivotY = pivotY;
85778569 info.mMatrixDirty = true;
85788570 invalidateViewProperty(false, true);
8579- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8571+ if (mDisplayList != null) {
85808572 mDisplayList.setPivotY(pivotY);
85818573 }
85828574 }
@@ -8642,7 +8634,7 @@ public void setAlpha(float alpha) {
86428634 } else {
86438635 mPrivateFlags &= ~ALPHA_SET;
86448636 invalidateViewProperty(true, false);
8645- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8637+ if (mDisplayList != null) {
86468638 mDisplayList.setAlpha(alpha);
86478639 }
86488640 }
@@ -8669,7 +8661,7 @@ boolean setAlphaNoInvalidation(float alpha) {
86698661 return true;
86708662 } else {
86718663 mPrivateFlags &= ~ALPHA_SET;
8672- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8664+ if (mDisplayList != null) {
86738665 mDisplayList.setAlpha(alpha);
86748666 }
86758667 }
@@ -8721,7 +8713,7 @@ public final void setTop(int top) {
87218713 int oldHeight = mBottom - mTop;
87228714
87238715 mTop = top;
8724- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8716+ if (mDisplayList != null) {
87258717 mDisplayList.setTop(mTop);
87268718 }
87278719
@@ -8790,7 +8782,7 @@ public final void setBottom(int bottom) {
87908782 int oldHeight = mBottom - mTop;
87918783
87928784 mBottom = bottom;
8793- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8785+ if (mDisplayList != null) {
87948786 mDisplayList.setBottom(mBottom);
87958787 }
87968788
@@ -8853,7 +8845,7 @@ public final void setLeft(int left) {
88538845 int height = mBottom - mTop;
88548846
88558847 mLeft = left;
8856- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8848+ if (mDisplayList != null) {
88578849 mDisplayList.setLeft(left);
88588850 }
88598851
@@ -8869,9 +8861,6 @@ public final void setLeft(int left) {
88698861 }
88708862 mBackgroundSizeChanged = true;
88718863 invalidateParentIfNeeded();
8872- if (USE_DISPLAY_LIST_PROPERTIES) {
8873-
8874- }
88758864 }
88768865 }
88778866
@@ -8916,7 +8905,7 @@ public final void setRight(int right) {
89168905 int height = mBottom - mTop;
89178906
89188907 mRight = right;
8919- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
8908+ if (mDisplayList != null) {
89208909 mDisplayList.setRight(mRight);
89218910 }
89228911
@@ -9013,7 +9002,7 @@ public void setTranslationX(float translationX) {
90139002 info.mTranslationX = translationX;
90149003 info.mMatrixDirty = true;
90159004 invalidateViewProperty(false, true);
9016- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
9005+ if (mDisplayList != null) {
90179006 mDisplayList.setTranslationX(translationX);
90189007 }
90199008 }
@@ -9050,7 +9039,7 @@ public void setTranslationY(float translationY) {
90509039 info.mTranslationY = translationY;
90519040 info.mMatrixDirty = true;
90529041 invalidateViewProperty(false, true);
9053- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
9042+ if (mDisplayList != null) {
90549043 mDisplayList.setTranslationY(translationY);
90559044 }
90569045 }
@@ -9161,7 +9150,7 @@ public void offsetTopAndBottom(int offset) {
91619150 final boolean matrixIsIdentity = mTransformationInfo == null
91629151 || mTransformationInfo.mMatrixIsIdentity;
91639152 if (matrixIsIdentity) {
9164- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
9153+ if (mDisplayList != null) {
91659154 invalidateViewProperty(false, false);
91669155 } else {
91679156 final ViewParent p = mParent;
@@ -9189,7 +9178,7 @@ public void offsetTopAndBottom(int offset) {
91899178
91909179 mTop += offset;
91919180 mBottom += offset;
9192- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
9181+ if (mDisplayList != null) {
91939182 mDisplayList.offsetTopBottom(offset);
91949183 invalidateViewProperty(false, false);
91959184 } else {
@@ -9212,7 +9201,7 @@ public void offsetLeftAndRight(int offset) {
92129201 final boolean matrixIsIdentity = mTransformationInfo == null
92139202 || mTransformationInfo.mMatrixIsIdentity;
92149203 if (matrixIsIdentity) {
9215- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
9204+ if (mDisplayList != null) {
92169205 invalidateViewProperty(false, false);
92179206 } else {
92189207 final ViewParent p = mParent;
@@ -9237,7 +9226,7 @@ public void offsetLeftAndRight(int offset) {
92379226
92389227 mLeft += offset;
92399228 mRight += offset;
9240- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
9229+ if (mDisplayList != null) {
92419230 mDisplayList.offsetLeftRight(offset);
92429231 invalidateViewProperty(false, false);
92439232 } else {
@@ -9666,8 +9655,7 @@ void invalidate(boolean invalidateCache) {
96669655 * list properties are not being used in this view
96679656 */
96689657 void invalidateViewProperty(boolean invalidateParent, boolean forceRedraw) {
9669- if (!USE_DISPLAY_LIST_PROPERTIES || mDisplayList == null ||
9670- (mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION) {
9658+ if (mDisplayList == null || (mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION) {
96719659 if (invalidateParent) {
96729660 invalidateParentCaches();
96739661 }
@@ -11759,7 +11747,7 @@ private DisplayList getDisplayList(DisplayList displayList, boolean isLayer) {
1175911747 int layerType = (
1176011748 !(mParent instanceof ViewGroup) || ((ViewGroup)mParent).mDrawLayers) ?
1176111749 getLayerType() : LAYER_TYPE_NONE;
11762- if (!isLayer && layerType != LAYER_TYPE_NONE && USE_DISPLAY_LIST_PROPERTIES ) {
11750+ if (!isLayer && layerType != LAYER_TYPE_NONE) {
1176311751 if (layerType == LAYER_TYPE_HARDWARE) {
1176411752 final HardwareLayer layer = getHardwareLayer();
1176511753 if (layer != null && layer.isValid()) {
@@ -11782,9 +11770,6 @@ private DisplayList getDisplayList(DisplayList displayList, boolean isLayer) {
1178211770
1178311771 computeScroll();
1178411772
11785- if (!USE_DISPLAY_LIST_PROPERTIES) {
11786- restoreCount = canvas.save();
11787- }
1178811773 canvas.translate(-mScrollX, -mScrollY);
1178911774 if (!isLayer) {
1179011775 mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID;
@@ -11799,16 +11784,11 @@ private DisplayList getDisplayList(DisplayList displayList, boolean isLayer) {
1179911784 }
1180011785 }
1180111786 } finally {
11802- if (USE_DISPLAY_LIST_PROPERTIES) {
11803- canvas.restoreToCount(restoreCount);
11804- }
1180511787 canvas.onPostDraw();
1180611788
1180711789 displayList.end();
11808- if (USE_DISPLAY_LIST_PROPERTIES) {
11809- displayList.setCaching(caching);
11810- }
11811- if (isLayer && USE_DISPLAY_LIST_PROPERTIES) {
11790+ displayList.setCaching(caching);
11791+ if (isLayer) {
1181211792 displayList.setLeftTopRightBottom(0, 0, width, height);
1181311793 } else {
1181411794 setDisplayListProperties(displayList);
@@ -12400,7 +12380,7 @@ void setDisplayListProperties() {
1240012380 * previously-set transform values
1240112381 */
1240212382 void setDisplayListProperties(DisplayList displayList) {
12403- if (USE_DISPLAY_LIST_PROPERTIES && displayList != null) {
12383+ if (displayList != null) {
1240412384 displayList.setLeftTopRightBottom(mLeft, mTop, mRight, mBottom);
1240512385 displayList.setHasOverlappingRendering(hasOverlappingRendering());
1240612386 if (mParent instanceof ViewGroup) {
@@ -12460,8 +12440,7 @@ void setDisplayListProperties(DisplayList displayList) {
1246012440 * to be called from anywhere else other than ViewGroup.drawChild().
1246112441 */
1246212442 boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
12463- boolean useDisplayListProperties = USE_DISPLAY_LIST_PROPERTIES && mAttachInfo != null &&
12464- mAttachInfo.mHardwareAccelerated;
12443+ boolean useDisplayListProperties = mAttachInfo != null && mAttachInfo.mHardwareAccelerated;
1246512444 boolean more = false;
1246612445 final boolean childHasIdentityMatrix = hasIdentityMatrix();
1246712446 final int flags = parent.mGroupFlags;
@@ -12722,8 +12701,7 @@ boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
1272212701 }
1272312702 } else {
1272412703 mPrivateFlags &= ~DIRTY_MASK;
12725- ((HardwareCanvas) canvas).drawDisplayList(displayList,
12726- mRight - mLeft, mBottom - mTop, null, flags);
12704+ ((HardwareCanvas) canvas).drawDisplayList(displayList, null, flags);
1272712705 }
1272812706 }
1272912707 } else if (cache != null) {
@@ -13211,7 +13189,7 @@ protected boolean setFrame(int left, int top, int right, int bottom) {
1321113189 mTop = top;
1321213190 mRight = right;
1321313191 mBottom = bottom;
13214- if (USE_DISPLAY_LIST_PROPERTIES && mDisplayList != null) {
13192+ if (mDisplayList != null) {
1321513193 mDisplayList.setLeftTopRightBottom(mLeft, mTop, mRight, mBottom);
1321613194 }
1321713195
0 commit comments