From 8de65a8e05285df52a1e6f0c1d5616dd233298a7 Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 9 Apr 2014 15:23:38 -0700 Subject: Switch DisplayListData to a staging model Bug: 13912977 Change-Id: I5b2f664e797be22a58300964f57ceb4fab60528c --- core/java/android/view/View.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'core/java/android/view/View.java') diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 6c414f6..9761f1a 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -13549,11 +13549,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return A new or reused DisplayList object. */ private void updateDisplayListIfDirty(@NonNull RenderNode renderNode, boolean isLayer) { - final HardwareRenderer renderer = getHardwareRenderer(); if (renderNode == null) { throw new IllegalArgumentException("RenderNode must not be null"); } - if (renderer == null || !canHaveDisplayList()) { + if (!canHaveDisplayList()) { // can't populate RenderNode, don't try return; } @@ -13627,21 +13626,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } } finally { - renderNode.end(renderer, canvas); + renderNode.end(canvas); renderNode.setCaching(caching); if (isLayer) { renderNode.setLeftTopRightBottom(0, 0, width, height); } else { setDisplayListProperties(renderNode); } - - if (renderer != getHardwareRenderer()) { - Log.w(VIEW_LOG_TAG, "View was detached during a draw() call!"); - // TODO: Should this be elevated to a crash? - // For now have it behaves the same as it previously did, it - // will result in the DisplayListData being destroyed later - // than it could be but oh well... - } } } else if (!isLayer) { mPrivateFlags |= PFLAG_DRAWN | PFLAG_DRAWING_CACHE_VALID; @@ -14913,7 +14904,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, final int height = bounds.height(); final HardwareCanvas canvas = displayList.start(width, height); drawable.draw(canvas); - displayList.end(getHardwareRenderer(), canvas); + displayList.end(canvas); // Set up drawable properties that are view-independent. displayList.setLeftTopRightBottom(bounds.left, bounds.top, bounds.right, bounds.bottom); -- cgit v1.1