diff options
Diffstat (limited to 'core/java/android/view/View.java')
| -rw-r--r-- | core/java/android/view/View.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index c64f564..5e8f31a 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -8227,6 +8227,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * @hide */ protected void dispatchGetDisplayList() {} + + /** + * A view that is not attached or hardware accelerated cannot create a display list. + * This method checks these conditions and returns the appropriate result. + * + * @return true if view has the ability to create a display list, false otherwise. + * + * @hide + */ + public boolean canHaveDisplayList() { + if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null) { + return false; + } + return true; + } /** * <p>Returns a display list that can be used to draw this view again @@ -8237,7 +8252,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * @hide */ public DisplayList getDisplayList() { - if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null) { + if (!canHaveDisplayList()) { return null; } |
