Worse animation performance on pages with 3D transforms
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2014 18:37:04 +0000 (18:37 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2014 18:37:04 +0000 (18:37 +0000)
commit92f2d58ef05c91b5cad77f4fea57960d82448b14
tree8e310cbb25a6d88ae211ca08eaad5ecb61d5edd7
parent0fba08a7fb7f08d439e98c30df9ebd01d7e8973d
Worse animation performance on pages with 3D transforms
https://bugs.webkit.org/show_bug.cgi?id=131838
<rdar://problem/16428630&15705876>

Reviewed by Dean Jackson.

Source/WebCore:
r155977 added logic to adjust the contentsScale of compositing layers
based on a root-relative transform. However, this resulted in
the contentsScale continually changing on layers whose transforms
are changed dynamically, which caused lots of expensive painting.

Fix by bucketing the part of the scale computed from the root-relative transform
into buckets of 0.25 via rounding.

Test: compositing/contents-scale/rounded-contents-scale.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::clampedContentsScaleForScale):
(WebCore::GraphicsLayerCA::updateContentsOpaque):
(WebCore::GraphicsLayerCA::updateContentsScale):
(WebCore::GraphicsLayerCA::updateContentsVisibility): Deleted.
(WebCore::GraphicsLayerCA::animatedLayerClones): Deleted.

LayoutTests:
Testcase having layers at various z translates which shows the bucketing
of contentsScale, and fix results affected by the patch.

* compositing/contents-scale/rounded-contents-scale-expected.txt: Added.
* compositing/contents-scale/rounded-contents-scale.html: Added.
* compositing/contents-scale/z-translate-expected.txt:
* platform/mac-wk2/compositing/tiling/rotated-tiled-clamped-expected.txt:
* platform/mac-wk2/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
* platform/mac/compositing/overflow/composited-scrolling-paint-phases-expected.txt:
* platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
* platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
* platform/mac/compositing/visible-rect/3d-transform-style-expected.txt:
* platform/mac/compositing/visible-rect/3d-transformed-expected.txt:
* platform/mac/compositing/visible-rect/nested-transform-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/contents-scale/rounded-contents-scale-expected.txt [new file with mode: 0644]
LayoutTests/compositing/contents-scale/rounded-contents-scale.html [new file with mode: 0644]
LayoutTests/compositing/contents-scale/z-translate-expected.txt
LayoutTests/platform/mac-wk2/compositing/tiling/rotated-tiled-clamped-expected.txt
LayoutTests/platform/mac-wk2/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt
LayoutTests/platform/mac/compositing/overflow/composited-scrolling-paint-phases-expected.txt
LayoutTests/platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt
LayoutTests/platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt
LayoutTests/platform/mac/compositing/visible-rect/3d-transform-style-expected.txt
LayoutTests/platform/mac/compositing/visible-rect/3d-transformed-expected.txt
LayoutTests/platform/mac/compositing/visible-rect/nested-transform-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp