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/trees/draw_property_utils.h" | 5 #include "cc/trees/draw_property_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
551 is_clipped = true; | 551 is_clipped = true; |
552 } else if (render_surface->has_contributing_layer_that_escapes_clip()) { | 552 } else if (render_surface->has_contributing_layer_that_escapes_clip()) { |
553 // We cannot clip a surface that has a contribuitng layer which escapes the | 553 // We cannot clip a surface that has a contribuitng layer which escapes the |
554 // clip. | 554 // clip. |
555 is_clipped = false; | 555 is_clipped = false; |
556 } else if (render_surface->ClipTreeIndex() == | 556 } else if (render_surface->ClipTreeIndex() == |
557 render_surface->render_target()->ClipTreeIndex()) { | 557 render_surface->render_target()->ClipTreeIndex()) { |
558 // There is no clip between between the render surface and its target, so | 558 // There is no clip between between the render surface and its target, so |
559 // the surface need not be clipped. | 559 // the surface need not be clipped. |
560 is_clipped = false; | 560 is_clipped = false; |
561 } else if (render_surface->ForceRenderSurface()) { | |
562 is_clipped = false; | |
reveman
2017/05/10 13:06:17
Please add a comment here to explain why we do thi
wutao
2017/05/11 19:36:34
Done.
| |
561 } else { | 563 } else { |
562 // If the clips between the render surface and its target only expand the | 564 // If the clips between the render surface and its target only expand the |
563 // clips and do not apply any new clip, we need not clip the render surface. | 565 // clips and do not apply any new clip, we need not clip the render surface. |
564 const ClipNode* clip_node = clip_tree.Node(render_surface->ClipTreeIndex()); | 566 const ClipNode* clip_node = clip_tree.Node(render_surface->ClipTreeIndex()); |
565 is_clipped = clip_node->clip_type != ClipNode::ClipType::EXPANDS_CLIP; | 567 is_clipped = clip_node->clip_type != ClipNode::ClipType::EXPANDS_CLIP; |
566 } | 568 } |
567 render_surface->SetIsClipped(is_clipped); | 569 render_surface->SetIsClipped(is_clipped); |
568 } | 570 } |
569 | 571 |
570 static void SetSurfaceDrawOpacity(const EffectTree& tree, | 572 static void SetSurfaceDrawOpacity(const EffectTree& tree, |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1090 void UpdateElasticOverscroll(PropertyTrees* property_trees, | 1092 void UpdateElasticOverscroll(PropertyTrees* property_trees, |
1091 const Layer* overscroll_elasticity_layer, | 1093 const Layer* overscroll_elasticity_layer, |
1092 const gfx::Vector2dF& elastic_overscroll) { | 1094 const gfx::Vector2dF& elastic_overscroll) { |
1093 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, | 1095 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, |
1094 elastic_overscroll); | 1096 elastic_overscroll); |
1095 } | 1097 } |
1096 | 1098 |
1097 } // namespace draw_property_utils | 1099 } // namespace draw_property_utils |
1098 | 1100 |
1099 } // namespace cc | 1101 } // namespace cc |
OLD | NEW |