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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 OverlayStrategySingleOnTop::OverlayStrategySingleOnTop( | 13 OverlayStrategySingleOnTop::OverlayStrategySingleOnTop( |
14 OverlayCandidateValidator* capability_checker, | 14 OverlayCandidateValidator* capability_checker) |
15 ResourceProvider* resource_provider) | 15 : capability_checker_(capability_checker) { |
16 : OverlayStrategyCommon(capability_checker, resource_provider) { | |
17 } | 16 } |
18 | 17 |
19 bool OverlayStrategySingleOnTop::Attempt( | 18 bool OverlayStrategySingleOnTop::Attempt( |
20 RenderPassList* render_passes_in_draw_order, | 19 RenderPassList* render_passes_in_draw_order, |
21 OverlayCandidateList* candidate_list) { | 20 OverlayCandidateList* candidate_list) { |
22 // Only attempt to handle very simple case for now. | 21 // Only attempt to handle very simple case for now. |
23 if (!capability_checker_) | 22 if (!capability_checker_) |
24 return false; | 23 return false; |
25 | 24 |
26 RenderPass* root_render_pass = render_passes_in_draw_order->back(); | 25 RenderPass* root_render_pass = render_passes_in_draw_order->back(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // If the candidate can be handled by an overlay, create a pass for it. | 69 // If the candidate can be handled by an overlay, create a pass for it. |
71 if (candidates[1].overlay_handled) { | 70 if (candidates[1].overlay_handled) { |
72 quad_list.EraseAndInvalidateAllPointers(candidate_iterator); | 71 quad_list.EraseAndInvalidateAllPointers(candidate_iterator); |
73 candidate_list->swap(candidates); | 72 candidate_list->swap(candidates); |
74 return true; | 73 return true; |
75 } | 74 } |
76 return false; | 75 return false; |
77 } | 76 } |
78 | 77 |
79 } // namespace cc | 78 } // namespace cc |
OLD | NEW |