DescriptionMac Overlays: Add sandwich strategy
On Mac, there can be arbitrary layering of overlays, which allows
for more flexiable strategies.
In this strategy, we create a sandwich of 3 layers
- The bottom bread is the output surface's main image.
- The meat is the video overlay. In principle, there could be an
arbitrary number of overlays in the middle. They must be opaque, and
are placed on top of the main image.
- The top bread is again the output surface's main image, this time
cropped to only include the damaged regions on top of the video
overlays. In principle, we should have as many small quads as possible
for this top layer (so that we do as little blending as possible). In
practice, the inflexibility of the QuadList structure makes having
more than one somewhat complicated.
On Mac, all overlays must be DIP aligned, because CALayer frames are
specified in DIPs, so plumb this down to the OverlayStrategy. Note that
it is not sufficient to put it in the OverlayValidator, because the
alignment of the overlays created by the OverlayStrategy needs to take
this into account.
Using the output surface's main image as the content for an overlay also
doesn't quite fit in the OverlayCandidate structure because the main
image doesn't have a ResourceId associated with it (only, rather, a
TextureId). Create a tag for "main image" OverlayCandidates, and pull
out the TextureId from the output surface in the GLRenderer at the last
moment (note that we haven't decided the TextureId when the strategy is
determined.
Break OverlayStrategyCommon's one virtual method into a
OverlayStrategyCommonDelegate, since the derived classes share no state
with their superclass.
Enumerate the strategies in the overlay candidate validator so that we
have a place to make Mac only use the sandwich validator (and ensure no
other platforms attempt it).
BUG=522627
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Committed: https://crrev.com/cf57c8d56ce3562cd6d4707394197dfb007af040
Cr-Commit-Position: refs/heads/master@{#345745}
Patch Set 1 #Patch Set 2 : Ready for pre-review #
Total comments: 5
Patch Set 3 : Not clear if this is better or worse #Patch Set 4 : Ready for review #Patch Set 5 : Rebase, fix compile #Patch Set 6 : fix ozone build #Patch Set 7 : One more time #
Total comments: 13
Patch Set 8 : incorporate review feedback #Messages
Total messages: 17 (4 generated)
|