OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_single_on_top.h" | 5 #include "cc/output/overlay_strategy_single_on_top.h" |
6 | 6 |
7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" |
8 #include "cc/output/overlay_candidate_validator.h" | 8 #include "cc/output/overlay_candidate_validator.h" |
9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
10 #include "ui/gfx/geometry/rect_conversions.h" | 10 #include "ui/gfx/geometry/rect_conversions.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 OverlayStrategySingleOnTop::OverlayStrategySingleOnTop( | 14 OverlayStrategySingleOnTop::OverlayStrategySingleOnTop( |
15 OverlayCandidateValidator* capability_checker) | 15 OverlayCandidateValidator* capability_checker) |
16 : capability_checker_(capability_checker) { | 16 : capability_checker_(capability_checker) { |
17 DCHECK(capability_checker); | 17 DCHECK(capability_checker); |
18 } | 18 } |
19 | 19 |
20 OverlayStrategySingleOnTop::~OverlayStrategySingleOnTop() {} | 20 OverlayStrategySingleOnTop::~OverlayStrategySingleOnTop() {} |
21 | 21 |
22 bool OverlayStrategySingleOnTop::Attempt(ResourceProvider* resource_provider, | 22 bool OverlayStrategySingleOnTop::Attempt( |
23 RenderPass* render_pass, | 23 ResourceProvider* resource_provider, |
24 OverlayCandidateList* candidate_list) { | 24 RenderPass* render_pass, |
| 25 OverlayCandidateList* candidate_list, |
| 26 std::vector<gfx::Rect>* content_bounds) { |
25 QuadList* quad_list = &render_pass->quad_list; | 27 QuadList* quad_list = &render_pass->quad_list; |
26 for (auto it = quad_list->begin(); it != quad_list->end(); ++it) { | 28 for (auto it = quad_list->begin(); it != quad_list->end(); ++it) { |
27 OverlayCandidate candidate; | 29 OverlayCandidate candidate; |
28 if (OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate) && | 30 if (OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate) && |
29 TryOverlay(quad_list, candidate_list, candidate, it)) { | 31 TryOverlay(quad_list, candidate_list, candidate, it)) { |
30 return true; | 32 return true; |
31 } | 33 } |
32 } | 34 } |
33 | 35 |
34 return false; | 36 return false; |
(...skipping 26 matching lines...) Expand all Loading... |
61 if (overlay_candidate.overlay_handled) { | 63 if (overlay_candidate.overlay_handled) { |
62 quad_list->EraseAndInvalidateAllPointers(candidate_iterator); | 64 quad_list->EraseAndInvalidateAllPointers(candidate_iterator); |
63 candidate_list->swap(new_candidate_list); | 65 candidate_list->swap(new_candidate_list); |
64 return true; | 66 return true; |
65 } | 67 } |
66 | 68 |
67 return false; | 69 return false; |
68 } | 70 } |
69 | 71 |
70 } // namespace cc | 72 } // namespace cc |
OLD | NEW |