Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
4de2fbdd
Commit
4de2fbdd
authored
1 year ago
by
Patrick Williams
Committed by
Android (Google) Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Update ViewRootImpl#getBufferTransformHint to use display rotation" into main
parents
4ecb85fd
65507cbb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/java/android/view/ViewRootImpl.java
+13
-9
13 additions, 9 deletions
core/java/android/view/ViewRootImpl.java
core/java/android/window/flags/window_surfaces.aconfig
+11
-0
11 additions, 0 deletions
core/java/android/window/flags/window_surfaces.aconfig
with
24 additions
and
9 deletions
core/java/android/view/ViewRootImpl.java
+
13
−
9
View file @
4de2fbdd
...
...
@@ -101,6 +101,7 @@ import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodCl
import static android.view.inputmethod.InputMethodEditorTraceProto.InputMethodClientsTraceProto.ClientSideProto.INSETS_CONTROLLER;
import static com.android.input.flags.Flags.enablePointerChoreographer;
import static com.android.window.flags.Flags.enableBufferTransformHintFromDisplay;
import android.Manifest;
import android.accessibilityservice.AccessibilityService;
...
...
@@ -997,8 +998,6 @@ public final class ViewRootImpl implements ViewParent,
*/
private final boolean mViewBoundsSandboxingEnabled;
private int mLastTransformHint = Integer.MIN_VALUE;
private AccessibilityWindowAttributes mAccessibilityWindowAttributes;
/*
...
...
@@ -8918,11 +8917,13 @@ public final class ViewRootImpl implements ViewParent,
final int transformHint = SurfaceControl.rotationToBufferTransform(
(mDisplay.getInstallOrientation() + mDisplay.getRotation()) % 4);
final boolean transformHintChanged = transformHint != mPreviousTransformHint;
mPreviousTransformHint = transformHint;
mSurfaceControl.setTransformHint(transformHint);
WindowLayout.computeSurfaceSize(mWindowAttributes, winConfig.getMaxBounds(), requestedWidth,
requestedHeight, mWinFrameInScreen, mPendingDragResizing, mSurfaceSize);
final boolean transformHintChanged = transformHint != mLastTransformHint;
final boolean sizeChanged = !mLastSurfaceSize.equals(mSurfaceSize);
final boolean surfaceControlChanged =
(relayoutResult & RELAYOUT_RES_SURFACE_CHANGED) == RELAYOUT_RES_SURFACE_CHANGED;
...
...
@@ -8951,10 +8952,6 @@ public final class ViewRootImpl implements ViewParent,
}
}
mLastTransformHint = transformHint;
mSurfaceControl.setTransformHint(transformHint);
if (mAttachInfo.mContentCaptureManager != null) {
ContentCaptureSession mainSession = mAttachInfo.mContentCaptureManager
.getMainContentCaptureSession();
...
...
@@ -8968,8 +8965,7 @@ public final class ViewRootImpl implements ViewParent,
mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl, mBlastBufferQueue);
}
mHdrRenderState.forceUpdateHdrSdrRatio();
if (mPreviousTransformHint != transformHint) {
mPreviousTransformHint = transformHint;
if (transformHintChanged) {
dispatchTransformHintChanged(transformHint);
}
} else {
...
...
@@ -11933,6 +11929,14 @@ public final class ViewRootImpl implements ViewParent,
@Override
public @SurfaceControl.BufferTransform int getBufferTransformHint() {
// TODO(b/326482114) We use mPreviousTransformHint (calculated using mDisplay's rotation)
// instead of mSurfaceControl#getTransformHint because there's a race where SurfaceFlinger
// can set an incorrect transform hint for a few frames before it is aware of the updated
// display rotation.
if (enableBufferTransformHintFromDisplay()) {
return mPreviousTransformHint;
}
if (mSurfaceControl.isValid()) {
return mSurfaceControl.getTransformHint();
} else {
...
...
This diff is collapsed.
Click to expand it.
core/java/android/window/flags/window_surfaces.aconfig
+
11
−
0
View file @
4de2fbdd
...
...
@@ -81,3 +81,14 @@ flag {
is_fixed_read_only: true
bug: "321263247"
}
flag {
namespace: "window_surfaces"
name: "enable_buffer_transform_hint_from_display"
description: "Always use display info to determine VRI's buffer transform hint"
is_fixed_read_only: true
bug: "301238858"
metadata {
purpose: PURPOSE_BUGFIX
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment