Commit fa14fd7f authored by ajuma's avatar ajuma Committed by Commit bot

Revert of cc: Re-use transforms from transform nodes when computing visible...

Revert of cc: Re-use transforms from transform nodes when computing visible rects (patchset #2 id:20001 of https://codereview.chromium.org/1060413002/)

Reason for revert:
Causes css3/filters/effect-reference-hidpi-hw.html to have an incorrect visible rect.

Original issue's description:
> cc: Re-use transforms from transform nodes when computing visible rects
>
> This makes CalculateVisibleRects try to re-use the to_target and
> from_target transforms stored in transform nodes whenever it needs to
> compute a transform. Since these baked transforms incorporate the
> target's sublayer scale, the fallback path now also includes sublayer
> scale for consistency.
>
> Testing locally on a z620, this improves property tree computation time
> by 7% on Gmail, and by 20% on rAF-driven poster circle.
>
> BUG=474725
>
> Committed: https://crrev.com/992c398b2fb0e7ab9c7ba58a8eb36787e03962e4
> Cr-Commit-Position: refs/heads/master@{#324122}

TBR=vollick@chromium.org

BUG=474725

Review URL: https://codereview.chromium.org/1077433003

Cr-Commit-Position: refs/heads/master@{#324326}
parent f8c05106
...@@ -45,7 +45,12 @@ void CalculateVisibleRects( ...@@ -45,7 +45,12 @@ void CalculateVisibleRects(
target_is_root_surface ? 0 : transform_node->data.content_target_id; target_is_root_surface ? 0 : transform_node->data.content_target_id;
const TransformNode* target_node = transform_tree.Node(target_id); const TransformNode* target_node = transform_tree.Node(target_id);
gfx::Transform content_to_target = transform_node->data.to_target; // 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);
content_to_target.Translate(layer->offset_to_transform_parent().x(), content_to_target.Translate(layer->offset_to_transform_parent().x(),
layer->offset_to_transform_parent().y()); layer->offset_to_transform_parent().y());
...@@ -53,18 +58,8 @@ void CalculateVisibleRects( ...@@ -53,18 +58,8 @@ void CalculateVisibleRects(
gfx::Rect clip_rect_in_target_space; gfx::Rect clip_rect_in_target_space;
gfx::Transform clip_to_target; gfx::Transform clip_to_target;
bool success = true; success = transform_tree.ComputeTransform(
if (clip_transform_node->data.target_id == target_node->id) { clip_transform_node->id, target_node->id, &clip_to_target);
clip_to_target = clip_transform_node->data.to_target;
} else {
success = transform_tree.ComputeTransform(
clip_transform_node->id, target_node->id, &clip_to_target);
if (target_node->data.needs_sublayer_scale) {
clip_to_target.Scale(target_node->data.sublayer_scale.x(),
target_node->data.sublayer_scale.y());
}
}
if (target_node->id > clip_node->data.transform_id) { if (target_node->id > clip_node->data.transform_id) {
if (!success) { if (!success) {
DCHECK(target_node->data.to_screen_is_animated); DCHECK(target_node->data.to_screen_is_animated);
...@@ -101,19 +96,8 @@ void CalculateVisibleRects( ...@@ -101,19 +96,8 @@ void CalculateVisibleRects(
gfx::Transform target_to_content; gfx::Transform target_to_content;
gfx::Transform target_to_layer; gfx::Transform target_to_layer;
if (transform_node->data.ancestors_are_invertible) { success = transform_tree.ComputeTransform(
target_to_layer = transform_node->data.from_target; target_node->id, transform_node->id, &target_to_layer);
success = true;
} else {
success = transform_tree.ComputeTransform(
target_node->id, transform_node->id, &target_to_layer);
if (target_node->data.needs_sublayer_scale) {
target_to_layer.matrix().postScale(
1.f / target_node->data.sublayer_scale.x(),
1.f / target_node->data.sublayer_scale.y(), 1.f);
}
}
if (!success) { if (!success) {
DCHECK(transform_node->data.to_screen_is_animated); DCHECK(transform_node->data.to_screen_is_animated);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment