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 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 layer->draw_properties().target_space_transform, | 1369 layer->draw_properties().target_space_transform, |
1370 gfx::Rect(layer->bounds())); | 1370 gfx::Rect(layer->bounds())); |
1371 layer->draw_properties().drawable_content_rect = LayerDrawableContentRect( | 1371 layer->draw_properties().drawable_content_rect = LayerDrawableContentRect( |
1372 layer, bounds_in_target_space, layer->draw_properties().clip_rect); | 1372 layer, bounds_in_target_space, layer->draw_properties().clip_rect); |
1373 } | 1373 } |
1374 | 1374 |
1375 void ComputeMaskDrawProperties(LayerImpl* mask_layer, | 1375 void ComputeMaskDrawProperties(LayerImpl* mask_layer, |
1376 const PropertyTrees* property_trees) { | 1376 const PropertyTrees* property_trees) { |
1377 // Mask draw properties are used only for rastering, so most of the draw | 1377 // Mask draw properties are used only for rastering, so most of the draw |
1378 // properties computed for other layers are not needed. | 1378 // properties computed for other layers are not needed. |
| 1379 // Draw transform of a mask layer has to be a 2d scale. |
| 1380 // TODO(sunxd): the draw transform of a mask layer misses the "scale to fit" |
| 1381 // factor from mask layer to its parent. So does the screen space transform. |
| 1382 // It does not cause a problem because currently we only have 1:1 mask layer. |
| 1383 mask_layer->draw_properties().target_space_transform = DrawTransform( |
| 1384 mask_layer, property_trees->transform_tree, property_trees->effect_tree); |
1379 mask_layer->draw_properties().screen_space_transform = | 1385 mask_layer->draw_properties().screen_space_transform = |
1380 ScreenSpaceTransformInternal(mask_layer, | 1386 ScreenSpaceTransformInternal(mask_layer, |
1381 property_trees->transform_tree); | 1387 property_trees->transform_tree); |
1382 mask_layer->draw_properties().visible_layer_rect = | 1388 mask_layer->draw_properties().visible_layer_rect = |
1383 gfx::Rect(mask_layer->bounds()); | 1389 gfx::Rect(mask_layer->bounds()); |
1384 } | 1390 } |
1385 | 1391 |
1386 void ComputeSurfaceDrawProperties(const PropertyTrees* property_trees, | 1392 void ComputeSurfaceDrawProperties(const PropertyTrees* property_trees, |
1387 RenderSurfaceImpl* render_surface) { | 1393 RenderSurfaceImpl* render_surface) { |
1388 const EffectNode* effect_node = | 1394 const EffectNode* effect_node = |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 void UpdateElasticOverscroll(PropertyTrees* property_trees, | 1502 void UpdateElasticOverscroll(PropertyTrees* property_trees, |
1497 const Layer* overscroll_elasticity_layer, | 1503 const Layer* overscroll_elasticity_layer, |
1498 const gfx::Vector2dF& elastic_overscroll) { | 1504 const gfx::Vector2dF& elastic_overscroll) { |
1499 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, | 1505 UpdateElasticOverscrollInternal(property_trees, overscroll_elasticity_layer, |
1500 elastic_overscroll); | 1506 elastic_overscroll); |
1501 } | 1507 } |
1502 | 1508 |
1503 } // namespace draw_property_utils | 1509 } // namespace draw_property_utils |
1504 | 1510 |
1505 } // namespace cc | 1511 } // namespace cc |
OLD | NEW |