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_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" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 RenderPassList* render_passes_in_draw_order, | 22 RenderPassList* render_passes_in_draw_order, |
| 23 OverlayCandidateList* candidate_list, | 23 OverlayCandidateList* candidate_list, |
| 24 const OverlayCandidate& candidate, | 24 const OverlayCandidate& candidate, |
| 25 QuadList::Iterator candidate_iterator) { | 25 QuadList::Iterator candidate_iterator) { |
| 26 RenderPass* root_render_pass = render_passes_in_draw_order->back(); | 26 RenderPass* root_render_pass = render_passes_in_draw_order->back(); |
| 27 QuadList& quad_list = root_render_pass->quad_list; | 27 QuadList& quad_list = root_render_pass->quad_list; |
| 28 const DrawQuad* draw_quad = *candidate_iterator; | 28 const DrawQuad* draw_quad = *candidate_iterator; |
| 29 gfx::RectF rect = draw_quad->rect; | 29 gfx::RectF rect = draw_quad->rect; |
| 30 draw_quad->shared_quad_state->quad_to_target_transform.TransformRect(&rect); | 30 draw_quad->shared_quad_state->quad_to_target_transform.TransformRect(&rect); |
| 31 | 31 |
| 32 // Check if the quad is clipped. | |
| 33 if (draw_quad->shared_quad_state->visible_quad_layer_rect.size() != | |
|
alexst (slow to review)
2015/08/27 12:42:36
I don't think this is the right place to check for
| |
| 34 draw_quad->shared_quad_state->quad_layer_bounds) | |
|
danakj
2015/08/27 17:37:54
Can you just use the draw_quad->shared_quad_state-
william.xie1
2015/08/28 00:00:46
Hi Dana, I tried it, but is_clipped was always tru
danakj
2015/08/28 22:55:05
Ah, ok well even if it's always true, it won't alw
| |
| 35 return false; | |
| 36 | |
| 32 // Check that no prior quads overlap it. | 37 // Check that no prior quads overlap it. |
| 33 for (auto overlap_iter = quad_list.cbegin(); | 38 for (auto overlap_iter = quad_list.cbegin(); |
| 34 overlap_iter != candidate_iterator; ++overlap_iter) { | 39 overlap_iter != candidate_iterator; ++overlap_iter) { |
| 35 gfx::RectF overlap_rect = overlap_iter->rect; | 40 gfx::RectF overlap_rect = overlap_iter->rect; |
| 36 overlap_iter->shared_quad_state->quad_to_target_transform.TransformRect( | 41 overlap_iter->shared_quad_state->quad_to_target_transform.TransformRect( |
| 37 &overlap_rect); | 42 &overlap_rect); |
| 38 if (rect.Intersects(overlap_rect) && !IsInvisibleQuad(*overlap_iter)) | 43 if (rect.Intersects(overlap_rect) && !IsInvisibleQuad(*overlap_iter)) |
| 39 return false; | 44 return false; |
| 40 } | 45 } |
| 41 | 46 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 55 // If the candidate can be handled by an overlay, create a pass for it. | 60 // If the candidate can be handled by an overlay, create a pass for it. |
| 56 if (candidates[1].overlay_handled) { | 61 if (candidates[1].overlay_handled) { |
| 57 quad_list.EraseAndInvalidateAllPointers(candidate_iterator); | 62 quad_list.EraseAndInvalidateAllPointers(candidate_iterator); |
| 58 candidate_list->swap(candidates); | 63 candidate_list->swap(candidates); |
| 59 return true; | 64 return true; |
| 60 } | 65 } |
| 61 return false; | 66 return false; |
| 62 } | 67 } |
| 63 | 68 |
| 64 } // namespace cc | 69 } // namespace cc |
| OLD | NEW |