Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 436e270f authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Disable hardware acceleration for apps in compatibility mode"

parents 708fd1a5 856d4e1a
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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;