summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-10-24 13:50:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-24 13:50:45 -0700
commit9933331506c91e535ba277bef9c44e1852ccf16c (patch)
treebfe7abd8e198a6ec3deeb9685f996a80dbca8780 /core
parent188bf0e63c30fa557dc897faf1b55da045b23ca0 (diff)
parentbd17bd34311ba5af4b6ac9ddc4b8c71888f2e6f1 (diff)
downloadframeworks_base-9933331506c91e535ba277bef9c44e1852ccf16c.zip
frameworks_base-9933331506c91e535ba277bef9c44e1852ccf16c.tar.gz
frameworks_base-9933331506c91e535ba277bef9c44e1852ccf16c.tar.bz2
Merge "Ensure we have a GL context before deleting View layers Bug #7391098" into jb-mr1-dev
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/HardwareRenderer.java53
1 files changed, 29 insertions, 24 deletions
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 59f941d..1c613245 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -1526,30 +1526,6 @@ public abstract class HardwareRenderer {
}
@Override
- void destroyLayers(View view) {
- if (view != null && isEnabled() && checkCurrent() != SURFACE_STATE_ERROR) {
- if (mCanvas != null) {
- mCanvas.clearLayerUpdates();
- }
- destroyHardwareLayer(view);
- GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS);
- }
- }
-
- private static void destroyHardwareLayer(View view) {
- view.destroyLayer(true);
-
- if (view instanceof ViewGroup) {
- ViewGroup group = (ViewGroup) view;
-
- int count = group.getChildCount();
- for (int i = 0; i < count; i++) {
- destroyHardwareLayer(group.getChildAt(i));
- }
- }
- }
-
- @Override
boolean safelyRun(Runnable action) {
boolean needsContext = true;
if (isEnabled() && checkCurrent() != SURFACE_STATE_ERROR) needsContext = false;
@@ -1574,6 +1550,35 @@ public abstract class HardwareRenderer {
}
@Override
+ void destroyLayers(final View view) {
+ if (view != null) {
+ safelyRun(new Runnable() {
+ @Override
+ public void run() {
+ if (mCanvas != null) {
+ mCanvas.clearLayerUpdates();
+ }
+ destroyHardwareLayer(view);
+ GLES20Canvas.flushCaches(GLES20Canvas.FLUSH_CACHES_LAYERS);
+ }
+ });
+ }
+ }
+
+ private static void destroyHardwareLayer(View view) {
+ view.destroyLayer(true);
+
+ if (view instanceof ViewGroup) {
+ ViewGroup group = (ViewGroup) view;
+
+ int count = group.getChildCount();
+ for (int i = 0; i < count; i++) {
+ destroyHardwareLayer(group.getChildAt(i));
+ }
+ }
+ }
+
+ @Override
void destroyHardwareResources(final View view) {
if (view != null) {
safelyRun(new Runnable() {