am 436e270f: Merge "Disable hardware acceleration for apps in compatibility mode"
* commit '436e270fbb607d62d59e3694ff46c87fa156f78b': Disable hardware acceleration for apps in compatibility mode
This commit is contained in:
@@ -425,20 +425,17 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
||||
}
|
||||
}
|
||||
|
||||
CompatibilityInfo compatibilityInfo = mCompatibilityInfo.get();
|
||||
mTranslator = compatibilityInfo.getTranslator();
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user