summaryrefslogtreecommitdiff
path: root/core/java/android/view/ViewGroup.java
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2020-05-05 15:53:29 -0400
committerLeon Scroggins III <scroggo@google.com>2020-05-06 09:38:39 -0400
commit0f53e10c07ddfb0a95a8ef13d4f5ec91606dd5ed (patch)
tree758b9077801de5cd744e9bdd7031245b1757daf9 /core/java/android/view/ViewGroup.java
parentc8d49effd583b1c6b052c39e52d71d226c029dd0 (diff)
Switch Java calls to enableZ and disableZ; remove isRecordingFor
Bug: 155422223 Test: make insertInOrderBarrier and insertReorderBarrier are @hide and deprecated. Remove them and update all callers to enableZ and disableZ, which are already public. Update native code to refer to enableZ instead of insertReorderBarrier. In addition, remove @hide Canvas#isRecordingFor. This method was originally used to prevent a single RenderNode from being in two display lists. This is now supported, so there's no reason to avoid it. The one caller used it to determine whether to reorder drawing its child Views (which, as the comment says, makes sense to determine based on whether the Canvas isHardwareAccelerated) and whether to call insertReorderBarrier/insertInOrderBarrier (now enableZ/disableZ). In the latter case, there is no need for a conditional, since enableZ/disableZ only work on a hardware Canvas. Change-Id: Ib216a19d6aeff40b2e23532bacd62d1795c2ab27
Diffstat (limited to 'core/java/android/view/ViewGroup.java')
-rw-r--r--core/java/android/view/ViewGroup.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index e34e84c977ea..05babe939ec3 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -4105,13 +4105,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
@Override
protected void dispatchDraw(Canvas canvas) {
- boolean usingRenderNodeProperties = canvas.isRecordingFor(mRenderNode);
final int childrenCount = mChildrenCount;
final View[] children = mChildren;
int flags = mGroupFlags;
if ((flags & FLAG_RUN_ANIMATION) != 0 && canAnimate()) {
- final boolean buildCache = !isHardwareAccelerated();
for (int i = 0; i < childrenCount; i++) {
final View child = children[i];
if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) {
@@ -4152,12 +4150,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
boolean more = false;
final long drawingTime = getDrawingTime();
- if (usingRenderNodeProperties) canvas.insertReorderBarrier();
+ canvas.enableZ();
final int transientCount = mTransientIndices == null ? 0 : mTransientIndices.size();
int transientIndex = transientCount != 0 ? 0 : -1;
// Only use the preordered list if not HW accelerated, since the HW pipeline will do the
// draw reordering internally
- final ArrayList<View> preorderedList = usingRenderNodeProperties
+ final ArrayList<View> preorderedList = isHardwareAccelerated()
? null : buildOrderedChildList();
final boolean customOrder = preorderedList == null
&& isChildrenDrawingOrderEnabled();
@@ -4204,7 +4202,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
more |= drawChild(canvas, child, drawingTime);
}
}
- if (usingRenderNodeProperties) canvas.insertInorderBarrier();
+ canvas.disableZ();
if (isShowingLayoutBounds()) {
onDebugDraw(canvas);