Merge "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 the application owns the surface, don't enable hardware acceleration
|
||||||
if (mSurfaceHolder == null) {
|
if (mSurfaceHolder == null) {
|
||||||
enableHardwareAcceleration(attrs);
|
enableHardwareAcceleration(attrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
CompatibilityInfo compatibilityInfo = mCompatibilityInfo.get();
|
|
||||||
mTranslator = compatibilityInfo.getTranslator();
|
|
||||||
|
|
||||||
if (mTranslator != null) {
|
|
||||||
mSurface.setCompatibilityTranslator(mTranslator);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean restore = false;
|
boolean restore = false;
|
||||||
if (mTranslator != null) {
|
if (mTranslator != null) {
|
||||||
|
mSurface.setCompatibilityTranslator(mTranslator);
|
||||||
restore = true;
|
restore = true;
|
||||||
attrs.backup();
|
attrs.backup();
|
||||||
mTranslator.translateWindowLayout(attrs);
|
mTranslator.translateWindowLayout(attrs);
|
||||||
@@ -590,6 +587,9 @@ public final class ViewRootImpl extends Handler implements ViewParent,
|
|||||||
mAttachInfo.mHardwareAccelerated = false;
|
mAttachInfo.mHardwareAccelerated = false;
|
||||||
mAttachInfo.mHardwareAccelerationRequested = 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
|
// Try to enable hardware acceleration if requested
|
||||||
final boolean hardwareAccelerated =
|
final boolean hardwareAccelerated =
|
||||||
(attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0;
|
(attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user