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

Unified Diff: cc/output/overlay_strategy_underlay.cc

Issue 1330953002: Mac Overlays: Allow multiple overlays with sandwich strategy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
Patch Set: 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
« no previous file with comments | « cc/output/overlay_strategy_underlay.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..88213695762967cd3ddd06bb1f54d5b3b697e5ac 100644
--- a/cc/output/overlay_strategy_underlay.cc
+++ b/cc/output/overlay_strategy_underlay.cc
@@ -12,44 +12,40 @@ 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.
- candidates.push_back(candidate);
- candidates.back().plane_z_order = -1;
+ OverlayCandidateList new_candidate_list = *candidate_list;
+ new_candidate_list.push_back(candidate);
+ new_candidate_list.back().plane_z_order = -1;
// Check for support.
- capability_checker->CheckOverlaySupport(&candidates);
+ capability_checker->CheckOverlaySupport(&new_candidate_list);
// 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 (new_candidate_list.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;
+ candidate_list->swap(new_candidate_list);
+ return CREATED_OVERLAY_STOP_LOOKING;
}
- return false;
+
+ return DID_NOT_CREATE_OVERLAY;
}
} // namespace cc
« no previous file with comments | « cc/output/overlay_strategy_underlay.h ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698