OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/output/overlay_strategy_sandwich.h" | 5 #include "cc/output/overlay_strategy_sandwich.h" |
6 | 6 |
7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
8 #include "cc/base/region.h" | 8 #include "cc/base/region.h" |
9 #include "cc/output/overlay_candidate_validator.h" | 9 #include "cc/output/overlay_candidate_validator.h" |
10 #include "cc/quads/draw_quad.h" | 10 #include "cc/quads/draw_quad.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 OverlayStrategySandwich::~OverlayStrategySandwich() {} | 41 OverlayStrategySandwich::~OverlayStrategySandwich() {} |
42 | 42 |
43 bool OverlayStrategySandwich::Attempt(ResourceProvider* resource_provider, | 43 bool OverlayStrategySandwich::Attempt(ResourceProvider* resource_provider, |
44 RenderPassList* render_passes, | 44 RenderPassList* render_passes, |
45 OverlayCandidateList* candidate_list, | 45 OverlayCandidateList* candidate_list, |
46 gfx::Rect* damage_rect) { | 46 gfx::Rect* damage_rect) { |
47 QuadList& quad_list = render_passes->back()->quad_list; | 47 QuadList& quad_list = render_passes->back()->quad_list; |
48 for (auto it = quad_list.begin(); it != quad_list.end();) { | 48 for (auto it = quad_list.begin(); it != quad_list.end();) { |
49 OverlayCandidate candidate; | 49 OverlayCandidate candidate; |
50 if (OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate)) | 50 if (OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate)) { |
51 it = TryOverlay(render_passes->back(), candidate_list, candidate, it); | 51 it = TryOverlay(render_passes->back().get(), candidate_list, candidate, |
52 else | 52 it); |
| 53 } else { |
53 ++it; | 54 ++it; |
| 55 } |
54 } | 56 } |
55 | 57 |
56 return candidate_list->size() > 1; | 58 return candidate_list->size() > 1; |
57 } | 59 } |
58 | 60 |
59 QuadList::Iterator OverlayStrategySandwich::TryOverlay( | 61 QuadList::Iterator OverlayStrategySandwich::TryOverlay( |
60 RenderPass* render_pass, | 62 RenderPass* render_pass, |
61 OverlayCandidateList* candidate_list, | 63 OverlayCandidateList* candidate_list, |
62 const OverlayCandidate& candidate, | 64 const OverlayCandidate& candidate, |
63 QuadList::Iterator candidate_iter_in_quad_list) { | 65 QuadList::Iterator candidate_iter_in_quad_list) { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 SK_ColorTRANSPARENT, true); | 175 SK_ColorTRANSPARENT, true); |
174 ++candidate_iter_in_quad_list; | 176 ++candidate_iter_in_quad_list; |
175 } | 177 } |
176 } | 178 } |
177 | 179 |
178 candidate_list->swap(new_candidate_list); | 180 candidate_list->swap(new_candidate_list); |
179 return candidate_iter_in_quad_list; | 181 return candidate_iter_in_quad_list; |
180 } | 182 } |
181 | 183 |
182 } // namespace cc | 184 } // namespace cc |
OLD | NEW |