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