| 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 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 int target_effect_id = effect_node->target_id; | 1222 int target_effect_id = effect_node->target_id; |
| 1223 const bool success = property_trees->GetToTarget( | 1223 const bool success = property_trees->GetToTarget( |
| 1224 parent_clip_node->target_transform_id, target_effect_id, | 1224 parent_clip_node->target_transform_id, target_effect_id, |
| 1225 &clip_parent_target_to_target); | 1225 &clip_parent_target_to_target); |
| 1226 | 1226 |
| 1227 if (!success) { | 1227 if (!success) { |
| 1228 render_surface->SetClipRect(gfx::Rect()); | 1228 render_surface->SetClipRect(gfx::Rect()); |
| 1229 return; | 1229 return; |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 DCHECK_LT(parent_clip_node->target_transform_id, | 1232 if (parent_clip_node->target_transform_id < |
| 1233 transform_tree.TargetId(transform_node->id)); | 1233 transform_tree.TargetId(transform_node->id)) { |
| 1234 render_surface->SetClipRect(gfx::ToEnclosingRect(MathUtil::ProjectClippedRect( | 1234 render_surface->SetClipRect(gfx::ToEnclosingRect( |
| 1235 clip_parent_target_to_target, parent_clip_node->clip_in_target_space))); | 1235 MathUtil::ProjectClippedRect(clip_parent_target_to_target, |
| 1236 parent_clip_node->clip_in_target_space))); |
| 1237 } else { |
| 1238 render_surface->SetClipRect(gfx::ToEnclosingRect(MathUtil::MapClippedRect( |
| 1239 clip_parent_target_to_target, parent_clip_node->clip_in_target_space))); |
| 1240 } |
| 1236 } | 1241 } |
| 1237 | 1242 |
| 1238 template <typename LayerType> | 1243 template <typename LayerType> |
| 1239 static gfx::Transform ScreenSpaceTransformInternal(LayerType* layer, | 1244 static gfx::Transform ScreenSpaceTransformInternal(LayerType* layer, |
| 1240 const TransformTree& tree) { | 1245 const TransformTree& tree) { |
| 1241 gfx::Transform xform(1, 0, 0, 1, layer->offset_to_transform_parent().x(), | 1246 gfx::Transform xform(1, 0, 0, 1, layer->offset_to_transform_parent().x(), |
| 1242 layer->offset_to_transform_parent().y()); | 1247 layer->offset_to_transform_parent().y()); |
| 1243 gfx::Transform ssxform = tree.ToScreen(layer->transform_tree_index()); | 1248 gfx::Transform ssxform = tree.ToScreen(layer->transform_tree_index()); |
| 1244 xform.ConcatTransform(ssxform); | 1249 xform.ConcatTransform(ssxform); |
| 1245 if (layer->should_flatten_transform_from_property_tree()) | 1250 if (layer->should_flatten_transform_from_property_tree()) |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 void UpdateElasticOverscroll(PropertyTrees* property_trees, | 1458 void UpdateElasticOverscroll(PropertyTrees* property_trees, |
| 1454 const Layer* overscroll_elasticity_layer, | 1459 const Layer* overscroll_elasticity_layer, |
| 1455 const gfx::Vector2dF& elastic_overscroll) { | 1460 const gfx::Vector2dF& elastic_overscroll) { |
| 1456 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, | 1461 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, |
| 1457 elastic_overscroll); | 1462 elastic_overscroll); |
| 1458 } | 1463 } |
| 1459 | 1464 |
| 1460 } // namespace draw_property_utils | 1465 } // namespace draw_property_utils |
| 1461 | 1466 |
| 1462 } // namespace cc | 1467 } // namespace cc |
| OLD | NEW |