diff options
| author | 2023-12-19 19:23:11 +0000 | |
|---|---|---|
| committer | 2024-03-20 19:40:12 +0000 | |
| commit | 56cfd53bcf7894cd41af1c01bb8fce1ff5691818 (patch) | |
| tree | aeb04709aaf614a5ed4e7e640d68384792fc69c7 | |
| parent | ace5c353db4fd0ca6f30f916fbb2413dcc064854 (diff) | |
Move setColorSpaceAgnostic to VRI
The request can be done client side.
Bug: 308662081
Test: Builds
Change-Id: I9abf2d6c55919f8cc7e05dbc04fdb19c10124b8f
4 files changed, 31 insertions, 5 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index cae66720e49e..3c3029a66517 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -115,6 +115,7 @@ import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodCl import static com.android.input.flags.Flags.enablePointerChoreographer; import static com.android.window.flags.Flags.enableBufferTransformHintFromDisplay; +import static com.android.window.flags.Flags.setScPropertiesInClient; import android.Manifest; import android.accessibilityservice.AccessibilityService; @@ -3522,6 +3523,16 @@ public final class ViewRootImpl implements ViewParent, mTransaction.setDefaultFrameRateCompatibility(mSurfaceControl, Surface.FRAME_RATE_COMPATIBILITY_NO_VOTE).apply(); } + + if (setScPropertiesInClient()) { + if (surfaceControlChanged || windowAttributesChanged) { + boolean colorSpaceAgnostic = (lp.privateFlags + & WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC) + != 0; + mTransaction.setColorSpaceAgnostic(mSurfaceControl, colorSpaceAgnostic) + .apply(); + } + } } if (DEBUG_LAYOUT) Log.v(mTag, "relayout: frame=" + frame.toShortString() diff --git a/core/java/android/window/flags/window_surfaces.aconfig b/core/java/android/window/flags/window_surfaces.aconfig index 3f483418c6b3..2670b1ba9521 100644 --- a/core/java/android/window/flags/window_surfaces.aconfig +++ b/core/java/android/window/flags/window_surfaces.aconfig @@ -92,3 +92,11 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + namespace: "window_surfaces" + name: "set_sc_properties_in_client" + description: "Set VRI SC properties in the client instead of system server" + is_fixed_read_only: true + bug: "308662081" +} diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 207b1bbcea16..ea968475584c 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -154,6 +154,7 @@ import static com.android.server.wm.WindowManagerServiceDumpProto.POLICY; import static com.android.server.wm.WindowManagerServiceDumpProto.ROOT_WINDOW_CONTAINER; import static com.android.server.wm.WindowManagerServiceDumpProto.WINDOW_FRAMES_VALID; import static com.android.window.flags.Flags.multiCrop; +import static com.android.window.flags.Flags.setScPropertiesInClient; import android.Manifest; import android.Manifest.permission; @@ -2328,9 +2329,12 @@ public class WindowManagerService extends IWindowManager.Stub updateNonSystemOverlayWindowsVisibilityIfNeeded( win, win.mWinAnimator.getShown()); } - if ((attrChanges & (WindowManager.LayoutParams.PRIVATE_FLAGS_CHANGED)) != 0) { - winAnimator.setColorSpaceAgnosticLocked((win.mAttrs.privateFlags - & WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC) != 0); + if (!setScPropertiesInClient()) { + if ((attrChanges & (WindowManager.LayoutParams.PRIVATE_FLAGS_CHANGED)) != 0) { + winAnimator.setColorSpaceAgnosticLocked((win.mAttrs.privateFlags + & WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC) + != 0); + } } // See if the DisplayWindowPolicyController wants to keep the activity on the window if (displayContent.mDwpcHelper.hasController() diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 7f7c2493cd68..a242d4242388 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -45,6 +45,7 @@ import static com.android.server.wm.WindowStateAnimatorProto.DRAW_STATE; import static com.android.server.wm.WindowStateAnimatorProto.SURFACE; import static com.android.server.wm.WindowStateAnimatorProto.SYSTEM_DECOR_RECT; import static com.android.window.flags.Flags.secureWindowState; +import static com.android.window.flags.Flags.setScPropertiesInClient; import android.content.Context; import android.graphics.PixelFormat; @@ -311,8 +312,10 @@ class WindowStateAnimator { mSurfaceController = new WindowSurfaceController(attrs.getTitle().toString(), format, flags, this, attrs.type); - mSurfaceController.setColorSpaceAgnostic(w.getPendingTransaction(), - (attrs.privateFlags & LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC) != 0); + if (!setScPropertiesInClient()) { + mSurfaceController.setColorSpaceAgnostic(w.getPendingTransaction(), + (attrs.privateFlags & LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC) != 0); + } w.setHasSurface(true); // The surface instance is changed. Make sure the input info can be applied to the |