summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2011-10-14 15:48:40 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-10-14 15:48:40 -0700
commit436e270fbb607d62d59e3694ff46c87fa156f78b (patch)
treef92eb3e47c13e8d26f7c4278c6da3aa10ae2af45
parent708fd1a5f90483153a0ec43c8f5588141acaba0e (diff)
parent856d4e1a872b5aed6792b33e0360554cb3d19eed (diff)
Merge "Disable hardware acceleration for apps in compatibility mode"
-rw-r--r--core/java/android/view/ViewRootImpl.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 7eae7395e919..b9e0fe8b6f1b 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -425,20 +425,17 @@ public final class ViewRootImpl extends Handler implements ViewParent,
}
}
- // If the application owns the surface, don't enable hardware acceleration
- if (mSurfaceHolder == null) {
- enableHardwareAcceleration(attrs);
- }
-
CompatibilityInfo compatibilityInfo = mCompatibilityInfo.get();
mTranslator = compatibilityInfo.getTranslator();
- if (mTranslator != null) {
- mSurface.setCompatibilityTranslator(mTranslator);
+ // If the application owns the surface, don't enable hardware acceleration
+ if (mSurfaceHolder == null) {
+ enableHardwareAcceleration(attrs);
}
boolean restore = false;
if (mTranslator != null) {
+ mSurface.setCompatibilityTranslator(mTranslator);
restore = true;
attrs.backup();
mTranslator.translateWindowLayout(attrs);
@@ -590,6 +587,9 @@ public final class ViewRootImpl extends Handler implements ViewParent,
mAttachInfo.mHardwareAccelerated = false;
mAttachInfo.mHardwareAccelerationRequested = false;
+ // Don't enable hardware acceleration when the application is in compatibility mode
+ if (mTranslator != null) return;
+
// Try to enable hardware acceleration if requested
final boolean hardwareAccelerated =
(attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0;