diff options
Diffstat (limited to 'core/java/android/view')
-rw-r--r-- | core/java/android/view/View.java | 6 | ||||
-rw-r--r-- | core/java/android/view/ViewGroup.java | 43 |
2 files changed, 2 insertions, 47 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index a6a5427..b6f0aa2 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -12363,9 +12363,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, canvas.setViewport(width, height); // The dirty rect should always be null for a display list canvas.onPreDraw(null); - int layerType = ( - !(mParent instanceof ViewGroup) || ((ViewGroup)mParent).mDrawLayers) ? - getLayerType() : LAYER_TYPE_NONE; + int layerType = getLayerType(); if (!isLayer && layerType != LAYER_TYPE_NONE) { if (layerType == LAYER_TYPE_HARDWARE) { final HardwareLayer layer = getHardwareLayer(); @@ -13072,7 +13070,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, boolean scalingRequired = false; boolean caching; - int layerType = parent.mDrawLayers ? getLayerType() : LAYER_TYPE_NONE; + int layerType = getLayerType(); final boolean hardwareAccelerated = canvas.isHardwareAccelerated(); if ((flags & ViewGroup.FLAG_CHILDREN_DRAWN_WITH_CACHE) != 0 || diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 257b861..f66c4de 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -404,10 +404,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // views during a transition when they otherwise would have become gone/invisible private ArrayList<View> mVisibilityChangingChildren; - // Indicates whether this container will use its children layers to draw - @ViewDebug.ExportedProperty(category = "drawing") - boolean mDrawLayers = true; - // Indicates how many of this container's child subtrees contain transient state @ViewDebug.ExportedProperty(category = "layout") private int mChildCountWithTransientState = 0; @@ -2930,45 +2926,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } /** - * - * @param enabled True if children should be drawn with layers, false otherwise. - * - * @hide - */ - public void setChildrenLayersEnabled(boolean enabled) { - if (enabled != mDrawLayers) { - mDrawLayers = enabled; - invalidate(true); - - boolean flushLayers = !enabled; - AttachInfo info = mAttachInfo; - if (info != null && info.mHardwareRenderer != null && - info.mHardwareRenderer.isEnabled()) { - if (!info.mHardwareRenderer.validate()) { - flushLayers = false; - } - } else { - flushLayers = false; - } - - // We need to invalidate any child with a layer. For instance, - // if a child is backed by a hardware layer and we disable layers - // the child is marked as not dirty (flags cleared the last time - // the child was drawn inside its layer.) However, that child might - // never have created its own display list or have an obsolete - // display list. By invalidating the child we ensure the display - // list is in sync with the content of the hardware layer. - for (int i = 0; i < mChildrenCount; i++) { - View child = mChildren[i]; - if (child.mLayerType != LAYER_TYPE_NONE) { - if (flushLayers) child.flushLayer(); - child.invalidate(true); - } - } - } - } - - /** * By default, children are clipped to their bounds before drawing. This * allows view groups to override this behavior for animations, etc. * |