Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Issue 1304303002: Mac Overlays: Add sandwich strategy (Closed)

Created:
5 years, 4 months ago by ccameron
Modified:
5 years, 3 months ago
CC:
chromium-reviews, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, cc-bugs_chromium.org, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@overlay_debug
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+537 lines, -93 lines) Patch
M cc/BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 6 7 1 chunk +12 lines, -8 lines 0 comments Download
M cc/output/gl_renderer_unittest.cc View 1 2 3 6 chunks +15 lines, -6 lines 0 comments Download
M cc/output/output_surface.h View 1 2 3 2 chunks +5 lines, -1 line 0 comments Download
M cc/output/output_surface.cc View 1 2 3 2 chunks +4 lines, -4 lines 0 comments Download
M cc/output/overlay_candidate.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M cc/output/overlay_candidate.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M cc/output/overlay_candidate_validator.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M cc/output/overlay_processor.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M cc/output/overlay_processor.cc View 1 2 3 2 chunks +6 lines, -9 lines 0 comments Download
M cc/output/overlay_strategy_common.h View 1 2 3 2 chunks +20 lines, -12 lines 0 comments Download
M cc/output/overlay_strategy_common.cc View 1 2 3 3 chunks +9 lines, -6 lines 0 comments Download
A cc/output/overlay_strategy_sandwich.h View 1 2 3 1 chunk +34 lines, -0 lines 0 comments Download
A cc/output/overlay_strategy_sandwich.cc View 1 2 3 4 5 6 7 1 chunk +145 lines, -0 lines 0 comments Download
M cc/output/overlay_strategy_single_on_top.h View 1 2 3 1 chunk +7 lines, -4 lines 0 comments Download
M cc/output/overlay_strategy_single_on_top.cc View 1 2 3 2 chunks +5 lines, -7 lines 0 comments Download
M cc/output/overlay_strategy_underlay.h View 1 2 3 1 chunk +6 lines, -4 lines 0 comments Download
M cc/output/overlay_strategy_underlay.cc View 1 2 3 1 chunk +3 lines, -6 lines 0 comments Download
M cc/output/overlay_unittest.cc View 1 2 3 7 chunks +222 lines, -22 lines 0 comments Download
M content/browser/compositor/browser_compositor_overlay_candidate_validator_mac.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/compositor/browser_compositor_overlay_candidate_validator_mac.mm View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/compositor/browser_compositor_overlay_candidate_validator_ozone.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/compositor/browser_compositor_overlay_candidate_validator_ozone.cc View 1 2 3 4 5 6 2 chunks +10 lines, -0 lines 0 comments Download
M content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc View 1 3 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/compositor/reflector_impl_unittest.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
ccameron
This isn't ready for a full review -- I just want something to the effect ...
5 years, 4 months ago (2015-08-23 21:29:05 UTC) #2
alexst (slow to review)
https://codereview.chromium.org/1304303002/diff/20001/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/1304303002/diff/20001/cc/output/gl_renderer.cc#newcode3525 cc/output/gl_renderer.cc:3525: unsigned texture_id = 0; On 2015/08/23 21:29:05, ccameron wrote: ...
5 years, 4 months ago (2015-08-24 15:07:02 UTC) #3
ccameron
Okay, this is ready for review now. I didn't bother forcing the main image to ...
5 years, 4 months ago (2015-08-25 01:52:40 UTC) #4
alexst (slow to review)
looks good, just some nits. https://codereview.chromium.org/1304303002/diff/120001/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/1304303002/diff/120001/cc/output/gl_renderer.cc#newcode3523 cc/output/gl_renderer.cc:3523: texture_id = output_surface_->GetOverlayTextureId(); DCHECK ...
5 years, 4 months ago (2015-08-25 18:49:38 UTC) #5
danakj
https://codereview.chromium.org/1304303002/diff/120001/cc/output/overlay_strategy_sandwich.cc File cc/output/overlay_strategy_sandwich.cc (right): https://codereview.chromium.org/1304303002/diff/120001/cc/output/overlay_strategy_sandwich.cc#newcode59 cc/output/overlay_strategy_sandwich.cc:59: if (candidate_pixel_rect != candidate_pixel_rect_float) On 2015/08/25 18:49:38, alexst wrote: ...
5 years, 4 months ago (2015-08-25 18:50:42 UTC) #6
ccameron
Thanks! Updated. https://codereview.chromium.org/1304303002/diff/120001/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/1304303002/diff/120001/cc/output/gl_renderer.cc#newcode3523 cc/output/gl_renderer.cc:3523: texture_id = output_surface_->GetOverlayTextureId(); On 2015/08/25 18:49:38, alexst ...
5 years, 3 months ago (2015-08-26 21:36:13 UTC) #7
alexst (slow to review)
lgtm https://codereview.chromium.org/1304303002/diff/120001/cc/output/output_surface.h File cc/output/output_surface.h (right): https://codereview.chromium.org/1304303002/diff/120001/cc/output/output_surface.h#newcode123 cc/output/output_surface.h:123: gfx::Size SurfaceSize() const { return surface_size_; } On ...
5 years, 3 months ago (2015-08-26 21:54:18 UTC) #8
ccameron
Thanks! https://codereview.chromium.org/1304303002/diff/120001/cc/output/overlay_strategy_sandwich.cc File cc/output/overlay_strategy_sandwich.cc (right): https://codereview.chromium.org/1304303002/diff/120001/cc/output/overlay_strategy_sandwich.cc#newcode59 cc/output/overlay_strategy_sandwich.cc:59: if (candidate_pixel_rect != candidate_pixel_rect_float) On 2015/08/26 21:54:18, alexst ...
5 years, 3 months ago (2015-08-26 22:52:58 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1304303002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1304303002/140001
5 years, 3 months ago (2015-08-26 22:59:03 UTC) #11
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 3 months ago (2015-08-27 00:33:03 UTC) #12
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/cf57c8d56ce3562cd6d4707394197dfb007af040 Cr-Commit-Position: refs/heads/master@{#345745}
5 years, 3 months ago (2015-08-27 00:33:36 UTC) #13
danakj
https://codereview.chromium.org/1304303002/diff/120001/cc/output/overlay_strategy_sandwich.cc File cc/output/overlay_strategy_sandwich.cc (right): https://codereview.chromium.org/1304303002/diff/120001/cc/output/overlay_strategy_sandwich.cc#newcode59 cc/output/overlay_strategy_sandwich.cc:59: if (candidate_pixel_rect != candidate_pixel_rect_float) Want to add a RectF::IsRepresentableAsRect?
5 years, 3 months ago (2015-08-27 18:20:04 UTC) #15
ccameron
5 years, 3 months ago (2015-08-27 19:34:30 UTC) #17
Message was sent while issue was closed.
On 2015/08/27 18:20:04, danakj wrote:
>
https://codereview.chromium.org/1304303002/diff/120001/cc/output/overlay_stra...
> File cc/output/overlay_strategy_sandwich.cc (right):
> 
>
https://codereview.chromium.org/1304303002/diff/120001/cc/output/overlay_stra...
> cc/output/overlay_strategy_sandwich.cc:59: if (candidate_pixel_rect !=
> candidate_pixel_rect_float)
> Want to add a RectF::IsRepresentableAsRect?

Sure -- I'll grab that.

Powered by Google App Engine
This is Rietveld 408576698