Loading core/java/android/view/View.java +8 −1 Original line number Diff line number Diff line Loading @@ -7580,6 +7580,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * size than the view. This implies that your application must be able to handle this * size.</p> * * <p>You should avoid calling this method when hardware acceleration is enabled. If * you do not need the drawing cache bitmap, calling this method will increase memory * usage and cause the view to be rendered in software once, thus negatively impacting * performance.</p> * * @see #getDrawingCache() * @see #destroyDrawingCache() */ Loading Loading @@ -7699,7 +7704,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility canvas.translate(-mScrollX, -mScrollY); mPrivateFlags |= DRAWN; if (mAttachInfo == null || !mAttachInfo.mHardwareAccelerated) { mPrivateFlags |= DRAWING_CACHE_VALID; } // Fast path for layouts with no backgrounds if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) { Loading core/java/android/view/ViewGroup.java +9 −4 Original line number Diff line number Diff line Loading @@ -1867,14 +1867,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if ((mGroupFlags & FLAG_ANIMATION_CACHE) == FLAG_ANIMATION_CACHE) { final int count = mChildrenCount; final View[] children = mChildren; final boolean buildCache = !isHardwareAccelerated(); for (int i = 0; i < count; i++) { final View child = children[i]; if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) { child.setDrawingCacheEnabled(true); if (buildCache) { child.buildDrawingCache(true); } } } mGroupFlags |= FLAG_CHILDREN_DRAWN_WITH_CACHE; } Loading Loading @@ -1933,6 +1936,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if ((flags & FLAG_RUN_ANIMATION) != 0 && canAnimate()) { final boolean cache = (mGroupFlags & FLAG_ANIMATION_CACHE) == FLAG_ANIMATION_CACHE; final boolean buildCache = !isHardwareAccelerated(); for (int i = 0; i < count; i++) { final View child = children[i]; if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) { Loading @@ -1941,10 +1945,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager bindLayoutAnimation(child); if (cache) { child.setDrawingCacheEnabled(true); if (buildCache) { child.buildDrawingCache(true); } } } } final LayoutAnimationController controller = mLayoutAnimationController; if (controller.willOverlap()) { Loading Loading @@ -2205,8 +2211,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (!canvas.isHardwareAccelerated()) { cache = child.getDrawingCache(true); } else { // TODO: bring back // displayList = child.getDisplayList(); displayList = child.getDisplayList(); } } Loading core/java/android/view/ViewRoot.java +5 −0 Original line number Diff line number Diff line Loading @@ -562,6 +562,11 @@ public final class ViewRoot extends Handler implements ViewParent, View.AttachIn } } void invalidate() { mDirty.set(0, 0, mWidth, mHeight); scheduleTraversals(); } public ViewParent getParent() { return null; } Loading core/java/android/widget/SlidingDrawer.java +1 −1 Original line number Diff line number Diff line Loading @@ -652,7 +652,7 @@ public class SlidingDrawer extends ViewGroup { // Try only once... we should really loop but it's not a big deal // if the draw was cancelled, it will only be temporary anyway content.getViewTreeObserver().dispatchOnPreDraw(); content.buildDrawingCache(); if (!content.isHardwareAccelerated()) content.buildDrawingCache(); content.setVisibility(View.GONE); } Loading Loading
core/java/android/view/View.java +8 −1 Original line number Diff line number Diff line Loading @@ -7580,6 +7580,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * size than the view. This implies that your application must be able to handle this * size.</p> * * <p>You should avoid calling this method when hardware acceleration is enabled. If * you do not need the drawing cache bitmap, calling this method will increase memory * usage and cause the view to be rendered in software once, thus negatively impacting * performance.</p> * * @see #getDrawingCache() * @see #destroyDrawingCache() */ Loading Loading @@ -7699,7 +7704,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility canvas.translate(-mScrollX, -mScrollY); mPrivateFlags |= DRAWN; if (mAttachInfo == null || !mAttachInfo.mHardwareAccelerated) { mPrivateFlags |= DRAWING_CACHE_VALID; } // Fast path for layouts with no backgrounds if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) { Loading
core/java/android/view/ViewGroup.java +9 −4 Original line number Diff line number Diff line Loading @@ -1867,14 +1867,17 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if ((mGroupFlags & FLAG_ANIMATION_CACHE) == FLAG_ANIMATION_CACHE) { final int count = mChildrenCount; final View[] children = mChildren; final boolean buildCache = !isHardwareAccelerated(); for (int i = 0; i < count; i++) { final View child = children[i]; if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) { child.setDrawingCacheEnabled(true); if (buildCache) { child.buildDrawingCache(true); } } } mGroupFlags |= FLAG_CHILDREN_DRAWN_WITH_CACHE; } Loading Loading @@ -1933,6 +1936,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if ((flags & FLAG_RUN_ANIMATION) != 0 && canAnimate()) { final boolean cache = (mGroupFlags & FLAG_ANIMATION_CACHE) == FLAG_ANIMATION_CACHE; final boolean buildCache = !isHardwareAccelerated(); for (int i = 0; i < count; i++) { final View child = children[i]; if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) { Loading @@ -1941,10 +1945,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager bindLayoutAnimation(child); if (cache) { child.setDrawingCacheEnabled(true); if (buildCache) { child.buildDrawingCache(true); } } } } final LayoutAnimationController controller = mLayoutAnimationController; if (controller.willOverlap()) { Loading Loading @@ -2205,8 +2211,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (!canvas.isHardwareAccelerated()) { cache = child.getDrawingCache(true); } else { // TODO: bring back // displayList = child.getDisplayList(); displayList = child.getDisplayList(); } } Loading
core/java/android/view/ViewRoot.java +5 −0 Original line number Diff line number Diff line Loading @@ -562,6 +562,11 @@ public final class ViewRoot extends Handler implements ViewParent, View.AttachIn } } void invalidate() { mDirty.set(0, 0, mWidth, mHeight); scheduleTraversals(); } public ViewParent getParent() { return null; } Loading
core/java/android/widget/SlidingDrawer.java +1 −1 Original line number Diff line number Diff line Loading @@ -652,7 +652,7 @@ public class SlidingDrawer extends ViewGroup { // Try only once... we should really loop but it's not a big deal // if the draw was cancelled, it will only be temporary anyway content.getViewTreeObserver().dispatchOnPreDraw(); content.buildDrawingCache(); if (!content.isHardwareAccelerated()) content.buildDrawingCache(); content.setVisibility(View.GONE); } Loading