Chromium Code Reviews| Index: cc/output/overlay_strategy_common.cc |
| diff --git a/cc/output/overlay_strategy_common.cc b/cc/output/overlay_strategy_common.cc |
| index 5d79cd09878555a375dd715f0421b92079738617..49e45878b58ef8274c82385f4341f38f9368c948 100644 |
| --- a/cc/output/overlay_strategy_common.cc |
| +++ b/cc/output/overlay_strategy_common.cc |
| @@ -28,23 +28,28 @@ OverlayStrategyCommon::~OverlayStrategyCommon() { |
| bool OverlayStrategyCommon::Attempt(RenderPassList* render_passes_in_draw_order, |
| OverlayCandidateList* candidate_list, |
| float device_scale_factor) { |
| + DCHECK(candidate_list->empty()); |
| if (!capability_checker_) |
| return false; |
| RenderPass* root_render_pass = render_passes_in_draw_order->back(); |
| DCHECK(root_render_pass); |
| QuadList& quad_list = root_render_pass->quad_list; |
| - for (auto it = quad_list.begin(); it != quad_list.end(); ++it) { |
| + auto it = quad_list.begin(); |
| + while (it != quad_list.end()) { |
| OverlayCandidate candidate; |
| const DrawQuad* draw_quad = *it; |
| if (IsOverlayQuad(draw_quad) && |
| - GetCandidateQuadInfo(*draw_quad, &candidate) && |
| - delegate_->TryOverlay(capability_checker_, render_passes_in_draw_order, |
| - candidate_list, candidate, it, |
| - device_scale_factor)) |
| - return true; |
| + GetCandidateQuadInfo(*draw_quad, &candidate)) { |
| + it = delegate_->TryOverlay(capability_checker_, |
|
ccameron
2015/09/02 21:41:55
Then this just reads
...
if (delegate_->TryOv
ccameron
2015/09/02 22:22:33
Errr...
result = delegate_->TryOverlay(...)
i
Andre
2015/09/03 22:45:59
Done.
|
| + render_passes_in_draw_order, candidate_list, |
| + candidate, it, device_scale_factor); |
| + } else { |
| + ++it; |
| + } |
| } |
| - return false; |
| + |
| + return !candidate_list->empty(); |
| } |
| bool OverlayStrategyCommon::IsOverlayQuad(const DrawQuad* draw_quad) { |