Chromium Code Reviews| 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; |
| } |