| Index: cc/trees/draw_property_utils.cc
|
| diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc
|
| index 322d57e7a9a52d09e1ca2503a65c641bd34679be..b4a268fe21f6cf7f9d4cae6c3493cf0e4c3b1855 100644
|
| --- a/cc/trees/draw_property_utils.cc
|
| +++ b/cc/trees/draw_property_utils.cc
|
| @@ -45,12 +45,7 @@ void CalculateVisibleRects(
|
| target_is_root_surface ? 0 : transform_node->data.content_target_id;
|
| const TransformNode* target_node = transform_tree.Node(target_id);
|
|
|
| - // TODO(ajuma): Try to re-use transforms already stored in the transform
|
| - // tree instead of computing transforms below.
|
| - gfx::Transform content_to_target;
|
| - bool success = transform_tree.ComputeTransform(
|
| - transform_node->id, target_node->id, &content_to_target);
|
| - DCHECK(success);
|
| + gfx::Transform content_to_target = transform_node->data.to_target;
|
|
|
| content_to_target.Translate(layer->offset_to_transform_parent().x(),
|
| layer->offset_to_transform_parent().y());
|
| @@ -58,8 +53,14 @@ void CalculateVisibleRects(
|
|
|
| gfx::Rect clip_rect_in_target_space;
|
| gfx::Transform clip_to_target;
|
| - success = transform_tree.ComputeTransform(
|
| - clip_transform_node->id, target_node->id, &clip_to_target);
|
| + bool success = true;
|
| + if (clip_transform_node->data.target_id == target_node->id) {
|
| + clip_to_target = clip_transform_node->data.to_target;
|
| + } else {
|
| + success = transform_tree.ComputeTransformWithDestinationSublayerScale(
|
| + clip_transform_node->id, target_node->id, &clip_to_target);
|
| + }
|
| +
|
| if (target_node->id > clip_node->data.transform_id) {
|
| if (!success) {
|
| DCHECK(target_node->data.to_screen_is_animated);
|
| @@ -96,8 +97,14 @@ void CalculateVisibleRects(
|
| gfx::Transform target_to_content;
|
| gfx::Transform target_to_layer;
|
|
|
| - success = transform_tree.ComputeTransform(
|
| - target_node->id, transform_node->id, &target_to_layer);
|
| + if (transform_node->data.ancestors_are_invertible) {
|
| + target_to_layer = transform_node->data.from_target;
|
| + success = true;
|
| + } else {
|
| + success = transform_tree.ComputeTransformWithSourceSublayerScale(
|
| + target_node->id, transform_node->id, &target_to_layer);
|
| + }
|
| +
|
| if (!success) {
|
| DCHECK(transform_node->data.to_screen_is_animated);
|
|
|
|
|