viz: Apply screen rotation to Display rendering for SurfaceControl.

If the display is rotated, the app is required to apply this rotation at
render time to produce buffers sized to the display's default
orientation if they will be used at scanout. Failing to do so forces
that layer to go through GPU composition in SurfaceFlinger on Android.

This change forwards the current screen rotation to the viz::Display in
the GPU process so it can be applied to the aggregated CompositorFrame
at draw time. If the root render pass has any copy requests, an
additional render pass is added to ensure that the display transform is
not applied to the result of those requests.

In addition, since SurfaceControl requires the display and damage rects
to be in the pre display transform screen space, the OutputSurface
implementation takes care of this on the client side itself.,,

Bug: 957485
Change-Id: I6f5927b0a95b764abcc63e0f4f44d56e8f6543ff
Reviewed-by: Khushal <>
Reviewed-by: danakj <>
Reviewed-by: Daniele Castagna <>
Reviewed-by: Antoine Labour <>
Reviewed-by: Tom Sepez <>
Reviewed-by: Bo <>
Reviewed-by: enne <>
Commit-Queue: Khushal <>
Auto-Submit: Khushal <>
Cr-Original-Commit-Position: refs/heads/master@{#660266}
Cr-Mirrored-Commit: af4ff97bf8db09c6c632f8753cb5c87ae483c064
2 files changed