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

Commit 1aec9a22 authored by Romain Guy's avatar Romain Guy
Browse files

Don't enable hardware acceleration when the app owns the surface.

Bug #3323096

Change-Id: Ia8a15db844703199b3cee3d178f118159315c2b9
parent 9c957372
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -345,8 +345,6 @@ public final class ViewRoot extends Handler implements ViewParent,
                mWindowAttributes.copyFrom(attrs);
                mWindowAttributes.copyFrom(attrs);
                attrs = mWindowAttributes;
                attrs = mWindowAttributes;
                
                
                enableHardwareAcceleration(attrs);

                if (view instanceof RootViewSurfaceTaker) {
                if (view instanceof RootViewSurfaceTaker) {
                    mSurfaceHolderCallback =
                    mSurfaceHolderCallback =
                            ((RootViewSurfaceTaker)view).willYouTakeTheSurface();
                            ((RootViewSurfaceTaker)view).willYouTakeTheSurface();
@@ -355,6 +353,12 @@ public final class ViewRoot extends Handler implements ViewParent,
                        mSurfaceHolder.setFormat(PixelFormat.UNKNOWN);
                        mSurfaceHolder.setFormat(PixelFormat.UNKNOWN);
                    }
                    }
                }
                }

                // If the application owns the surface, don't enable hardware acceleration
                if (mSurfaceHolder == null) {
                    enableHardwareAcceleration(attrs);
                }

                Resources resources = mView.getContext().getResources();
                Resources resources = mView.getContext().getResources();
                CompatibilityInfo compatibilityInfo = resources.getCompatibilityInfo();
                CompatibilityInfo compatibilityInfo = resources.getCompatibilityInfo();
                mTranslator = compatibilityInfo.getTranslator();
                mTranslator = compatibilityInfo.getTranslator();