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 24 matching lines...) Expand all Loading... |
35 OverlayStrategySandwich::OverlayStrategySandwich( | 35 OverlayStrategySandwich::OverlayStrategySandwich( |
36 OverlayCandidateValidator* capability_checker) | 36 OverlayCandidateValidator* capability_checker) |
37 : capability_checker_(capability_checker) { | 37 : capability_checker_(capability_checker) { |
38 DCHECK(capability_checker); | 38 DCHECK(capability_checker); |
39 } | 39 } |
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) { | |
47 QuadList& quad_list = render_passes->back()->quad_list; | 46 QuadList& quad_list = render_passes->back()->quad_list; |
48 for (auto it = quad_list.begin(); it != quad_list.end();) { | 47 for (auto it = quad_list.begin(); it != quad_list.end();) { |
49 OverlayCandidate candidate; | 48 OverlayCandidate candidate; |
50 if (OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate)) | 49 if (OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate)) |
51 it = TryOverlay(render_passes->back(), candidate_list, candidate, it); | 50 it = TryOverlay(render_passes->back(), candidate_list, candidate, it); |
52 else | 51 else |
53 ++it; | 52 ++it; |
54 } | 53 } |
55 | 54 |
56 return candidate_list->size() > 1; | 55 return candidate_list->size() > 1; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 SK_ColorTRANSPARENT, true); | 172 SK_ColorTRANSPARENT, true); |
174 ++candidate_iter_in_quad_list; | 173 ++candidate_iter_in_quad_list; |
175 } | 174 } |
176 } | 175 } |
177 | 176 |
178 candidate_list->swap(new_candidate_list); | 177 candidate_list->swap(new_candidate_list); |
179 return candidate_iter_in_quad_list; | 178 return candidate_iter_in_quad_list; |
180 } | 179 } |
181 | 180 |
182 } // namespace cc | 181 } // namespace cc |
OLD | NEW |