Chromium Code Reviews| 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 | 14 |
| 15 bool OverlayStrategyUnderlay::TryOverlay( | 15 QuadList::Iterator OverlayStrategyUnderlay::TryOverlay( |
| 16 OverlayCandidateValidator* capability_checker, | 16 OverlayCandidateValidator* capability_checker, |
| 17 RenderPassList* render_passes_in_draw_order, | 17 RenderPassList* render_passes_in_draw_order, |
| 18 OverlayCandidateList* candidate_list, | 18 OverlayCandidateList* candidate_list, |
| 19 const OverlayCandidate& candidate, | 19 const OverlayCandidate& candidate, |
| 20 QuadList::Iterator candidate_iterator, | 20 QuadList::Iterator candidate_iterator, |
| 21 float device_scale_factor) { | 21 float device_scale_factor) { |
| 22 RenderPass* root_render_pass = render_passes_in_draw_order->back(); | 22 RenderPass* root_render_pass = render_passes_in_draw_order->back(); |
| 23 QuadList& quad_list = root_render_pass->quad_list; | 23 QuadList& quad_list = root_render_pass->quad_list; |
| 24 | 24 |
| 25 // Add our primary surface. | 25 // Add our primary surface. |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 39 // need to switch out the video quad with a black transparent one. | 39 // need to switch out the video quad with a black transparent one. |
| 40 if (candidates[1].overlay_handled) { | 40 if (candidates[1].overlay_handled) { |
| 41 const SharedQuadState* shared_quad_state = | 41 const SharedQuadState* shared_quad_state = |
| 42 candidate_iterator->shared_quad_state; | 42 candidate_iterator->shared_quad_state; |
| 43 gfx::Rect rect = candidate_iterator->visible_rect; | 43 gfx::Rect rect = candidate_iterator->visible_rect; |
| 44 SolidColorDrawQuad* replacement = | 44 SolidColorDrawQuad* replacement = |
| 45 quad_list.ReplaceExistingElement<SolidColorDrawQuad>( | 45 quad_list.ReplaceExistingElement<SolidColorDrawQuad>( |
| 46 candidate_iterator); | 46 candidate_iterator); |
| 47 replacement->SetAll(shared_quad_state, rect, rect, rect, false, | 47 replacement->SetAll(shared_quad_state, rect, rect, rect, false, |
| 48 SK_ColorTRANSPARENT, true); | 48 SK_ColorTRANSPARENT, true); |
| 49 DCHECK(candidate_list->empty()); | |
| 49 candidate_list->swap(candidates); | 50 candidate_list->swap(candidates); |
|
ccameron
2015/09/02 22:22:33
same issue about return values here.
| |
| 50 return true; | |
| 51 } | 51 } |
| 52 return false; | 52 |
| 53 return quad_list.end(); | |
| 53 } | 54 } |
| 54 | 55 |
| 55 } // namespace cc | 56 } // namespace cc |
| OLD | NEW |