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_underlay.h" | 5 #include "cc/output/overlay_strategy_underlay.h" |
6 | 6 |
7 #include "cc/output/overlay_candidate_validator.h" | 7 #include "cc/output/overlay_candidate_validator.h" |
8 #include "cc/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
9 #include "cc/quads/solid_color_draw_quad.h" | 9 #include "cc/quads/solid_color_draw_quad.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 OverlayStrategyUnderlay::OverlayStrategyUnderlay( | 13 OverlayStrategyUnderlay::OverlayStrategyUnderlay( |
14 OverlayCandidateValidator* capability_checker) | 14 OverlayCandidateValidator* capability_checker) |
15 : capability_checker_(capability_checker) { | 15 : capability_checker_(capability_checker) { |
16 DCHECK(capability_checker); | 16 DCHECK(capability_checker); |
17 } | 17 } |
18 | 18 |
19 OverlayStrategyUnderlay::~OverlayStrategyUnderlay() {} | 19 OverlayStrategyUnderlay::~OverlayStrategyUnderlay() {} |
20 | 20 |
21 bool OverlayStrategyUnderlay::Attempt(ResourceProvider* resource_provider, | 21 bool OverlayStrategyUnderlay::Attempt(ResourceProvider* resource_provider, |
22 RenderPassList* render_passes, | 22 RenderPassList* render_passes, |
23 OverlayCandidateList* candidate_list, | 23 OverlayCandidateList* candidate_list) { |
24 gfx::Rect* damage_rect) { | |
25 QuadList& quad_list = render_passes->back()->quad_list; | 24 QuadList& quad_list = render_passes->back()->quad_list; |
26 for (auto it = quad_list.begin(); it != quad_list.end(); ++it) { | 25 for (auto it = quad_list.begin(); it != quad_list.end(); ++it) { |
27 OverlayCandidate candidate; | 26 OverlayCandidate candidate; |
28 if (!OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate)) | 27 if (!OverlayCandidate::FromDrawQuad(resource_provider, *it, &candidate)) |
29 continue; | 28 continue; |
30 | 29 |
31 // Add the overlay. | 30 // Add the overlay. |
32 OverlayCandidateList new_candidate_list = *candidate_list; | 31 OverlayCandidateList new_candidate_list = *candidate_list; |
33 new_candidate_list.push_back(candidate); | 32 new_candidate_list.push_back(candidate); |
34 new_candidate_list.back().plane_z_order = -1; | 33 new_candidate_list.back().plane_z_order = -1; |
(...skipping 12 matching lines...) Expand all Loading... |
47 SK_ColorTRANSPARENT, true); | 46 SK_ColorTRANSPARENT, true); |
48 candidate_list->swap(new_candidate_list); | 47 candidate_list->swap(new_candidate_list); |
49 return true; | 48 return true; |
50 } | 49 } |
51 } | 50 } |
52 | 51 |
53 return false; | 52 return false; |
54 } | 53 } |
55 | 54 |
56 } // namespace cc | 55 } // namespace cc |
OLD | NEW |