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