| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 content_to_target.Translate(layer->offset_to_transform_parent().x(), | 71 content_to_target.Translate(layer->offset_to_transform_parent().x(), |
| 72 layer->offset_to_transform_parent().y()); | 72 layer->offset_to_transform_parent().y()); |
| 73 content_to_target.Scale(1.0 / contents_scale_x, 1.0 / contents_scale_y); | 73 content_to_target.Scale(1.0 / contents_scale_x, 1.0 / contents_scale_y); |
| 74 | 74 |
| 75 gfx::Rect layer_content_rect = gfx::Rect(layer_content_bounds); | 75 gfx::Rect layer_content_rect = gfx::Rect(layer_content_bounds); |
| 76 gfx::Rect layer_content_bounds_in_target_space = | 76 gfx::Rect layer_content_bounds_in_target_space = |
| 77 MathUtil::MapEnclosingClippedRect(content_to_target, | 77 MathUtil::MapEnclosingClippedRect(content_to_target, |
| 78 layer_content_rect); | 78 layer_content_rect); |
| 79 gfx::Rect clip_rect_in_target_space; | 79 gfx::Rect clip_rect_in_target_space; |
| 80 if (target_node->id > clip_node->id) { | 80 if (target_node->id > clip_node->data.transform_id) { |
| 81 clip_rect_in_target_space = | 81 clip_rect_in_target_space = |
| 82 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( | 82 gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( |
| 83 clip_to_target, clip_node->data.combined_clip)); | 83 clip_to_target, clip_node->data.combined_clip)); |
| 84 } else { | 84 } else { |
| 85 clip_rect_in_target_space = | 85 clip_rect_in_target_space = |
| 86 gfx::ToEnclosingRect(MathUtil::MapClippedRect( | 86 gfx::ToEnclosingRect(MathUtil::MapClippedRect( |
| 87 clip_to_target, clip_node->data.combined_clip)); | 87 clip_to_target, clip_node->data.combined_clip)); |
| 88 } | 88 } |
| 89 | 89 |
| 90 clip_rect_in_target_space.Intersect(layer_content_bounds_in_target_space); | 90 clip_rect_in_target_space.Intersect(layer_content_bounds_in_target_space); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 284 |
| 285 std::vector<Layer*> layers_to_update; | 285 std::vector<Layer*> layers_to_update; |
| 286 const bool subtree_is_visible_from_ancestor = true; | 286 const bool subtree_is_visible_from_ancestor = true; |
| 287 FindLayersThatNeedVisibleRects(root_layer, *transform_tree, | 287 FindLayersThatNeedVisibleRects(root_layer, *transform_tree, |
| 288 subtree_is_visible_from_ancestor, | 288 subtree_is_visible_from_ancestor, |
| 289 &layers_to_update); | 289 &layers_to_update); |
| 290 CalculateVisibleRects(layers_to_update, *clip_tree, *transform_tree); | 290 CalculateVisibleRects(layers_to_update, *clip_tree, *transform_tree); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace cc | 293 } // namespace cc |
| OLD | NEW |