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