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

Unified Diff: cc/output/overlay_strategy_underlay.cc

Issue 1304053016: Mac Overlays: Allow multiple overlays with sandwich strategy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snapshot
Patch Set: Add tests Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/output/overlay_strategy_underlay.cc
diff --git a/cc/output/overlay_strategy_underlay.cc b/cc/output/overlay_strategy_underlay.cc
index 67cd77d4cd1f2b75f60a7049c259587e1a1b7634..eeed66c9f63f52aaa0df417d6c1d7fe513abea2b 100644
--- a/cc/output/overlay_strategy_underlay.cc
+++ b/cc/output/overlay_strategy_underlay.cc
@@ -12,23 +12,18 @@ namespace cc {
OverlayStrategyUnderlay::~OverlayStrategyUnderlay() {}
-bool OverlayStrategyUnderlay::TryOverlay(
+OverlayResult OverlayStrategyUnderlay::TryOverlay(
OverlayCandidateValidator* capability_checker,
RenderPassList* render_passes_in_draw_order,
OverlayCandidateList* candidate_list,
const OverlayCandidate& candidate,
- QuadList::Iterator candidate_iterator,
+ QuadList::Iterator* candidate_iterator,
float device_scale_factor) {
RenderPass* root_render_pass = render_passes_in_draw_order->back();
QuadList& quad_list = root_render_pass->quad_list;
- // Add our primary surface.
- OverlayCandidateList candidates;
- OverlayCandidate main_image;
- main_image.display_rect = root_render_pass->output_rect;
- candidates.push_back(main_image);
-
// Add the overlay.
+ OverlayCandidateList candidates = *candidate_list;
candidates.push_back(candidate);
candidates.back().plane_z_order = -1;
@@ -37,19 +32,20 @@ bool OverlayStrategyUnderlay::TryOverlay(
// If the candidate can be handled by an overlay, create a pass for it. We
// need to switch out the video quad with a black transparent one.
- if (candidates[1].overlay_handled) {
+ if (candidates.back().overlay_handled) {
const SharedQuadState* shared_quad_state =
- candidate_iterator->shared_quad_state;
- gfx::Rect rect = candidate_iterator->visible_rect;
+ (*candidate_iterator)->shared_quad_state;
+ gfx::Rect rect = (*candidate_iterator)->visible_rect;
SolidColorDrawQuad* replacement =
quad_list.ReplaceExistingElement<SolidColorDrawQuad>(
- candidate_iterator);
+ *candidate_iterator);
replacement->SetAll(shared_quad_state, rect, rect, rect, false,
SK_ColorTRANSPARENT, true);
candidate_list->swap(candidates);
- return true;
+ return CREATED_OVERLAY_STOP_LOOKING;
}
- return false;
+
+ return DID_NOT_CREATE_OVERLAY;
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698