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.

TBR=asvitkine@chromium.org
R=dcastagna@chromium.org, enne@chromium.org, piman@chromium.org

Bug: 957485
Change-Id: I6f5927b0a95b764abcc63e0f4f44d56e8f6543ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594313
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#660266}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: af4ff97bf8db09c6c632f8753cb5c87ae483c064
2 files changed