Closed Bug 1370672 Opened 7 years ago Closed 6 years ago

Ensure rotation cases are properly handled in webrender

Categories

(Core :: Graphics: WebRender, enhancement, P2)

Other Branch
enhancement

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox56 --- unaffected
firefox57 --- unaffected

People

(Reporter: kats, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [wr-reserve] [gfx-noted][retest])

There's some rotation code in the compositor, like [1] and [2] that isn't really hooked up to webrender. We should determine what user actions exercise this rotation code (e.g. does rotating a Windows tablet run this code?) and make sure those cases work with WR enabled. [1] http://searchfox.org/mozilla-central/rev/20963d7269b1b14d455f47bc0260d0653015bf84/gfx/layers/ipc/CompositorBridgeParent.cpp#1169 [2] http://searchfox.org/mozilla-central/rev/20963d7269b1b14d455f47bc0260d0653015bf84/gfx/layers/composite/AsyncCompositionManager.cpp#193
Priority: P3 → P2
Whiteboard: [gfx-noted] → [wr-mvp] [gfx-noted]
Priority: P2 → P3
Whiteboard: [wr-mvp] [gfx-noted] → [wr-reserve] [gfx-noted]
Assignee: nobody → kvark
BTW I did some basic rotation testing on my Windows tablet and it seems to work fine. I didn't verify if it is actually exercising the codepaths I linked in comment 0.
Priority: P1 → P2
Whiteboard: [wr-reserve] [gfx-noted] → [wr-reserve] [gfx-noted][retest]
Kats, do you want to decide what needs to still be done here. What priority should this be?
Assignee: kvark → kats
Flags: needinfo?(kats)
Since rotation works fine on Windows we don't need this for the MVP. If anything this might be relevant for Android.
Assignee: kats → nobody
Blocks: stage-wr-next, wr-android
No longer blocks: stage-wr-trains
Flags: needinfo?(kats)

Most likely there's nothing that needs doing here, but we should verify.

On android, webrender does not need to handle rotation, since an android application's rotation is handled by android os, though webrender needs to handle size change. webrender needs to handle rotation only when os/platform does not handle application's rotation.

On android, dynamic screen rotation is detected by MyOrientationListener(extends WindowOrientationListener). WindowOrientationListener receives notifications from the SensorManager when the orientation of the device has changed.

http://androidxref.com/9.0.0_r3/xref/frameworks/base/services/core/java/com/android/server/policy/WindowOrientationListener.java#49
http://androidxref.com/9.0.0_r3/xref/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java#1047

Then rotation update is notified to DisplayContent like the following.

MyOrientationListener.onProposedRotationChanged()
->PhoneWindowManager.updateRotation()
->WindowManagerService.updateRotation()
->DisplayContent.updateRotationUnchecked()

Then SurfaceControl.Transaction.setDisplayProjection() is called via DisplayManagerService like the following.

DisplayContent.updateRotationUnchecked()
->DisplayManagerService.LocalService.performTraversal()
->DisplayManagerService.performTraversalLocked()
->DisplayManagerService.configureDisplayLocked()
->LogicalDisplay.configureDisplayLocked()
->DisplayDevice.setProjectionLocked()
->SurfaceControl.Transaction.setDisplayProjection()

Then the transaction updates the display's orientation by DisplayDevice::setProjection()

http://androidxref.com/9.0.0_r3/xref/frameworks/native/services/surfaceflinger/DisplayDevice.cpp#560

On android, WebRender renders to Surface(ANativeWindow) of SurfaceView. The SurfaceView's rotation is automatically handled by android os, though it needs to handle size change.

https://github.com/sotaroikeda/firefox-diagrams/blob/master/mobile/mobile_GeckoSession_68.pdf

Great! So I guess we can just close this bug, there's nothing to do here.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.