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

Unified Diff: cc/output/overlay_strategy_single_on_top.cc

Issue 1387283002: cc: Remove redundant is_overlay arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 5 years, 2 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 d08da5cd31452a8409f9f2d9f5ced28717ce25f9..f77f193b04dea03b6bd7034fb07fc1b9c8b53ea8 100644
--- a/cc/output/overlay_strategy_single_on_top.cc
+++ b/cc/output/overlay_strategy_single_on_top.cc
@@ -18,12 +18,13 @@ OverlayStrategySingleOnTop::OverlayStrategySingleOnTop(
OverlayStrategySingleOnTop::~OverlayStrategySingleOnTop() {}
-bool OverlayStrategySingleOnTop::Attempt(RenderPassList* render_passes,
+bool OverlayStrategySingleOnTop::Attempt(ResourceProvider* resource_provider,
+ RenderPassList* render_passes,
OverlayCandidateList* candidate_list) {
- QuadList& quad_list = render_passes->back()->quad_list;
- for (auto it = quad_list.begin(); it != quad_list.end(); ++it) {
+ QuadList* quad_list = &render_passes->back()->quad_list;
+ for (auto it = quad_list->begin(); it != quad_list->end(); ++it) {
OverlayCandidate candidate;
- if (OverlayCandidate::FromDrawQuad(*it, &candidate) &&
+ if (OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate) &&
TryOverlay(quad_list, candidate_list, candidate, it)) {
return true;
}
@@ -33,18 +34,17 @@ bool OverlayStrategySingleOnTop::Attempt(RenderPassList* render_passes,
}
bool OverlayStrategySingleOnTop::TryOverlay(
- QuadList& quad_list,
+ QuadList* quad_list,
OverlayCandidateList* candidate_list,
const OverlayCandidate& candidate,
QuadList::Iterator candidate_iterator) {
// Check that no prior quads overlap it.
- for (auto overlap_iter = quad_list.cbegin();
- overlap_iter != candidate_iterator; ++overlap_iter) {
+ for (auto overlap_iter : *quad_list) {
ccameron 2015/10/08 05:22:18 Hmm, this broke things. I'll put this in the categ
dcheng 2015/10/08 05:44:15 I'm not sure why this broke things, but note that:
gfx::RectF overlap_rect = MathUtil::MapClippedRect(
overlap_iter->shared_quad_state->quad_to_target_transform,
gfx::RectF(overlap_iter->rect));
if (candidate.display_rect.Intersects(overlap_rect) &&
- !OverlayCandidate::IsInvisibleQuad(*overlap_iter))
+ !OverlayCandidate::IsInvisibleQuad(overlap_iter))
return false;
}
@@ -58,7 +58,7 @@ bool OverlayStrategySingleOnTop::TryOverlay(
// If the candidate can be handled by an overlay, create a pass for it.
if (new_candidate_list.back().overlay_handled) {
- quad_list.EraseAndInvalidateAllPointers(candidate_iterator);
+ quad_list->EraseAndInvalidateAllPointers(candidate_iterator);
candidate_list->swap(new_candidate_list);
return true;
}
« 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