| 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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 gfx::Rect(layer->bounds())); | 1017 gfx::Rect(layer->bounds())); |
| 1018 layer->draw_properties().drawable_content_rect = LayerDrawableContentRect( | 1018 layer->draw_properties().drawable_content_rect = LayerDrawableContentRect( |
| 1019 layer, bounds_in_target_space, layer->draw_properties().clip_rect); | 1019 layer, bounds_in_target_space, layer->draw_properties().clip_rect); |
| 1020 } | 1020 } |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 void ComputeMaskDrawProperties(LayerImpl* mask_layer, | 1023 void ComputeMaskDrawProperties(LayerImpl* mask_layer, |
| 1024 const PropertyTrees* property_trees) { | 1024 const PropertyTrees* property_trees) { |
| 1025 // Mask draw properties are used only for rastering, so most of the draw | 1025 // Mask draw properties are used only for rastering, so most of the draw |
| 1026 // properties computed for other layers are not needed. | 1026 // properties computed for other layers are not needed. |
| 1027 // Draw transform of a mask layer has to be a 2d scale. |
| 1028 // TODO(sunxd): the draw transform of a mask layer misses the "scale to fit" |
| 1029 // factor from mask layer to its parent. So does the screen space transform. |
| 1030 // It does not cause a problem because currently we only have 1:1 mask layer. |
| 1031 mask_layer->draw_properties().target_space_transform = DrawTransform( |
| 1032 mask_layer, property_trees->transform_tree, property_trees->effect_tree); |
| 1027 mask_layer->draw_properties().screen_space_transform = | 1033 mask_layer->draw_properties().screen_space_transform = |
| 1028 ScreenSpaceTransformInternal(mask_layer, | 1034 ScreenSpaceTransformInternal(mask_layer, |
| 1029 property_trees->transform_tree); | 1035 property_trees->transform_tree); |
| 1030 mask_layer->draw_properties().visible_layer_rect = | 1036 mask_layer->draw_properties().visible_layer_rect = |
| 1031 gfx::Rect(mask_layer->bounds()); | 1037 gfx::Rect(mask_layer->bounds()); |
| 1032 } | 1038 } |
| 1033 | 1039 |
| 1034 void ComputeSurfaceDrawProperties(PropertyTrees* property_trees, | 1040 void ComputeSurfaceDrawProperties(PropertyTrees* property_trees, |
| 1035 RenderSurfaceImpl* render_surface, | 1041 RenderSurfaceImpl* render_surface, |
| 1036 const bool use_layer_lists) { | 1042 const bool use_layer_lists) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 void UpdateElasticOverscroll(PropertyTrees* property_trees, | 1083 void UpdateElasticOverscroll(PropertyTrees* property_trees, |
| 1078 const Layer* overscroll_elasticity_layer, | 1084 const Layer* overscroll_elasticity_layer, |
| 1079 const gfx::Vector2dF& elastic_overscroll) { | 1085 const gfx::Vector2dF& elastic_overscroll) { |
| 1080 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, | 1086 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, |
| 1081 elastic_overscroll); | 1087 elastic_overscroll); |
| 1082 } | 1088 } |
| 1083 | 1089 |
| 1084 } // namespace draw_property_utils | 1090 } // namespace draw_property_utils |
| 1085 | 1091 |
| 1086 } // namespace cc | 1092 } // namespace cc |
| OLD | NEW |