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

Unified Diff: cc/output/overlay_strategy_single_on_top.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_single_on_top.h ('k') | cc/output/overlay_strategy_underlay.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/overlay_strategy_single_on_top.cc
diff --git a/cc/output/overlay_strategy_single_on_top.cc b/cc/output/overlay_strategy_single_on_top.cc
index 5670a37f93de2dd06b023a377608406f11b05875..6f6abe1c410c924cc02a8b11c8f2ec1899fc8c1b 100644
--- a/cc/output/overlay_strategy_single_on_top.cc
+++ b/cc/output/overlay_strategy_single_on_top.cc
@@ -13,50 +13,43 @@ namespace cc {
OverlayStrategySingleOnTop::~OverlayStrategySingleOnTop() {}
-bool OverlayStrategySingleOnTop::TryOverlay(
+OverlayResult OverlayStrategySingleOnTop::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;
- const DrawQuad* draw_quad = *candidate_iterator;
- gfx::RectF rect = draw_quad->rect;
- draw_quad->shared_quad_state->quad_to_target_transform.TransformRect(&rect);
// Check that no prior quads overlap it.
for (auto overlap_iter = quad_list.cbegin();
- overlap_iter != candidate_iterator; ++overlap_iter) {
+ overlap_iter != *candidate_iterator; ++overlap_iter) {
gfx::RectF overlap_rect = overlap_iter->rect;
overlap_iter->shared_quad_state->quad_to_target_transform.TransformRect(
&overlap_rect);
- if (rect.Intersects(overlap_rect) &&
+ if (candidate.display_rect.Intersects(overlap_rect) &&
!OverlayStrategyCommon::IsInvisibleQuad(*overlap_iter))
- return false;
+ return DID_NOT_CREATE_OVERLAY;
}
- // 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.
- if (candidates[1].overlay_handled) {
- quad_list.EraseAndInvalidateAllPointers(candidate_iterator);
- candidate_list->swap(candidates);
- return true;
+ if (new_candidate_list.back().overlay_handled) {
+ quad_list.EraseAndInvalidateAllPointers(*candidate_iterator);
+ 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_single_on_top.h ('k') | cc/output/overlay_strategy_underlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698