Changeset 155977 in webkit


Ignore:
Timestamp:
Sep 17, 2013 11:12:52 AM (11 years ago)
Author:
Simon Fraser
Message:

Hardware accelerated CSS transitions appear pixelated when scaled up using transform
https://bugs.webkit.org/show_bug.cgi?id=27684
<rdar://problem/6134606>

Source/WebCore:

Reviewed by Dean Jackson.

Take transforms and animations into account when computing the contentsScale
for a layer, so that scaled-up layers remain sharp most of the time.

In its recursiveCommitChanges() tree walk, GraphicsLayerCA now tracks
a root-relative transform, and extracts from that transform the X and Y
scales which it uses to scale the backing store.

If the layer has transform animations on it, we keep around
a transformation matrix for the animation endpoints (or keyframes),
pick up the state that has the larger impact on the root-relative scale,
and use that as the layer's transform, and the transform when recursing
over descendants.

Tests: compositing/contents-scale/animating.html

compositing/contents-scale/scaled-ancestor.html
compositing/contents-scale/simple-scale.html
compositing/contents-scale/z-translate.html

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::maxScaleFromTransform): Decompose the transform if necesssary
to extract the X and Y scale components.
(WebCore::GraphicsLayerCA::GraphicsLayerCA): Initialize m_rootRelativeScaleFactor.
(WebCore::GraphicsLayerCA::flushCompositingState): Supply a TransformationMatrix
for the root of the recursion.
(WebCore::GraphicsLayerCA::layerTransform): This code was factored out of
computeVisibleRect(), and optionally takes a custom transform.
(WebCore::GraphicsLayerCA::computeVisibleRect): Use the layerTransform() function.
(WebCore::GraphicsLayerCA::updateRootRelativeScale): Given a transform from the root,
find the max scale factor by multiplying the various animation endpoint matrices and picking
the one with the biggest impact on scale. Use this to set m_rootRelativeScaleFactor, and
set the flag to say that we need to update contentsScale.
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): After updating
animations, call updateRootRelativeScale() to update m_rootRelativeScaleFactor.
(WebCore::GraphicsLayerCA::updateAnimations): We have a side table of animation name to
TransformationMatrix, so figure out which entries can be removed from that side table,
and remove them.
(WebCore::GraphicsLayerCA::setAnimationOnLayer):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Store the matrices for
animation endpoints/keyframes in the m_animationTransforms side table. We don't store
them directly in LayerPropertyAnimation because we just want the final matrix for
a transform list, and using a side table makes ownership easier to manage.
(WebCore::GraphicsLayerCA::getTransformFromAnimationsWithMaxScaleImpact):
goes through the matrices for the running animation endpoints/keyframes, and
multiplies each with the transform up to this layer to find the matrix with the
larger impact on scale.
(WebCore::GraphicsLayerCA::setTransformAnimationEndpoints): Returns a vector
of TransformationMatrix for the from and to states.
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes): Returns a vector
of TransformationMatrix for the keyframes.
(WebCore::GraphicsLayerCA::updateContentsScale): Include m_rootRelativeScaleFactor in the
scale factor computation.
(WebCore::GraphicsLayerCA::dumpAdditionalProperties): If we're dumping visible rects,
also dump the contentsScale. Convenient at these are useful to look at together, and I didn't
want to pollute Internals with yet more flags.

  • platform/graphics/ca/GraphicsLayerCA.h:

(WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): Formatting.

LayoutTests:

Reviewed by Dean Jackson.

New tests that dump contentsScale under various scaling scenarios:

  • compositing/contents-scale/animating-expected.txt: Added.
  • compositing/contents-scale/animating.html: Added.
  • compositing/contents-scale/scaled-ancestor-expected.txt: Added.
  • compositing/contents-scale/scaled-ancestor.html: Added.
  • compositing/contents-scale/simple-scale-expected.txt: Added.
  • compositing/contents-scale/simple-scale.html: Added.
  • compositing/contents-scale/z-translate-expected.txt: Added.
  • compositing/contents-scale/z-translate.html: Added.

These tests had Mac-specific results (which include visible rects and now
contents scale) in the cross-platform directory, so cleaned up the cross-platform
results and moved the Mac results to platform-mac.

  • compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt:
  • compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt:
  • compositing/visible-rect/2d-transformed-expected.txt:
  • compositing/visible-rect/3d-transform-style-expected.txt:
  • compositing/visible-rect/3d-transformed-expected.txt:
  • compositing/visible-rect/animated-expected.txt:
  • compositing/visible-rect/animated-from-none-expected.txt:
  • compositing/visible-rect/clipped-by-viewport-expected.txt:
  • compositing/visible-rect/clipped-visible-rect-expected.txt:
  • compositing/visible-rect/flipped-preserve-3d-expected.txt:
  • compositing/visible-rect/iframe-and-layers-expected.txt:
  • compositing/visible-rect/nested-transform-expected.txt:
  • compositing/visible-rect/scrolled-expected.txt:
  • platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
  • platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
  • platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt:
  • platform/mac/compositing/visible-rect/2d-transformed-expected.txt: Copied from LayoutTests/compositing/visible-rect/2d-transformed-expected.txt.
  • platform/mac/compositing/visible-rect/3d-transform-style-expected.txt: Copied from LayoutTests/compositing/visible-rect/3d-transform-style-expected.txt.
  • platform/mac/compositing/visible-rect/3d-transformed-expected.txt: Copied from LayoutTests/compositing/visible-rect/3d-transformed-expected.txt.
  • platform/mac/compositing/visible-rect/animated-expected.txt: Copied from LayoutTests/compositing/visible-rect/animated-expected.txt.
  • platform/mac/compositing/visible-rect/animated-from-none-expected.txt: Copied from LayoutTests/compositing/visible-rect/animated-from-none-expected.txt.
  • platform/mac/compositing/visible-rect/clipped-by-viewport-expected.txt: Copied from LayoutTests/compositing/visible-rect/clipped-by-viewport-expected.txt.
  • platform/mac/compositing/visible-rect/clipped-visible-rect-expected.txt: Copied from LayoutTests/compositing/visible-rect/clipped-visible-rect-expected.txt.
  • platform/mac/compositing/visible-rect/flipped-preserve-3d-expected.txt: Copied from LayoutTests/compositing/visible-rect/flipped-preserve-3d-expected.txt.
  • platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt: Copied from LayoutTests/compositing/visible-rect/iframe-and-layers-expected.txt.
  • platform/mac/compositing/visible-rect/iframe-no-layers-expected.txt:
  • platform/mac/compositing/visible-rect/nested-transform-expected.txt: Copied from LayoutTests/compositing/visible-rect/nested-transform-expected.txt.
  • platform/mac/compositing/visible-rect/scrolled-expected.txt: Copied from LayoutTests/compositing/visible-rect/scrolled-expected.txt.
Location:
trunk
Files:
9 added
21 edited
13 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r155976 r155977  
     12013-09-16  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Hardware accelerated CSS transitions appear pixelated when scaled up using transform
     4        https://bugs.webkit.org/show_bug.cgi?id=27684
     5        <rdar://problem/6134606>
     6
     7        Reviewed by Dean Jackson.
     8       
     9        New tests that dump contentsScale under various scaling scenarios:
     10
     11        * compositing/contents-scale/animating-expected.txt: Added.
     12        * compositing/contents-scale/animating.html: Added.
     13        * compositing/contents-scale/scaled-ancestor-expected.txt: Added.
     14        * compositing/contents-scale/scaled-ancestor.html: Added.
     15        * compositing/contents-scale/simple-scale-expected.txt: Added.
     16        * compositing/contents-scale/simple-scale.html: Added.
     17        * compositing/contents-scale/z-translate-expected.txt: Added.
     18        * compositing/contents-scale/z-translate.html: Added.
     19       
     20        These tests had Mac-specific results (which include visible rects and now
     21        contents scale) in the cross-platform directory, so cleaned up the cross-platform
     22        results and moved the Mac results to platform-mac.
     23
     24        * compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt:
     25        * compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt:
     26        * compositing/visible-rect/2d-transformed-expected.txt:
     27        * compositing/visible-rect/3d-transform-style-expected.txt:
     28        * compositing/visible-rect/3d-transformed-expected.txt:
     29        * compositing/visible-rect/animated-expected.txt:
     30        * compositing/visible-rect/animated-from-none-expected.txt:
     31        * compositing/visible-rect/clipped-by-viewport-expected.txt:
     32        * compositing/visible-rect/clipped-visible-rect-expected.txt:
     33        * compositing/visible-rect/flipped-preserve-3d-expected.txt:
     34        * compositing/visible-rect/iframe-and-layers-expected.txt:
     35        * compositing/visible-rect/nested-transform-expected.txt:
     36        * compositing/visible-rect/scrolled-expected.txt:
     37        * platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
     38        * platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
     39        * platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt:
     40        * platform/mac/compositing/visible-rect/2d-transformed-expected.txt: Copied from LayoutTests/compositing/visible-rect/2d-transformed-expected.txt.
     41        * platform/mac/compositing/visible-rect/3d-transform-style-expected.txt: Copied from LayoutTests/compositing/visible-rect/3d-transform-style-expected.txt.
     42        * platform/mac/compositing/visible-rect/3d-transformed-expected.txt: Copied from LayoutTests/compositing/visible-rect/3d-transformed-expected.txt.
     43        * platform/mac/compositing/visible-rect/animated-expected.txt: Copied from LayoutTests/compositing/visible-rect/animated-expected.txt.
     44        * platform/mac/compositing/visible-rect/animated-from-none-expected.txt: Copied from LayoutTests/compositing/visible-rect/animated-from-none-expected.txt.
     45        * platform/mac/compositing/visible-rect/clipped-by-viewport-expected.txt: Copied from LayoutTests/compositing/visible-rect/clipped-by-viewport-expected.txt.
     46        * platform/mac/compositing/visible-rect/clipped-visible-rect-expected.txt: Copied from LayoutTests/compositing/visible-rect/clipped-visible-rect-expected.txt.
     47        * platform/mac/compositing/visible-rect/flipped-preserve-3d-expected.txt: Copied from LayoutTests/compositing/visible-rect/flipped-preserve-3d-expected.txt.
     48        * platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt: Copied from LayoutTests/compositing/visible-rect/iframe-and-layers-expected.txt.
     49        * platform/mac/compositing/visible-rect/iframe-no-layers-expected.txt:
     50        * platform/mac/compositing/visible-rect/nested-transform-expected.txt: Copied from LayoutTests/compositing/visible-rect/nested-transform-expected.txt.
     51        * platform/mac/compositing/visible-rect/scrolled-expected.txt: Copied from LayoutTests/compositing/visible-rect/scrolled-expected.txt.
     52
    1532013-09-17  Samuel White  <samuel_white@apple.com>
    254
  • trunk/LayoutTests/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt

    r155607 r155977  
    66(GraphicsLayer
    77  (bounds 800.00 600.00)
    8   (visible rect 0.00, 0.00 800.00 x 600.00)
    98  (children 1
    109    (GraphicsLayer
    1110      (bounds 800.00 600.00)
    1211      (contentsOpaque 1)
    13       (visible rect 0.00, 0.00 800.00 x 600.00)
    1412      (children 3
    1513        (GraphicsLayer
     
    1715          (bounds 22.00 22.00)
    1816          (drawsContent 1)
    19           (visible rect 0.00, 0.00 22.00 x 22.00)
    2017        )
    2118        (GraphicsLayer
     
    2320          (bounds 102.00 20.00)
    2421          (drawsContent 1)
    25           (visible rect 0.00, 0.00 102.00 x 20.00)
    2622        )
    2723        (GraphicsLayer
     
    2925          (bounds 787.00 18.00)
    3026          (drawsContent 1)
    31           (visible rect 0.00, 0.00 787.00 x 18.00)
    3227        )
    3328      )
  • trunk/LayoutTests/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt

    r155607 r155977  
    66(GraphicsLayer
    77  (bounds 800.00 600.00)
    8   (visible rect 0.00, 0.00 800.00 x 600.00)
    98  (children 1
    109    (GraphicsLayer
    1110      (bounds 800.00 600.00)
    1211      (contentsOpaque 1)
    13       (visible rect 0.00, 0.00 800.00 x 600.00)
    1412      (children 3
    1513        (GraphicsLayer
     
    1715          (bounds 22.00 22.00)
    1816          (drawsContent 1)
    19           (visible rect 0.00, 0.00 22.00 x 22.00)
    2017        )
    2118        (GraphicsLayer
     
    2320          (bounds 102.00 20.00)
    2421          (drawsContent 1)
    25           (visible rect 0.00, 0.00 102.00 x 20.00)
    2622        )
    2723        (GraphicsLayer
     
    2925          (bounds 778.00 18.00)
    3026          (drawsContent 1)
    31           (visible rect 0.00, 0.00 778.00 x 18.00)
    3227        )
    3328      )
  • trunk/LayoutTests/compositing/visible-rect/2d-transformed-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 800.00 600.00)
    3   (visible rect 0.00, 0.00 800.00 x 600.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 800.00 600.00)
    76      (contentsOpaque 1)
    8       (visible rect 0.00, 0.00 800.00 x 600.00)
    97      (children 1
    108        (GraphicsLayer
    119          (position 8.00 8.00)
    1210          (bounds 502.00 202.00)
    13           (visible rect 0.00, 0.00 502.00 x 202.00)
    1411          (children 1
    1512            (GraphicsLayer
    1613              (position 1.00 1.00)
    1714              (bounds 500.00 200.00)
    18               (visible rect 0.00, 0.00 500.00 x 200.00)
    1915              (children 3
    2016                (GraphicsLayer
     
    2218                  (contentsOpaque 1)
    2319                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [-100.00 0.00 0.00 1.00])
    24                   (visible rect 100.00, 0.00 100.00 x 200.00)
    2520                )
    2621                (GraphicsLayer
     
    2823                  (contentsOpaque 1)
    2924                  (transform [0.71 0.71 0.00 0.00] [-0.71 0.71 0.00 0.00] [0.00 0.00 1.00 0.00] [150.00 0.00 0.00 1.00])
    30                   (visible rect 0.00, 0.00 200.00 x 200.00)
    3125                )
    3226                (GraphicsLayer
     
    3428                  (contentsOpaque 1)
    3529                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [400.00 0.00 0.00 1.00])
    36                   (visible rect 0.00, 0.00 100.00 x 200.00)
    3730                )
    3831              )
  • trunk/LayoutTests/compositing/visible-rect/3d-transform-style-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 800.00 600.00)
    3   (visible rect 0.00, 0.00 800.00 x 600.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 800.00 600.00)
    76      (contentsOpaque 1)
    8       (visible rect 0.00, 0.00 800.00 x 600.00)
    97      (children 2
    108        (GraphicsLayer
    119          (position 18.00 10.00)
    1210          (bounds 204.00 204.00)
    13           (visible rect 0.00, 0.00 204.00 x 204.00)
    1411          (children 1
    1512            (GraphicsLayer
     
    1714              (bounds 200.00 200.00)
    1815              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.07 0.07 1.00 -0.00] [0.00 0.00 0.00 1.00])
    19               (visible rect 0.00, 0.00 200.00 x 200.00)
    2016              (children 1
    2117                (GraphicsLayer
    2218                  (bounds 200.00 0.00)
    2319                  (preserves3D 1)
    24                   (visible rect 0.00, 0.00 0.00 x 0.00)
    2520                  (children 1
    2621                    (GraphicsLayer
     
    2823                      (contentsOpaque 1)
    2924                      (transform [1.00 0.00 0.00 0.00] [0.00 0.91 0.42 0.00] [0.00 -0.42 0.91 0.00] [0.00 0.00 0.00 1.00])
    30                       (visible rect 0.00, 0.00 213.67 x 200.68)
    3125                    )
    3226                  )
     
    3933          (position 18.00 224.00)
    4034          (bounds 204.00 204.00)
    41           (visible rect 0.00, 0.00 204.00 x 204.00)
    4235          (children 1
    4336            (GraphicsLayer
     
    4538              (bounds 200.00 200.00)
    4639              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.07 0.07 1.00 -0.00] [0.00 0.00 0.00 1.00])
    47               (visible rect 0.00, 0.00 200.00 x 200.00)
    4840              (children 1
    4941                (GraphicsLayer
    5042                  (bounds 200.00 0.00)
    5143                  (preserves3D 1)
    52                   (visible rect 0.00, 0.00 0.00 x 0.00)
    5344                  (children 1
    5445                    (GraphicsLayer
     
    5647                      (contentsOpaque 1)
    5748                      (transform [0.91 0.00 0.42 0.00] [0.00 1.00 0.00 0.00] [-0.42 0.00 0.91 0.00] [0.00 0.00 0.00 1.00])
    58                       (visible rect 0.00, 0.00 200.68 x 213.67)
    5949                    )
    6050                  )
  • trunk/LayoutTests/compositing/visible-rect/3d-transformed-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 800.00 600.00)
    3   (visible rect 0.00, 0.00 800.00 x 600.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 800.00 600.00)
    76      (contentsOpaque 1)
    8       (visible rect 0.00, 0.00 800.00 x 600.00)
    97      (children 2
    108        (GraphicsLayer
    119          (position 18.00 10.00)
    1210          (bounds 204.00 204.00)
    13           (visible rect 0.00, 0.00 204.00 x 204.00)
    1411          (children 1
    1512            (GraphicsLayer
     
    1714              (bounds 200.00 200.00)
    1815              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.07 0.07 1.00 -0.00] [0.00 0.00 0.00 1.00])
    19               (visible rect 0.00, 0.00 200.00 x 200.00)
    2016              (children 1
    2117                (GraphicsLayer
     
    2420                  (contentsOpaque 1)
    2521                  (transform [1.00 0.00 0.00 0.00] [0.00 0.71 0.71 0.00] [0.00 -0.71 0.71 0.00] [0.00 0.00 0.00 1.00])
    26                   (visible rect 0.00, 0.00 220.62 x 218.46)
    2722                )
    2823              )
     
    3328          (position 18.00 224.00)
    3429          (bounds 204.00 204.00)
    35           (visible rect 0.00, 0.00 204.00 x 204.00)
    3630          (children 1
    3731            (GraphicsLayer
     
    3933              (bounds 200.00 200.00)
    4034              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.07 0.07 1.00 -0.00] [0.00 0.00 0.00 1.00])
    41               (visible rect 0.00, 0.00 200.00 x 200.00)
    4235              (children 1
    4336                (GraphicsLayer
     
    4639                  (contentsOpaque 1)
    4740                  (transform [0.71 0.00 0.71 0.00] [0.00 1.00 0.00 0.00] [-0.71 0.00 0.71 0.00] [0.00 0.00 0.00 1.00])
    48                   (visible rect 0.00, 0.00 218.46 x 220.62)
    4941                )
    5042              )
  • trunk/LayoutTests/compositing/visible-rect/animated-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 800.00 600.00)
    3   (visible rect 0.00, 0.00 800.00 x 600.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 800.00 600.00)
    76      (contentsOpaque 1)
    8       (visible rect 0.00, 0.00 800.00 x 600.00)
    97      (children 1
    108        (GraphicsLayer
    119          (position 8.00 8.00)
    1210          (bounds 502.00 202.00)
    13           (visible rect 0.00, 0.00 502.00 x 202.00)
    1411          (children 1
    1512            (GraphicsLayer
    1613              (position 1.00 1.00)
    1714              (bounds 500.00 200.00)
    18               (visible rect 0.00, 0.00 500.00 x 200.00)
    1915              (children 1
    2016                (GraphicsLayer
     
    2218                  (contentsOpaque 1)
    2319                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [-100.00 0.00 0.00 1.00])
    24                   (visible rect 100.00, 0.00 100.00 x 200.00)
    2520                )
    2621              )
  • trunk/LayoutTests/compositing/visible-rect/animated-from-none-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 800.00 600.00)
    3   (visible rect 0.00, 0.00 800.00 x 600.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 800.00 600.00)
    76      (contentsOpaque 1)
    8       (visible rect 0.00, 0.00 800.00 x 600.00)
    97      (children 1
    108        (GraphicsLayer
    119          (position 8.00 8.00)
    1210          (bounds 502.00 202.00)
    13           (visible rect 0.00, 0.00 502.00 x 202.00)
    1411          (children 1
    1512            (GraphicsLayer
    1613              (position 1.00 1.00)
    1714              (bounds 500.00 200.00)
    18               (visible rect 0.00, 0.00 500.00 x 200.00)
    1915              (children 1
    2016                (GraphicsLayer
     
    2218                  (bounds 200.00 200.00)
    2319                  (contentsOpaque 1)
    24                   (visible rect 100.00, 0.00 100.00 x 200.00)
    2520                )
    2621              )
  • trunk/LayoutTests/compositing/visible-rect/clipped-by-viewport-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 800.00 600.00)
    3   (visible rect 0.00, 0.00 800.00 x 600.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 800.00 600.00)
    76      (contentsOpaque 1)
    8       (visible rect 0.00, 0.00 800.00 x 600.00)
    97      (children 2
    108        (GraphicsLayer
     
    1311          (contentsOpaque 1)
    1412          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    15           (visible rect 100.00, 120.00 100.00 x 80.00)
    1613        )
    1714        (GraphicsLayer
     
    2017          (contentsOpaque 1)
    2118          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    22           (visible rect 100.00, 0.00 100.00 x 200.00)
    2319        )
    2420      )
  • trunk/LayoutTests/compositing/visible-rect/clipped-visible-rect-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 800.00 600.00)
    3   (visible rect 0.00, 0.00 800.00 x 600.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 800.00 600.00)
    76      (contentsOpaque 1)
    8       (visible rect 0.00, 0.00 800.00 x 600.00)
    97      (children 1
    108        (GraphicsLayer
    119          (position 8.00 8.00)
    1210          (bounds 502.00 202.00)
    13           (visible rect 0.00, 0.00 502.00 x 202.00)
    1411          (children 1
    1512            (GraphicsLayer
    1613              (position 1.00 1.00)
    1714              (bounds 500.00 200.00)
    18               (visible rect 0.00, 0.00 500.00 x 200.00)
    1915              (children 3
    2016                (GraphicsLayer
     
    2319                  (contentsOpaque 1)
    2420                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    25                   (visible rect 100.00, 0.00 100.00 x 200.00)
    2621                )
    2722                (GraphicsLayer
     
    3025                  (contentsOpaque 1)
    3126                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    32                   (visible rect 0.00, 0.00 200.00 x 200.00)
    3327                )
    3428                (GraphicsLayer
     
    3731                  (contentsOpaque 1)
    3832                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    39                   (visible rect 0.00, 0.00 100.00 x 200.00)
    4033                )
    4134              )
  • trunk/LayoutTests/compositing/visible-rect/flipped-preserve-3d-expected.txt

    r148988 r155977  
    77(GraphicsLayer
    88  (bounds 785.00 615.00)
    9   (visible rect 0.00, 0.00 785.00 x 600.00)
    109  (children 1
    1110    (GraphicsLayer
    1211      (bounds 785.00 615.00)
    1312      (contentsOpaque 1)
    14       (visible rect 0.00, 0.00 785.00 x 600.00)
    1513      (children 1
    1614        (GraphicsLayer
     
    1816          (bounds 602.00 602.00)
    1917          (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 -0.00] [0.00 0.00 0.00 1.00])
    20           (visible rect 0.00, 0.00 602.00 x 587.00)
    2118          (children 1
    2219            (GraphicsLayer
     
    2623              (preserves3D 1)
    2724              (transform [-1.00 0.00 -0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 -1.00 0.00] [0.00 0.00 0.00 1.00])
    28               (visible rect 0.00, 0.00 440.00 x 440.00)
    2925              (children 1
    3026                (GraphicsLayer
     
    3228                  (contentsOpaque 1)
    3329                  (transform [-1.00 0.00 -0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 -1.00 0.00] [0.00 0.00 0.00 1.00])
    34                   (visible rect 0.00, 0.00 420.00 x 420.00)
    3530                  (children 1
    3631                    (GraphicsLayer
    3732                      (bounds 420.00 420.00)
    38                       (visible rect 0.00, 0.00 420.00 x 420.00)
    3933                      (children 1
    4034                        (GraphicsLayer
     
    4236                          (bounds 418.00 510.00)
    4337                          (contentsOpaque 1)
    44                           (visible rect 0.00, 90.00 418.00 x 420.00)
    4538                          (children 1
    4639                            (GraphicsLayer
    4740                              (bounds 418.00 510.00)
    48                               (visible rect 0.00, 90.00 418.00 x 420.00)
    4941                              (children 3
    5042                                (GraphicsLayer
     
    5446                                  (usingTiledLayer 1)
    5547                                  (drawsContent 1)
    56                                   (visible rect 3000.00, 90.00 418.00 x 30.00)
    5748                                )
    5849                                (GraphicsLayer
     
    6253                                  (usingTiledLayer 1)
    6354                                  (drawsContent 1)
    64                                   (visible rect 3000.00, 0.00 418.00 x 120.00)
    6555                                )
    6656                                (GraphicsLayer
     
    7060                                  (usingTiledLayer 1)
    7161                                  (drawsContent 1)
    72                                   (visible rect 3000.00, 0.00 418.00 x 120.00)
    7362                                )
    7463                              )
  • trunk/LayoutTests/compositing/visible-rect/iframe-and-layers-expected.txt

    r148049 r155977  
    22(GraphicsLayer
    33  (bounds 1508.00 1516.00)
    4   (visible rect 0.00, 0.00 785.00 x 585.00)
    54  (children 1
    65    (GraphicsLayer
    76      (bounds 1508.00 1516.00)
    87      (contentsOpaque 1)
    9       (visible rect 0.00, 0.00 785.00 x 585.00)
    108      (children 2
    119        (GraphicsLayer
     
    1311          (bounds 360.00 210.00)
    1412          (drawsContent 1)
    15           (visible rect 0.00, 0.00 360.00 x 210.00)
    1613          (children 1
    1714            (GraphicsLayer
    1815              (position 30.00 30.00)
    19               (visible rect 0.00, 0.00 0.00 x 0.00)
    2016              (children 1
    2117                (GraphicsLayer
    2218                  (bounds 285.00 135.00)
    23                   (visible rect 0.00, 0.00 285.00 x 135.00)
    2419                  (children 1
    2520                    (GraphicsLayer
    26                       (visible rect 0.00, 0.00 0.00 x 0.00)
    2721                      (children 1
    2822                        (GraphicsLayer
    2923                          (bounds 1508.00 1516.00)
    30                           (visible rect 0.00, 0.00 285.00 x 135.00)
    3124                          (children 1
    3225                            (GraphicsLayer
    3326                              (bounds 1508.00 1516.00)
    3427                              (drawsContent 1)
    35                               (visible rect 0.00, 0.00 285.00 x 135.00)
    3628                              (children 1
    3729                                (GraphicsLayer
     
    4133                                  (drawsContent 1)
    4234                                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    43                                   (visible rect 0.00, 0.00 100.00 x 127.00)
    4435                                )
    4536                              )
     
    6051          (contentsOpaque 1)
    6152          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    62           (visible rect 0.00, 0.00 200.00 x 200.00)
    6353        )
    6454      )
  • trunk/LayoutTests/compositing/visible-rect/nested-transform-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 785.00 669.00)
    3   (visible rect 0.00, 0.00 785.00 x 600.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 785.00 669.00)
    76      (contentsOpaque 1)
    8       (visible rect 0.00, 0.00 785.00 x 600.00)
    97      (children 2
    108        (GraphicsLayer
    119          (position 18.00 10.00)
    1210          (bounds 304.00 304.00)
    13           (visible rect 0.00, 0.00 304.00 x 304.00)
    1411          (children 1
    1512            (GraphicsLayer
     
    1714              (bounds 300.00 300.00)
    1815              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.26 0.26 1.00 -0.00] [0.00 0.00 0.00 1.00])
    19               (visible rect 0.00, 0.00 300.00 x 300.00)
    2016              (children 1
    2117                (GraphicsLayer
     
    2319                  (preserves3D 1)
    2420                  (transform [0.94 0.00 -0.34 0.00] [0.00 1.00 0.00 0.00] [0.34 0.00 0.94 0.00] [0.00 0.00 0.00 1.00])
    25                   (visible rect 0.00, 0.00 0.00 x 0.00)
    2621                  (children 1
    2722                    (GraphicsLayer
     
    2924                      (preserves3D 1)
    3025                      (transform [0.94 0.00 -0.34 0.00] [0.00 1.00 0.00 0.00] [0.34 0.00 0.94 0.00] [0.00 0.00 0.00 1.00])
    31                       (visible rect 0.00, 0.00 0.00 x 0.00)
    3226                      (children 1
    3327                        (GraphicsLayer
     
    3529                          (contentsOpaque 1)
    3630                          (transform [1.00 0.00 0.00 0.00] [0.00 0.82 0.57 0.00] [0.00 -0.57 0.82 0.00] [0.00 0.00 0.00 1.00])
    37                           (visible rect 0.00, 0.00 500.00 x 369.91)
    3831                        )
    3932                      )
     
    4841          (position 18.00 324.00)
    4942          (bounds 304.00 304.00)
    50           (visible rect 0.00, 0.00 304.00 x 276.00)
    5143          (children 1
    5244            (GraphicsLayer
     
    5446              (bounds 300.00 300.00)
    5547              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.26 0.26 1.00 -0.00] [0.00 0.00 0.00 1.00])
    56               (visible rect 0.00, 0.00 300.00 x 274.00)
    5748              (children 1
    5849                (GraphicsLayer
    5950                  (bounds 300.00 0.00)
    6051                  (preserves3D 1)
    61                   (visible rect 0.00, 0.00 0.00 x 0.00)
    6252                  (children 1
    6353                    (GraphicsLayer
     
    6555                      (preserves3D 1)
    6656                      (transform [0.77 0.00 -0.64 0.00] [0.00 1.00 0.00 0.00] [0.64 0.00 0.77 0.00] [0.00 0.00 0.00 1.00])
    67                       (visible rect 0.00, 0.00 0.00 x 0.00)
    6857                      (children 1
    6958                        (GraphicsLayer
     
    7160                          (contentsOpaque 1)
    7261                          (transform [1.00 0.00 0.00 0.00] [0.00 0.82 0.57 0.00] [0.00 -0.57 0.82 0.00] [0.00 0.00 0.00 1.00])
    73                           (visible rect 0.00, 0.00 500.00 x 351.87)
    7462                        )
    7563                      )
  • trunk/LayoutTests/compositing/visible-rect/scrolled-expected.txt

    r146531 r155977  
    11(GraphicsLayer
    22  (bounds 1508.00 2008.00)
    3   (visible rect 25.00, 200.00 785.00 x 585.00)
    43  (children 1
    54    (GraphicsLayer
    65      (bounds 1508.00 2008.00)
    76      (contentsOpaque 1)
    8       (visible rect 25.00, 200.00 785.00 x 585.00)
    97      (children 1
    108        (GraphicsLayer
     
    1311          (contentsOpaque 1)
    1412          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    15           (visible rect 17.00, 200.00 183.00 x 300.00)
    1613        )
    1714      )
  • trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt

    r155976 r155977  
    77  (bounds 800.00 600.00)
    88  (visible rect 0.00, 0.00 800.00 x 600.00)
     9  (contentsScale 1.00)
    910  (children 1
    1011    (GraphicsLayer
     
    1213      (contentsOpaque 1)
    1314      (visible rect 0.00, 0.00 800.00 x 600.00)
     15      (contentsScale 1.00)
    1416      (children 3
    1517        (GraphicsLayer
     
    1820          (drawsContent 1)
    1921          (visible rect 0.00, 0.00 22.00 x 22.00)
     22          (contentsScale 1.00)
    2023        )
    2124        (GraphicsLayer
     
    2427          (drawsContent 1)
    2528          (visible rect 0.00, 0.00 102.00 x 20.00)
     29          (contentsScale 1.00)
    2630        )
    2731        (GraphicsLayer
     
    3034          (drawsContent 1)
    3135          (visible rect 0.00, 0.00 787.00 x 18.00)
     36          (contentsScale 1.00)
    3237        )
    3338      )
  • trunk/LayoutTests/platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt

    r155976 r155977  
    77  (bounds 800.00 600.00)
    88  (visible rect 0.00, 0.00 800.00 x 600.00)
     9  (contentsScale 1.00)
    910  (children 1
    1011    (GraphicsLayer
     
    1213      (contentsOpaque 1)
    1314      (visible rect 0.00, 0.00 800.00 x 600.00)
     15      (contentsScale 1.00)
    1416      (children 3
    1517        (GraphicsLayer
     
    1820          (drawsContent 1)
    1921          (visible rect 0.00, 0.00 22.00 x 22.00)
     22          (contentsScale 1.00)
    2023        )
    2124        (GraphicsLayer
     
    2427          (drawsContent 1)
    2528          (visible rect 0.00, 0.00 102.00 x 20.00)
     29          (contentsScale 1.00)
    2630        )
    2731        (GraphicsLayer
     
    3034          (drawsContent 1)
    3135          (visible rect 0.00, 0.00 778.00 x 18.00)
     36          (contentsScale 1.00)
    3237        )
    3338      )
  • trunk/LayoutTests/platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt

    r146531 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 1
    1012        (GraphicsLayer
     
    1214          (bounds 502.00 302.00)
    1315          (visible rect 0.00, 0.00 502.00 x 302.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1821              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 -0.00] [0.00 0.00 0.00 1.00])
    1922              (visible rect 0.00, 0.00 500.00 x 300.00)
     23              (contentsScale 1.00)
    2024              (children 1
    2125                (GraphicsLayer
     
    2832                  (transform [0.17 0.00 -0.98 0.00] [0.00 1.00 0.00 0.00] [0.98 0.00 0.17 0.00] [0.00 0.00 0.00 1.00])
    2933                  (visible rect 0.00, 0.00 2800.00 x 300.00)
    30                   (tile cache coverage 0, 0 2800 x 300)
     34                  (contentsScale 1.00)
     35                  (tile cache coverage 0, 0 2799 x 299)
    3136                  (tile size 512 x 512)
    32                   (top left tile 0, 0 tiles grid 6 x 1)
     37                  (top left tile 0, 0 tiles grid 5 x 1)
    3338                )
    3439              )
  • trunk/LayoutTests/platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt

    r146531 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 1
    1012        (GraphicsLayer
     
    1214          (bounds 502.00 302.00)
    1315          (visible rect 0.00, 0.00 502.00 x 302.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1821              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 -0.00] [0.00 0.00 0.00 1.00])
    1922              (visible rect 0.00, 0.00 500.00 x 300.00)
     23              (contentsScale 1.00)
    2024              (children 1
    2125                (GraphicsLayer
     
    2327                  (preserves3D 1)
    2428                  (visible rect 0.00, 0.00 0.00 x 0.00)
     29                  (contentsScale 1.00)
    2530                  (children 1
    2631                    (GraphicsLayer
     
    3338                      (transform [0.17 0.00 -0.98 0.00] [0.00 1.00 0.00 0.00] [0.98 0.00 0.17 0.00] [0.00 0.00 0.00 1.00])
    3439                      (visible rect 0.00, 0.00 2800.00 x 300.00)
    35                       (tile cache coverage 0, 0 2800 x 300)
     40                      (contentsScale 1.00)
     41                      (tile cache coverage 0, 0 2799 x 299)
    3642                      (tile size 512 x 512)
    37                       (top left tile 0, 0 tiles grid 6 x 1)
     43                      (top left tile 0, 0 tiles grid 5 x 1)
    3844                    )
    3945                  )
  • trunk/LayoutTests/platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt

    r146531 r155977  
    22  (bounds 1932.00 4150.00)
    33  (visible rect 0.00, 0.00 785.00 x 585.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    910      (transform [1.60 0.00 0.00 0.00] [0.00 1.60 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
    1011      (visible rect 0.00, 0.00 490.63 x 365.63)
     12      (contentsScale 2.56)
    1113      (children 1
    1214        (GraphicsLayer
     
    1618          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    1719          (visible rect 0.00, 0.00 482.63 x 357.63)
     20          (contentsScale 2.56)
    1821        )
    1922      )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/2d-transformed-expected.txt

    r155976 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 1
    1012        (GraphicsLayer
     
    1214          (bounds 502.00 202.00)
    1315          (visible rect 0.00, 0.00 502.00 x 202.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1720              (bounds 500.00 200.00)
    1821              (visible rect 0.00, 0.00 500.00 x 200.00)
     22              (contentsScale 1.00)
    1923              (children 3
    2024                (GraphicsLayer
     
    2327                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [-100.00 0.00 0.00 1.00])
    2428                  (visible rect 100.00, 0.00 100.00 x 200.00)
     29                  (contentsScale 1.00)
    2530                )
    2631                (GraphicsLayer
     
    2934                  (transform [0.71 0.71 0.00 0.00] [-0.71 0.71 0.00 0.00] [0.00 0.00 1.00 0.00] [150.00 0.00 0.00 1.00])
    3035                  (visible rect 0.00, 0.00 200.00 x 200.00)
     36                  (contentsScale 1.00)
    3137                )
    3238                (GraphicsLayer
     
    3541                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [400.00 0.00 0.00 1.00])
    3642                  (visible rect 0.00, 0.00 100.00 x 200.00)
     43                  (contentsScale 1.00)
    3744                )
    3845              )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/3d-transform-style-expected.txt

    r155976 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 2
    1012        (GraphicsLayer
     
    1214          (bounds 204.00 204.00)
    1315          (visible rect 0.00, 0.00 204.00 x 204.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1821              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.07 0.07 1.00 -0.00] [0.00 0.00 0.00 1.00])
    1922              (visible rect 0.00, 0.00 200.00 x 200.00)
     23              (contentsScale 1.00)
    2024              (children 1
    2125                (GraphicsLayer
     
    2327                  (preserves3D 1)
    2428                  (visible rect 0.00, 0.00 0.00 x 0.00)
     29                  (contentsScale 1.00)
    2530                  (children 1
    2631                    (GraphicsLayer
     
    2934                      (transform [1.00 0.00 0.00 0.00] [0.00 0.91 0.42 0.00] [0.00 -0.42 0.91 0.00] [0.00 0.00 0.00 1.00])
    3035                      (visible rect 0.00, 0.00 213.67 x 200.68)
     36                      (contentsScale 0.93)
    3137                    )
    3238                  )
     
    4046          (bounds 204.00 204.00)
    4147          (visible rect 0.00, 0.00 204.00 x 204.00)
     48          (contentsScale 1.00)
    4249          (children 1
    4350            (GraphicsLayer
     
    4653              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.07 0.07 1.00 -0.00] [0.00 0.00 0.00 1.00])
    4754              (visible rect 0.00, 0.00 200.00 x 200.00)
     55              (contentsScale 1.00)
    4856              (children 1
    4957                (GraphicsLayer
     
    5159                  (preserves3D 1)
    5260                  (visible rect 0.00, 0.00 0.00 x 0.00)
     61                  (contentsScale 1.00)
    5362                  (children 1
    5463                    (GraphicsLayer
     
    5766                      (transform [0.91 0.00 0.42 0.00] [0.00 1.00 0.00 0.00] [-0.42 0.00 0.91 0.00] [0.00 0.00 0.00 1.00])
    5867                      (visible rect 0.00, 0.00 200.68 x 213.67)
     68                      (contentsScale 0.92)
    5969                    )
    6070                  )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/3d-transformed-expected.txt

    r155976 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 2
    1012        (GraphicsLayer
     
    1214          (bounds 204.00 204.00)
    1315          (visible rect 0.00, 0.00 204.00 x 204.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1821              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.07 0.07 1.00 -0.00] [0.00 0.00 0.00 1.00])
    1922              (visible rect 0.00, 0.00 200.00 x 200.00)
     23              (contentsScale 1.00)
    2024              (children 1
    2125                (GraphicsLayer
     
    2529                  (transform [1.00 0.00 0.00 0.00] [0.00 0.71 0.71 0.00] [0.00 -0.71 0.71 0.00] [0.00 0.00 0.00 1.00])
    2630                  (visible rect 0.00, 0.00 220.62 x 218.46)
     31                  (contentsScale 0.92)
    2732                )
    2833              )
     
    3439          (bounds 204.00 204.00)
    3540          (visible rect 0.00, 0.00 204.00 x 204.00)
     41          (contentsScale 1.00)
    3642          (children 1
    3743            (GraphicsLayer
     
    4046              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.07 0.07 1.00 -0.00] [0.00 0.00 0.00 1.00])
    4147              (visible rect 0.00, 0.00 200.00 x 200.00)
     48              (contentsScale 1.00)
    4249              (children 1
    4350                (GraphicsLayer
     
    4754                  (transform [0.71 0.00 0.71 0.00] [0.00 1.00 0.00 0.00] [-0.71 0.00 0.71 0.00] [0.00 0.00 0.00 1.00])
    4855                  (visible rect 0.00, 0.00 218.46 x 220.62)
     56                  (contentsScale 0.91)
    4957                )
    5058              )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/animated-expected.txt

    r155976 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 1
    1012        (GraphicsLayer
     
    1214          (bounds 502.00 202.00)
    1315          (visible rect 0.00, 0.00 502.00 x 202.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1720              (bounds 500.00 200.00)
    1821              (visible rect 0.00, 0.00 500.00 x 200.00)
     22              (contentsScale 1.00)
    1923              (children 1
    2024                (GraphicsLayer
     
    2327                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [-100.00 0.00 0.00 1.00])
    2428                  (visible rect 100.00, 0.00 100.00 x 200.00)
     29                  (contentsScale 1.00)
    2530                )
    2631              )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/animated-from-none-expected.txt

    r155976 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 1
    1012        (GraphicsLayer
     
    1214          (bounds 502.00 202.00)
    1315          (visible rect 0.00, 0.00 502.00 x 202.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1720              (bounds 500.00 200.00)
    1821              (visible rect 0.00, 0.00 500.00 x 200.00)
     22              (contentsScale 1.00)
    1923              (children 1
    2024                (GraphicsLayer
     
    2327                  (contentsOpaque 1)
    2428                  (visible rect 100.00, 0.00 100.00 x 200.00)
     29                  (contentsScale 1.00)
    2530                )
    2631              )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/clipped-by-viewport-expected.txt

    r155976 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 2
    1012        (GraphicsLayer
     
    1416          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    1517          (visible rect 100.00, 120.00 100.00 x 80.00)
     18          (contentsScale 1.00)
    1619        )
    1720        (GraphicsLayer
     
    2124          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    2225          (visible rect 100.00, 0.00 100.00 x 200.00)
     26          (contentsScale 1.00)
    2327        )
    2428      )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/clipped-visible-rect-expected.txt

    r155976 r155977  
    22  (bounds 800.00 600.00)
    33  (visible rect 0.00, 0.00 800.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 800.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 1
    1012        (GraphicsLayer
     
    1214          (bounds 502.00 202.00)
    1315          (visible rect 0.00, 0.00 502.00 x 202.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1720              (bounds 500.00 200.00)
    1821              (visible rect 0.00, 0.00 500.00 x 200.00)
     22              (contentsScale 1.00)
    1923              (children 3
    2024                (GraphicsLayer
     
    2428                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    2529                  (visible rect 100.00, 0.00 100.00 x 200.00)
     30                  (contentsScale 1.00)
    2631                )
    2732                (GraphicsLayer
     
    3136                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    3237                  (visible rect 0.00, 0.00 200.00 x 200.00)
     38                  (contentsScale 1.00)
    3339                )
    3440                (GraphicsLayer
     
    3844                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    3945                  (visible rect 0.00, 0.00 100.00 x 200.00)
     46                  (contentsScale 1.00)
    4047                )
    4148              )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/flipped-preserve-3d-expected.txt

    r155976 r155977  
    88  (bounds 785.00 615.00)
    99  (visible rect 0.00, 0.00 785.00 x 600.00)
     10  (contentsScale 1.00)
    1011  (children 1
    1112    (GraphicsLayer
     
    1314      (contentsOpaque 1)
    1415      (visible rect 0.00, 0.00 785.00 x 600.00)
     16      (contentsScale 1.00)
    1517      (children 1
    1618        (GraphicsLayer
     
    1921          (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 -0.00] [0.00 0.00 0.00 1.00])
    2022          (visible rect 0.00, 0.00 602.00 x 587.00)
     23          (contentsScale 1.00)
    2124          (children 1
    2225            (GraphicsLayer
     
    2730              (transform [-1.00 0.00 -0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 -1.00 0.00] [0.00 0.00 0.00 1.00])
    2831              (visible rect 0.00, 0.00 440.00 x 440.00)
     32              (contentsScale 1.00)
    2933              (children 1
    3034                (GraphicsLayer
     
    3337                  (transform [-1.00 0.00 -0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 -1.00 0.00] [0.00 0.00 0.00 1.00])
    3438                  (visible rect 0.00, 0.00 420.00 x 420.00)
     39                  (contentsScale 1.00)
    3540                  (children 1
    3641                    (GraphicsLayer
    3742                      (bounds 420.00 420.00)
    3843                      (visible rect 0.00, 0.00 420.00 x 420.00)
     44                      (contentsScale 1.00)
    3945                      (children 1
    4046                        (GraphicsLayer
     
    4349                          (contentsOpaque 1)
    4450                          (visible rect 0.00, 90.00 418.00 x 420.00)
     51                          (contentsScale 1.00)
    4552                          (children 1
    4653                            (GraphicsLayer
    4754                              (bounds 418.00 510.00)
    4855                              (visible rect 0.00, 90.00 418.00 x 420.00)
     56                              (contentsScale 1.00)
    4957                              (children 3
    5058                                (GraphicsLayer
     
    5563                                  (drawsContent 1)
    5664                                  (visible rect 3000.00, 90.00 418.00 x 30.00)
     65                                  (contentsScale 1.00)
    5766                                )
    5867                                (GraphicsLayer
     
    6372                                  (drawsContent 1)
    6473                                  (visible rect 3000.00, 0.00 418.00 x 120.00)
     74                                  (contentsScale 1.00)
    6575                                )
    6676                                (GraphicsLayer
     
    7181                                  (drawsContent 1)
    7282                                  (visible rect 3000.00, 0.00 418.00 x 120.00)
     83                                  (contentsScale 1.00)
    7384                                )
    7485                              )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt

    r155976 r155977  
    33  (bounds 1508.00 1516.00)
    44  (visible rect 0.00, 0.00 785.00 x 585.00)
     5  (contentsScale 1.00)
    56  (children 1
    67    (GraphicsLayer
     
    89      (contentsOpaque 1)
    910      (visible rect 0.00, 0.00 785.00 x 585.00)
     11      (contentsScale 1.00)
    1012      (children 2
    1113        (GraphicsLayer
     
    1416          (drawsContent 1)
    1517          (visible rect 0.00, 0.00 360.00 x 210.00)
     18          (contentsScale 1.00)
    1619          (children 1
    1720            (GraphicsLayer
    1821              (position 30.00 30.00)
    1922              (visible rect 0.00, 0.00 0.00 x 0.00)
     23              (contentsScale 1.00)
    2024              (children 1
    2125                (GraphicsLayer
    2226                  (bounds 285.00 135.00)
    2327                  (visible rect 0.00, 0.00 285.00 x 135.00)
     28                  (contentsScale 1.00)
    2429                  (children 1
    2530                    (GraphicsLayer
    2631                      (visible rect 0.00, 0.00 0.00 x 0.00)
     32                      (contentsScale 1.00)
    2733                      (children 1
    2834                        (GraphicsLayer
    2935                          (bounds 1508.00 1516.00)
    3036                          (visible rect 0.00, 0.00 285.00 x 135.00)
     37                          (contentsScale 1.00)
    3138                          (children 1
    3239                            (GraphicsLayer
     
    3441                              (drawsContent 1)
    3542                              (visible rect 0.00, 0.00 285.00 x 135.00)
     43                              (contentsScale 1.00)
    3644                              (children 1
    3745                                (GraphicsLayer
     
    4250                                  (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    4351                                  (visible rect 0.00, 0.00 100.00 x 127.00)
     52                                  (contentsScale 1.00)
    4453                                )
    4554                              )
     
    6170          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    6271          (visible rect 0.00, 0.00 200.00 x 200.00)
     72          (contentsScale 1.00)
    6373        )
    6474      )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/iframe-no-layers-expected.txt

    r146531 r155977  
    33  (bounds 1508.00 1516.00)
    44  (visible rect 0.00, 0.00 285.00 x 135.00)
     5  (contentsScale 1.00)
    56  (children 1
    67    (GraphicsLayer
    78      (bounds 1508.00 1516.00)
    89      (visible rect 0.00, 0.00 285.00 x 135.00)
     10      (contentsScale 1.00)
    911      (children 1
    1012        (GraphicsLayer
     
    1517          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    1618          (visible rect 0.00, 0.00 100.00 x 127.00)
     19          (contentsScale 1.00)
    1720        )
    1821      )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/nested-transform-expected.txt

    r155976 r155977  
    22  (bounds 785.00 669.00)
    33  (visible rect 0.00, 0.00 785.00 x 600.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 0.00, 0.00 785.00 x 600.00)
     10      (contentsScale 1.00)
    911      (children 2
    1012        (GraphicsLayer
     
    1214          (bounds 304.00 304.00)
    1315          (visible rect 0.00, 0.00 304.00 x 304.00)
     16          (contentsScale 1.00)
    1417          (children 1
    1518            (GraphicsLayer
     
    1821              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.26 0.26 1.00 -0.00] [0.00 0.00 0.00 1.00])
    1922              (visible rect 0.00, 0.00 300.00 x 300.00)
     23              (contentsScale 1.00)
    2024              (children 1
    2125                (GraphicsLayer
     
    2428                  (transform [0.94 0.00 -0.34 0.00] [0.00 1.00 0.00 0.00] [0.34 0.00 0.94 0.00] [0.00 0.00 0.00 1.00])
    2529                  (visible rect 0.00, 0.00 0.00 x 0.00)
     30                  (contentsScale 1.21)
    2631                  (children 1
    2732                    (GraphicsLayer
     
    3035                      (transform [0.94 0.00 -0.34 0.00] [0.00 1.00 0.00 0.00] [0.34 0.00 0.94 0.00] [0.00 0.00 0.00 1.00])
    3136                      (visible rect 0.00, 0.00 0.00 x 0.00)
     37                      (contentsScale 1.44)
    3238                      (children 1
    3339                        (GraphicsLayer
     
    3642                          (transform [1.00 0.00 0.00 0.00] [0.00 0.82 0.57 0.00] [0.00 -0.57 0.82 0.00] [0.00 0.00 0.00 1.00])
    3743                          (visible rect 0.00, 0.00 500.00 x 369.91)
     44                          (contentsScale 1.05)
    3845                        )
    3946                      )
     
    4956          (bounds 304.00 304.00)
    5057          (visible rect 0.00, 0.00 304.00 x 276.00)
     58          (contentsScale 1.00)
    5159          (children 1
    5260            (GraphicsLayer
     
    5563              (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.26 0.26 1.00 -0.00] [0.00 0.00 0.00 1.00])
    5664              (visible rect 0.00, 0.00 300.00 x 274.00)
     65              (contentsScale 1.00)
    5766              (children 1
    5867                (GraphicsLayer
     
    6069                  (preserves3D 1)
    6170                  (visible rect 0.00, 0.00 0.00 x 0.00)
     71                  (contentsScale 1.00)
    6272                  (children 1
    6373                    (GraphicsLayer
     
    6676                      (transform [0.77 0.00 -0.64 0.00] [0.00 1.00 0.00 0.00] [0.64 0.00 0.77 0.00] [0.00 0.00 0.00 1.00])
    6777                      (visible rect 0.00, 0.00 0.00 x 0.00)
     78                      (contentsScale 1.64)
    6879                      (children 1
    6980                        (GraphicsLayer
     
    7283                          (transform [1.00 0.00 0.00 0.00] [0.00 0.82 0.57 0.00] [0.00 -0.57 0.82 0.00] [0.00 0.00 0.00 1.00])
    7384                          (visible rect 0.00, 0.00 500.00 x 351.87)
     85                          (contentsScale 1.20)
    7486                        )
    7587                      )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/scrolled-expected.txt

    r155976 r155977  
    22  (bounds 1508.00 2008.00)
    33  (visible rect 25.00, 200.00 785.00 x 585.00)
     4  (contentsScale 1.00)
    45  (children 1
    56    (GraphicsLayer
     
    78      (contentsOpaque 1)
    89      (visible rect 25.00, 200.00 785.00 x 585.00)
     10      (contentsScale 1.00)
    911      (children 1
    1012        (GraphicsLayer
     
    1416          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
    1517          (visible rect 17.00, 200.00 183.00 x 300.00)
     18          (contentsScale 1.00)
    1619        )
    1720      )
  • trunk/Source/WebCore/ChangeLog

    r155976 r155977  
     12013-09-16  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Hardware accelerated CSS transitions appear pixelated when scaled up using transform
     4        https://bugs.webkit.org/show_bug.cgi?id=27684
     5        <rdar://problem/6134606>
     6
     7        Reviewed by Dean Jackson.
     8       
     9        Take transforms and animations into account when computing the contentsScale
     10        for a layer, so that scaled-up layers remain sharp most of the time.
     11       
     12        In its recursiveCommitChanges() tree walk, GraphicsLayerCA now tracks
     13        a root-relative transform, and extracts from that transform the X and Y
     14        scales which it uses to scale the backing store.
     15       
     16        If the layer has transform animations on it, we keep around
     17        a transformation matrix for the animation endpoints (or keyframes),
     18        pick up the state that has the larger impact on the root-relative scale,
     19        and use that as the layer's transform, and the transform when recursing
     20        over descendants.
     21
     22        Tests: compositing/contents-scale/animating.html
     23               compositing/contents-scale/scaled-ancestor.html
     24               compositing/contents-scale/simple-scale.html
     25               compositing/contents-scale/z-translate.html
     26
     27        * platform/graphics/ca/GraphicsLayerCA.cpp:
     28        (WebCore::maxScaleFromTransform): Decompose the transform if necesssary
     29        to extract the X and Y scale components.
     30        (WebCore::GraphicsLayerCA::GraphicsLayerCA): Initialize m_rootRelativeScaleFactor.
     31        (WebCore::GraphicsLayerCA::flushCompositingState): Supply a TransformationMatrix
     32        for the root of the recursion.
     33        (WebCore::GraphicsLayerCA::layerTransform): This code was factored out of
     34        computeVisibleRect(), and optionally takes a custom transform.
     35        (WebCore::GraphicsLayerCA::computeVisibleRect): Use the layerTransform() function.
     36        (WebCore::GraphicsLayerCA::updateRootRelativeScale): Given a transform from the root,
     37        find the max scale factor by multiplying the various animation endpoint matrices and picking
     38        the one with the biggest impact on scale. Use this to set m_rootRelativeScaleFactor, and
     39        set the flag to say that we need to update contentsScale.
     40        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
     41        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): After updating
     42        animations, call updateRootRelativeScale() to update m_rootRelativeScaleFactor.
     43        (WebCore::GraphicsLayerCA::updateAnimations): We have a side table of animation name to
     44        TransformationMatrix, so figure out which entries can be removed from that side table,
     45        and remove them.
     46        (WebCore::GraphicsLayerCA::setAnimationOnLayer):
     47        (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Store the matrices for
     48        animation endpoints/keyframes in the m_animationTransforms side table. We don't store
     49        them directly in LayerPropertyAnimation because we just want the final matrix for
     50        a transform list, and using a side table makes ownership easier to manage.
     51        (WebCore::GraphicsLayerCA::getTransformFromAnimationsWithMaxScaleImpact):
     52        goes through the matrices for the running animation endpoints/keyframes, and
     53        multiplies each with the transform up to this layer to find the matrix with the
     54        larger impact on scale.
     55        (WebCore::GraphicsLayerCA::setTransformAnimationEndpoints): Returns a vector
     56        of TransformationMatrix for the from and to states.
     57        (WebCore::GraphicsLayerCA::setTransformAnimationKeyframes): Returns a vector
     58        of TransformationMatrix for the keyframes.
     59        (WebCore::GraphicsLayerCA::updateContentsScale): Include m_rootRelativeScaleFactor in the
     60        scale factor computation.
     61        (WebCore::GraphicsLayerCA::dumpAdditionalProperties): If we're dumping visible rects,
     62        also dump the contentsScale. Convenient at these are useful to look at together, and I didn't
     63        want to pollute Internals with yet more flags.
     64        * platform/graphics/ca/GraphicsLayerCA.h:
     65        (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): Formatting.
     66
    1672013-09-17  Samuel White  <samuel_white@apple.com>
    268
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r154921 r155977  
    251251}
    252252
     253static float maxScaleFromTransform(const TransformationMatrix& t)
     254{
     255    if (t.isIdentityOrTranslation())
     256        return 1;
     257
     258    TransformationMatrix::DecomposedType decomposeData;
     259    t.decompose(decomposeData);
     260    return std::max(fabsf(decomposeData.scaleX), fabsf(decomposeData.scaleY));
     261}
     262
    253263#if ENABLE(CSS_FILTERS) || !ASSERT_DISABLED
    254264static inline bool supportsAcceleratedFilterAnimations()
     
    276286    , m_allowTiledLayer(true)
    277287    , m_isPageTiledBackingLayer(false)
     288    , m_rootRelativeScaleFactor(1)
    278289    , m_uncommittedChanges(0)
    279290{
     
    907918{
    908919    TransformState state(TransformState::UnapplyInverseTransformDirection, FloatQuad(clipRect));
    909     recursiveCommitChanges(CommitState(), state);
     920    TransformationMatrix rootRelativeTransform;
     921    recursiveCommitChanges(CommitState(), state, rootRelativeTransform);
    910922}
    911923
     
    975987}
    976988
    977 FloatRect GraphicsLayerCA::computeVisibleRect(TransformState& state, ComputeVisibleRectFlags flags) const
    978 {
    979     bool preserve3D = preserves3D() || (parent() ? parent()->preserves3D() : false);
    980     TransformState::TransformAccumulation accumulation = preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform;
    981 
    982     TransformationMatrix layerTransform;
    983     FloatPoint position = m_position;
    984     if (client())
    985         client()->customPositionForVisibleRectComputation(this, position);
    986 
    987     layerTransform.translate(position.x(), position.y());
    988 
    989     TransformationMatrix currentTransform;
    990     if (!(flags & RespectAnimatingTransforms) || !client() || !client()->getCurrentTransform(this, currentTransform))
    991         currentTransform = m_transform;
     989TransformationMatrix GraphicsLayerCA::layerTransform(const FloatPoint& position, const TransformationMatrix* customTransform) const
     990{
     991    TransformationMatrix transform;
     992    transform.translate(position.x(), position.y());
     993
     994    TransformationMatrix currentTransform = customTransform ? *customTransform : m_transform;
    992995   
    993996    if (!currentTransform.isIdentity()) {
    994997        FloatPoint3D absoluteAnchorPoint(anchorPoint());
    995998        absoluteAnchorPoint.scale(size().width(), size().height(), 1);
    996         layerTransform.translate3d(absoluteAnchorPoint.x(), absoluteAnchorPoint.y(), absoluteAnchorPoint.z());
    997         layerTransform.multiply(currentTransform);
    998         layerTransform.translate3d(-absoluteAnchorPoint.x(), -absoluteAnchorPoint.y(), -absoluteAnchorPoint.z());
     999        transform.translate3d(absoluteAnchorPoint.x(), absoluteAnchorPoint.y(), absoluteAnchorPoint.z());
     1000        transform.multiply(currentTransform);
     1001        transform.translate3d(-absoluteAnchorPoint.x(), -absoluteAnchorPoint.y(), -absoluteAnchorPoint.z());
    9991002    }
    10001003
     
    10041007            parentAnchorPoint.scale(parentLayer->size().width(), parentLayer->size().height(), 1);
    10051008
    1006             layerTransform.translateRight3d(-parentAnchorPoint.x(), -parentAnchorPoint.y(), -parentAnchorPoint.z());
    1007             layerTransform = parentLayer->childrenTransform() * layerTransform;
    1008             layerTransform.translateRight3d(parentAnchorPoint.x(), parentAnchorPoint.y(), parentAnchorPoint.z());
    1009         }
    1010     }
     1009            transform.translateRight3d(-parentAnchorPoint.x(), -parentAnchorPoint.y(), -parentAnchorPoint.z());
     1010            transform = parentLayer->childrenTransform() * transform;
     1011            transform.translateRight3d(parentAnchorPoint.x(), parentAnchorPoint.y(), parentAnchorPoint.z());
     1012        }
     1013    }
     1014   
     1015    return transform;
     1016}
     1017
     1018FloatRect GraphicsLayerCA::computeVisibleRect(TransformState& state, ComputeVisibleRectFlags flags) const
     1019{
     1020    bool preserve3D = preserves3D() || (parent() ? parent()->preserves3D() : false);
     1021    TransformState::TransformAccumulation accumulation = preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform;
     1022
     1023    FloatPoint position = m_position;
     1024    if (client())
     1025        client()->customPositionForVisibleRectComputation(this, position);
     1026
     1027    TransformationMatrix layerTransform;
     1028    TransformationMatrix currentTransform;
     1029    if ((flags & RespectAnimatingTransforms) && client() && client()->getCurrentTransform(this, currentTransform))
     1030        layerTransform = this->layerTransform(position, &currentTransform);
     1031    else
     1032        layerTransform = this->layerTransform(position);
    10111033
    10121034    bool applyWasClamped;
    10131035    state.applyTransform(layerTransform, accumulation, &applyWasClamped);
    1014    
     1036
    10151037    bool mapWasClamped;
    10161038    FloatRect clipRectForChildren = state.mappedQuad(&mapWasClamped).boundingBox();
     
    10311053}
    10321054
    1033 void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
     1055void GraphicsLayerCA::updateRootRelativeScale(TransformationMatrix* transformFromRoot)
     1056{
     1057    if (!transformFromRoot)
     1058        return;
     1059
     1060    float rootRelativeScaleFactor;
     1061    TransformationMatrix maxScaleImpactTransform;
     1062    bool haveTransformAnimation = getTransformFromAnimationsWithMaxScaleImpact(*transformFromRoot, maxScaleImpactTransform, rootRelativeScaleFactor);
     1063    if (haveTransformAnimation)
     1064        transformFromRoot->multiply(maxScaleImpactTransform);
     1065    else {
     1066        TransformationMatrix unanimatedTransform = this->layerTransform(m_position);
     1067        transformFromRoot->multiply(unanimatedTransform);
     1068        rootRelativeScaleFactor = maxScaleFromTransform(*transformFromRoot);
     1069    }
     1070   
     1071    if (rootRelativeScaleFactor != m_rootRelativeScaleFactor) {
     1072        m_rootRelativeScaleFactor = rootRelativeScaleFactor;
     1073        m_uncommittedChanges |= ContentsScaleChanged;
     1074    }
     1075}
     1076
     1077// rootRelativeTransformForScaling is a transform from the root, but for layers with transform animations, it cherry-picked the state of the
     1078// animation that contributes maximally to the scale (on every layer with animations down the hierarchy).
     1079void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, const TransformState& state, const TransformationMatrix& rootRelativeTransformForScaling, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
    10341080{
    10351081    TransformState localState = state;
     
    10771123        baseRelativePosition += m_position;
    10781124   
    1079     commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition, oldVisibleRect);
     1125    TransformationMatrix transformFromRoot = rootRelativeTransformForScaling;
     1126    commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition, oldVisibleRect, &transformFromRoot);
    10801127
    10811128    if (isRunningTransformAnimation()) {
     
    10941141    for (size_t i = 0; i < numChildren; ++i) {
    10951142        GraphicsLayerCA* curChild = static_cast<GraphicsLayerCA*>(childLayers[i]);
    1096         curChild->recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
     1143        curChild->recursiveCommitChanges(childCommitState, localState, transformFromRoot, pageScaleFactor, baseRelativePosition, affectedByPageScale);
    10971144    }
    10981145
    10991146    if (m_replicaLayer)
    1100         static_cast<GraphicsLayerCA*>(m_replicaLayer)->recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
     1147        static_cast<GraphicsLayerCA*>(m_replicaLayer)->recursiveCommitChanges(childCommitState, localState, transformFromRoot, pageScaleFactor, baseRelativePosition, affectedByPageScale);
    11011148
    11021149    if (m_maskLayer)
     
    11421189}
    11431190
    1144 void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState, float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect)
     1191void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState, float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect, TransformationMatrix* transformFromRoot)
    11451192{
    11461193    ++commitState.treeDepth;
     
    12151262    if (m_uncommittedChanges & AnimationChanged)
    12161263        updateAnimations();
     1264
     1265    // After committing animations, see if we need to adjust contentsScale accordingly.
     1266    updateRootRelativeScale(transformFromRoot);
    12171267
    12181268    // Updating the contents scale can cause parts of the layer to be invalidated,
     
    19261976void GraphicsLayerCA::updateAnimations()
    19271977{
     1978    HashSet<String> finishedAnimations;
     1979
    19281980    if (m_animationsToProcess.size()) {
    19291981        AnimationsToProcessMap::const_iterator end = m_animationsToProcess.end();
     
    19482000            }
    19492001
    1950             if (processingInfo.action == Remove)
     2002            if (processingInfo.action == Remove) {
    19512003                m_runningAnimations.remove(currAnimationName);
     2004                finishedAnimations.add(currAnimationName);
     2005            }
    19522006        }
    19532007   
     
    19662020                animations.append(pendingAnimation);
    19672021                m_runningAnimations.add(pendingAnimation.m_name, animations);
     2022
    19682023            } else {
    19692024                Vector<LayerPropertyAnimation>& animations = it->value;
    19702025                animations.append(pendingAnimation);
    19712026            }
    1972         }
    1973        
     2027
     2028            finishedAnimations.remove(pendingAnimation.m_name);
     2029        }
    19742030        m_uncomittedAnimations.clear();
    19752031    }
     2032   
     2033    HashSet<String>::const_iterator end = finishedAnimations.end();
     2034    for (HashSet<String>::const_iterator it = finishedAnimations.begin(); it != end; ++it)
     2035        m_animationTransforms.remove(*it);
    19762036}
    19772037
     
    19942054{
    19952055    PlatformCALayer* layer = animatedLayer(property);
    1996    
     2056
    19972057    if (timeOffset)
    19982058        caAnim->setBeginTime(CACurrentMediaTime() - timeOffset);
     
    21372197
    21382198    RefPtr<PlatformCAAnimation> caAnimation;
     2199    Vector<TransformationMatrix> matrices;
    21392200    bool validMatrices = true;
    21402201    if (isKeyframe) {
    21412202        caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), additive);
    2142         validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize);
     2203        validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize, matrices);
    21432204    } else {
    21442205        caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), additive);
    2145         validMatrices = setTransformAnimationEndpoints(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize);
     2206        validMatrices = setTransformAnimationEndpoints(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize, matrices);
    21462207    }
    21472208   
     
    21492210        return false;
    21502211
     2212    m_animationTransforms.set(animationName, matrices);
     2213
    21512214    m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation, animationName, valueList.property(), animationIndex, 0, timeOffset));
    21522215    return true;
     2216}
     2217
     2218bool GraphicsLayerCA::getTransformFromAnimationsWithMaxScaleImpact(const TransformationMatrix& parentTransformFromRoot, TransformationMatrix& maxScaleTransform, float& maxScale) const
     2219{
     2220    maxScale = 1;
     2221   
     2222    bool haveTransformAnimation = false;
     2223    AnimationsMap::const_iterator end = m_runningAnimations.end();
     2224    for (AnimationsMap::const_iterator it = m_runningAnimations.begin(); it != end; ++it) {
     2225        const Vector<LayerPropertyAnimation>& propertyAnimations = it->value;
     2226        size_t numAnimations = propertyAnimations.size();
     2227        for (size_t i = 0; i < numAnimations; ++i) {
     2228            const LayerPropertyAnimation& animation = propertyAnimations[i];
     2229            if (animation.m_property != AnimatedPropertyWebkitTransform)
     2230                continue;
     2231
     2232            haveTransformAnimation = true;
     2233
     2234            TransformsMap::const_iterator it = m_animationTransforms.find(animation.m_name);
     2235            if (it != m_animationTransforms.end()) {
     2236                const Vector<TransformationMatrix>& matrices = it->value;
     2237               
     2238                for (size_t i = 0; i < matrices.size(); ++i) {
     2239                    TransformationMatrix roootRelativeTransformWithAnimation = parentTransformFromRoot;
     2240                    TransformationMatrix layerTransformWithAnimation = layerTransform(m_position, &matrices[i]);
     2241
     2242                    roootRelativeTransformWithAnimation.multiply(layerTransformWithAnimation);
     2243                   
     2244                    float rootRelativeScale = maxScaleFromTransform(roootRelativeTransformWithAnimation);
     2245                    if (rootRelativeScale > maxScale) {
     2246                        maxScale = rootRelativeScale;
     2247                        maxScaleTransform = matrices[i];
     2248                    }
     2249                }
     2250            }
     2251        }
     2252    }
     2253   
     2254    return haveTransformAnimation;
    21532255}
    21542256
     
    23932495}
    23942496
    2395 bool GraphicsLayerCA::setTransformAnimationEndpoints(const KeyframeValueList& valueList, const Animation* animation, PlatformCAAnimation* basicAnim, int functionIndex, TransformOperation::OperationType transformOpType, bool isMatrixAnimation, const IntSize& boxSize)
     2497bool GraphicsLayerCA::setTransformAnimationEndpoints(const KeyframeValueList& valueList, const Animation* animation, PlatformCAAnimation* basicAnim, int functionIndex, TransformOperation::OperationType transformOpType, bool isMatrixAnimation, const IntSize& boxSize, Vector<TransformationMatrix>& matrixes)
    23962498{
    23972499    ASSERT(valueList.size() == 2);
     
    24042506    const TransformAnimationValue& startValue = static_cast<const TransformAnimationValue&>(valueList.at(fromIndex));
    24052507    const TransformAnimationValue& endValue = static_cast<const TransformAnimationValue&>(valueList.at(toIndex));
     2508
     2509    TransformationMatrix fromTransform, toTransform;
    24062510   
    24072511    if (isMatrixAnimation) {
    2408         TransformationMatrix fromTransform, toTransform;
    24092512        startValue.value().apply(boxSize, fromTransform);
    24102513        endValue.value().apply(boxSize, toTransform);
     
    24132516        if (!fromTransform.isInvertible() || !toTransform.isInvertible())
    24142517            return false;
    2415            
    2416         basicAnim->setFromValue(fromTransform);
    2417         basicAnim->setToValue(toTransform);
    24182518    } else {
    24192519        if (isTransformTypeNumber(transformOpType)) {
     
    24422542            basicAnim->setToValue(toValue);
    24432543        }
    2444     }
     2544
     2545        startValue.value().apply(boxSize, fromTransform);
     2546        endValue.value().apply(boxSize, toTransform);
     2547    }
     2548    matrixes.append(fromTransform);
     2549    matrixes.append(toTransform);
    24452550
    24462551    // This codepath is used for 2-keyframe animations, so we still need to look in the start
     
    24562561}
    24572562
    2458 bool GraphicsLayerCA::setTransformAnimationKeyframes(const KeyframeValueList& valueList, const Animation* animation, PlatformCAAnimation* keyframeAnim, int functionIndex, TransformOperation::OperationType transformOpType, bool isMatrixAnimation, const IntSize& boxSize)
     2563bool GraphicsLayerCA::setTransformAnimationKeyframes(const KeyframeValueList& valueList, const Animation* animation, PlatformCAAnimation* keyframeAnim, int functionIndex, TransformOperation::OperationType transformOpType, bool isMatrixAnimation, const IntSize& boxSize, Vector<TransformationMatrix>& matrixes)
    24592564{
    24602565    Vector<float> keyTimes;
     
    24712576        keyTimes.append(forwards ? curValue.keyTime() : (1 - curValue.keyTime()));
    24722577
     2578        TransformationMatrix transform;
     2579
    24732580        if (isMatrixAnimation) {
    2474             TransformationMatrix transform;
    24752581            curValue.value().apply(boxSize, transform);
    24762582
     
    24952601                transformationMatrixValues.append(value);
    24962602            }
    2497         }
     2603
     2604            curValue.value().apply(boxSize, transform);
     2605        }
     2606
     2607        matrixes.append(transform);
    24982608
    24992609        if (i < (valueList.size() - 1))
     
    26562766void GraphicsLayerCA::updateContentsScale(float pageScaleFactor)
    26572767{
    2658     float contentsScale = clampedContentsScaleForScale(pageScaleFactor * deviceScaleFactor());
    2659    
     2768    float contentsScale = clampedContentsScaleForScale(m_rootRelativeScaleFactor * pageScaleFactor * deviceScaleFactor());
    26602769    m_layer->setContentsScale(contentsScale);
    26612770    if (drawsContent())
     
    27052814        writeIndent(textStream, indent + 1);
    27062815        textStream << "(visible rect " << m_visibleRect.x() << ", " << m_visibleRect.y() << " " << m_visibleRect.width() << " x " << m_visibleRect.height() << ")\n";
     2816
     2817        writeIndent(textStream, indent + 1);
     2818        textStream << "(contentsScale " << m_layer->contentsScale() << ")\n";
    27072819    }
    27082820
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r154921 r155977  
    141141        { }
    142142    };
    143     void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
     143    void recursiveCommitChanges(const CommitState&, const TransformState&, const TransformationMatrix& rootRelativeTransformForScaling, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
    144144
    145145    virtual void flushCompositingState(const FloatRect&);
     
    214214    bool setAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformCAAnimation*);
    215215
    216     bool setTransformAnimationEndpoints(const KeyframeValueList&, const Animation*, PlatformCAAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize);
    217     bool setTransformAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformCAAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize);
     216    bool setTransformAnimationEndpoints(const KeyframeValueList&, const Animation*, PlatformCAAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize, Vector<TransformationMatrix>& matrixes);
     217    bool setTransformAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformCAAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const IntSize& boxSize, Vector<TransformationMatrix>& matrixes);
    218218   
    219219#if ENABLE(CSS_FILTERS)
     
    229229    }
    230230
    231     void commitLayerChangesBeforeSublayers(CommitState&, float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect);
     231    void commitLayerChangesBeforeSublayers(CommitState&, float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect, TransformationMatrix* transformFromRoot = 0);
    232232    void commitLayerChangesAfterSublayers(CommitState&);
    233233
     
    249249    void computePixelAlignment(float pixelAlignmentScale, const FloatPoint& positionRelativeToBase,
    250250        FloatPoint& position, FloatSize&, FloatPoint3D& anchorPoint, FloatSize& alignmentOffset) const;
     251
     252    TransformationMatrix layerTransform(const FloatPoint& position, const TransformationMatrix* customTransform = 0) const;
     253    void updateRootRelativeScale(TransformationMatrix* transformFromRoot);
     254
    251255    enum ComputeVisibleRectFlag { RespectAnimatingTransforms = 1 << 0 };
    252256    typedef unsigned ComputeVisibleRectFlags;
     
    374378    bool appendToUncommittedAnimations(const KeyframeValueList&, const FilterOperation*, const Animation*, const String& animationName, int animationIndex, double timeOffset);
    375379#endif
     380
     381    // Returns true if any transform animations are running.
     382    bool getTransformFromAnimationsWithMaxScaleImpact(const TransformationMatrix& parentTransformFromRoot, TransformationMatrix&, float& maxScale) const;
    376383   
    377384    enum LayerChange {
     
    443450    bool m_isPageTiledBackingLayer : 1;
    444451   
     452    float m_rootRelativeScaleFactor;
     453   
    445454    Color m_contentsSolidColor;
    446455
     
    452461    struct LayerPropertyAnimation {
    453462        LayerPropertyAnimation(PassRefPtr<PlatformCAAnimation> caAnimation, const String& animationName, AnimatedPropertyID property, int index, int subIndex, double timeOffset)
    454         : m_animation(caAnimation)
    455         , m_name(animationName)
    456         , m_property(property)
    457         , m_index(index)
    458         , m_subIndex(subIndex)
    459         , m_timeOffset(timeOffset)
     463            : m_animation(caAnimation)
     464            , m_name(animationName)
     465            , m_property(property)
     466            , m_index(index)
     467            , m_subIndex(subIndex)
     468            , m_timeOffset(timeOffset)
    460469        { }
    461470
     
    488497    AnimationsMap m_runningAnimations;
    489498
     499    // Map from animation key to TransformationMatrices for animations of transform. The vector contains a matrix for
     500    // the two endpoints, or each keyframe. Used for contentsScale adjustment.
     501    typedef HashMap<String, Vector<TransformationMatrix> > TransformsMap;
     502    TransformsMap m_animationTransforms;
     503
    490504    Vector<FloatRect> m_dirtyRects;
    491505    FloatSize m_pixelAlignmentOffset;
Note: See TracChangeset for help on using the changeset viewer.