| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // with respect to clip parent's local clip and not its combined clip as | 461 // with respect to clip parent's local clip and not its combined clip as |
| 462 // the combined clip has even the clip parent's target's clip baked into | 462 // the combined clip has even the clip parent's target's clip baked into |
| 463 // it and as our target is different, we don't want to use it in our | 463 // it and as our target is different, we don't want to use it in our |
| 464 // visible rect computation. | 464 // visible rect computation. |
| 465 if (!GetLayerClipRect(layer, clip_node, property_trees, target_node_id, | 465 if (!GetLayerClipRect(layer, clip_node, property_trees, target_node_id, |
| 466 &combined_clip_rect_in_target_space)) { | 466 &combined_clip_rect_in_target_space)) { |
| 467 layer->set_visible_layer_rect(gfx::Rect(layer_bounds)); | 467 layer->set_visible_layer_rect(gfx::Rect(layer_bounds)); |
| 468 continue; | 468 continue; |
| 469 } | 469 } |
| 470 } else { | 470 } else { |
| 471 if (clip_node->target_is_clipped) { | 471 combined_clip_rect_in_target_space = |
| 472 combined_clip_rect_in_target_space = | 472 clip_node->combined_clip_in_target_space; |
| 473 clip_node->combined_clip_in_target_space; | |
| 474 } else { | |
| 475 combined_clip_rect_in_target_space = clip_node->clip_in_target_space; | |
| 476 } | |
| 477 } | 473 } |
| 478 | 474 |
| 479 // The clip rect should be intersected with layer rect in target space. | 475 // The clip rect should be intersected with layer rect in target space. |
| 480 gfx::Transform content_to_target = transform_tree.ToTarget( | 476 gfx::Transform content_to_target = transform_tree.ToTarget( |
| 481 transform_node->id, layer->render_target_effect_tree_index()); | 477 transform_node->id, layer->render_target_effect_tree_index()); |
| 482 content_to_target.Translate(layer->offset_to_transform_parent().x(), | 478 content_to_target.Translate(layer->offset_to_transform_parent().x(), |
| 483 layer->offset_to_transform_parent().y()); | 479 layer->offset_to_transform_parent().y()); |
| 484 gfx::Rect layer_content_rect = gfx::Rect(layer_bounds); | 480 gfx::Rect layer_content_rect = gfx::Rect(layer_bounds); |
| 485 gfx::RectF layer_content_bounds_in_target_space = MathUtil::MapClippedRect( | 481 gfx::RectF layer_content_bounds_in_target_space = MathUtil::MapClippedRect( |
| 486 content_to_target, gfx::RectF(layer_content_rect)); | 482 content_to_target, gfx::RectF(layer_content_rect)); |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1595 void UpdateElasticOverscroll(PropertyTrees* property_trees, | 1591 void UpdateElasticOverscroll(PropertyTrees* property_trees, |
| 1596 const Layer* overscroll_elasticity_layer, | 1592 const Layer* overscroll_elasticity_layer, |
| 1597 const gfx::Vector2dF& elastic_overscroll) { | 1593 const gfx::Vector2dF& elastic_overscroll) { |
| 1598 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, | 1594 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, |
| 1599 elastic_overscroll); | 1595 elastic_overscroll); |
| 1600 } | 1596 } |
| 1601 | 1597 |
| 1602 } // namespace draw_property_utils | 1598 } // namespace draw_property_utils |
| 1603 | 1599 |
| 1604 } // namespace cc | 1600 } // namespace cc |
| OLD | NEW |