@@ -701,8 +701,13 @@ private void enableHardwareAcceleration(WindowManager.LayoutParams attrs) {
701701 final boolean forceHwAccelerated = (attrs .privateFlags &
702702 WindowManager .LayoutParams .PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED ) != 0 ;
703703
704- if (!HardwareRenderer .sRendererDisabled || (HardwareRenderer .sSystemRendererDisabled
705- && forceHwAccelerated )) {
704+ if (fakeHwAccelerated ) {
705+ // This is exclusively for the preview windows the window manager
706+ // shows for launching applications, so they will look more like
707+ // the app being launched.
708+ mAttachInfo .mHardwareAccelerationRequested = true ;
709+ } else if (!HardwareRenderer .sRendererDisabled
710+ || (HardwareRenderer .sSystemRendererDisabled && forceHwAccelerated )) {
706711 if (mAttachInfo .mHardwareRenderer != null ) {
707712 mAttachInfo .mHardwareRenderer .destroy ();
708713 }
@@ -714,13 +719,6 @@ private void enableHardwareAcceleration(WindowManager.LayoutParams attrs) {
714719 mAttachInfo .mHardwareAccelerated =
715720 mAttachInfo .mHardwareAccelerationRequested = true ;
716721 }
717- } else if (fakeHwAccelerated ) {
718- // The window had wanted to use hardware acceleration, but this
719- // is not allowed in its process. By setting this flag, it can
720- // still render as if it was accelerated. This is basically for
721- // the preview windows the window manager shows for launching
722- // applications, so they will look more like the app being launched.
723- mAttachInfo .mHardwareAccelerationRequested = true ;
724722 }
725723 }
726724 }
0 commit comments