| 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 ResourceProvider* resource_provider) | 15 : capability_checker_(capability_checker) { |
| 16 : OverlayStrategyCommon(capability_checker, resource_provider) { | |
| 17 } | 16 } |
| 18 | 17 |
| 19 bool OverlayStrategyUnderlay::Attempt( | 18 bool OverlayStrategyUnderlay::Attempt( |
| 20 RenderPassList* render_passes_in_draw_order, | 19 RenderPassList* render_passes_in_draw_order, |
| 21 OverlayCandidateList* candidate_list) { | 20 OverlayCandidateList* candidate_list) { |
| 22 if (!capability_checker_) | 21 if (!capability_checker_) |
| 23 return false; | 22 return false; |
| 24 | 23 |
| 25 RenderPass* root_render_pass = render_passes_in_draw_order->back(); | 24 RenderPass* root_render_pass = render_passes_in_draw_order->back(); |
| 26 DCHECK(root_render_pass); | 25 DCHECK(root_render_pass); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 candidate_iterator); | 60 candidate_iterator); |
| 62 replacement->SetAll(shared_quad_state, rect, rect, rect, false, | 61 replacement->SetAll(shared_quad_state, rect, rect, rect, false, |
| 63 SK_ColorTRANSPARENT, true); | 62 SK_ColorTRANSPARENT, true); |
| 64 candidate_list->swap(candidates); | 63 candidate_list->swap(candidates); |
| 65 return true; | 64 return true; |
| 66 } | 65 } |
| 67 return false; | 66 return false; |
| 68 } | 67 } |
| 69 | 68 |
| 70 } // namespace cc | 69 } // namespace cc |
| OLD | NEW |