Changeset 169229 in webkit


Ignore:
Timestamp:
May 22, 2014 4:57:46 PM (10 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r155977): Very stuttery 3D css animation on jtechcommunications.com
https://bugs.webkit.org/show_bug.cgi?id=133179
<rdar://problem/16864666>

Reviewed by Dean Jackson.

Source/WebCore:

Revert code added in r155977 to try to pick a good contentsScale for layers
based on a root-relative transform. This resulted in pages with too much
backing store, and too many cases where layers repainted during animations,
causing stutter.

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateContentsOpaque):
(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::setTransformAnimationEndpoints):
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
(WebCore::GraphicsLayerCA::updateContentsScale):
(WebCore::clampedContentsScaleForScale): Deleted.
(WebCore::maxScaleFromTransform): Deleted.
(WebCore::GraphicsLayerCA::updateRootRelativeScale): Deleted.
(WebCore::GraphicsLayerCA::getTransformFromAnimationsWithMaxScaleImpact): Deleted.

  • platform/graphics/ca/GraphicsLayerCA.h:

LayoutTests:

Rebaseline.

  • compositing/contents-scale/animating-expected.txt:
  • compositing/contents-scale/rounded-contents-scale-expected.txt:
  • compositing/contents-scale/scaled-ancestor-expected.txt:
  • compositing/contents-scale/simple-scale-expected.txt:
  • compositing/contents-scale/z-translate-expected.txt:
  • platform/mac/compositing/overflow/composited-scrolling-paint-phases-expected.txt:
  • platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
  • platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
  • platform/mac/compositing/visible-rect/nested-transform-expected.txt:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r169221 r169229  
     12014-05-22  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r155977): Very stuttery 3D css animation on jtechcommunications.com
     4        https://bugs.webkit.org/show_bug.cgi?id=133179
     5        <rdar://problem/16864666>
     6
     7        Reviewed by Dean Jackson.
     8       
     9        Rebaseline.
     10
     11        * compositing/contents-scale/animating-expected.txt:
     12        * compositing/contents-scale/rounded-contents-scale-expected.txt:
     13        * compositing/contents-scale/scaled-ancestor-expected.txt:
     14        * compositing/contents-scale/simple-scale-expected.txt:
     15        * compositing/contents-scale/z-translate-expected.txt:
     16        * platform/mac/compositing/overflow/composited-scrolling-paint-phases-expected.txt:
     17        * platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
     18        * platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
     19        * platform/mac/compositing/visible-rect/nested-transform-expected.txt:
     20
    1212014-05-22  Mark Lam  <mark.lam@apple.com>
    222
  • trunk/LayoutTests/compositing/contents-scale/animating-expected.txt

    r168244 r169229  
    2020          (transform [1.50 0.00 0.00 0.00] [0.00 1.50 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
    2121          (visible rect 0.00, 0.00 100.00 x 100.00)
    22           (contentsScale 3.00)
     22          (contentsScale 1.00)
    2323        )
    2424      )
  • trunk/LayoutTests/compositing/contents-scale/rounded-contents-scale-expected.txt

    r168244 r169229  
    2424              (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 -200.00 1.00])
    2525              (visible rect 0.00, 0.00 102.00 x 102.00)
    26               (contentsScale 0.75)
     26              (contentsScale 1.00)
    2727            )
    2828            (GraphicsLayer
     
    3333              (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 -100.00 1.00])
    3434              (visible rect 0.00, 0.00 102.00 x 102.00)
    35               (contentsScale 0.75)
     35              (contentsScale 1.00)
    3636            )
    3737            (GraphicsLayer
     
    5959              (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 100.00 1.00])
    6060              (visible rect 0.00, 0.00 102.00 x 102.00)
    61               (contentsScale 1.25)
     61              (contentsScale 1.00)
    6262            )
    6363            (GraphicsLayer
     
    6868              (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 150.00 1.00])
    6969              (visible rect 0.00, 0.00 102.00 x 4.40)
    70               (contentsScale 1.50)
     70              (contentsScale 1.00)
    7171            )
    7272          )
  • trunk/LayoutTests/compositing/contents-scale/scaled-ancestor-expected.txt

    r168244 r169229  
    1919          (transform [2.00 0.00 0.00 0.00] [0.00 2.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
    2020          (visible rect 0.00, 0.00 102.00 x 102.00)
    21           (contentsScale 2.00)
     21          (contentsScale 1.00)
    2222          (children 1
    2323            (GraphicsLayer
     
    2727              (drawsContent 1)
    2828              (visible rect 0.00, 0.00 100.00 x 100.00)
    29               (contentsScale 2.00)
     29              (contentsScale 1.00)
    3030            )
    3131          )
  • trunk/LayoutTests/compositing/contents-scale/simple-scale-expected.txt

    r168244 r169229  
    2020          (transform [2.00 0.00 0.00 0.00] [0.00 2.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
    2121          (visible rect 0.00, 0.00 100.00 x 100.00)
    22           (contentsScale 2.00)
     22          (contentsScale 1.00)
    2323        )
    2424      )
  • trunk/LayoutTests/compositing/contents-scale/z-translate-expected.txt

    r168244 r169229  
    2828              (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 100.00 1.00])
    2929              (visible rect 0.00, 0.00 100.00 x 100.00)
    30               (contentsScale 1.25)
     30              (contentsScale 1.00)
    3131              (children 1
    3232                (GraphicsLayer
     
    3838                  (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 100.00 1.00])
    3939                  (visible rect 0.00, 0.00 100.00 x 100.00)
    40                   (contentsScale 1.75)
     40                  (contentsScale 1.00)
    4141                )
    4242              )
  • trunk/LayoutTests/platform/mac/compositing/overflow/composited-scrolling-paint-phases-expected.txt

    r168244 r169229  
    2929            (GraphicsLayer
    3030              (position 1.00 1.00)
    31               (bounds 200.00 200.00)
     31              (bounds 185.00 185.00)
    3232              (paintingPhases
    3333                GraphicsLayerPaintBackground
  • trunk/LayoutTests/platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt

    r168244 r169229  
    3333                  (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])
    3434                  (visible rect 0.00, 0.00 2800.00 x 300.00)
    35                   (contentsScale 0.75)
     35                  (contentsScale 1.00)
    3636                  (tile cache coverage 0, 0 2800 x 300)
    3737                  (tile size 512 x 512)
    38                   (top left tile 0, 0 tiles grid 5 x 1)
     38                  (top left tile 0, 0 tiles grid 6 x 1)
    3939                )
    4040              )
  • trunk/LayoutTests/platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt

    r168244 r169229  
    3939                      (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])
    4040                      (visible rect 0.00, 0.00 2800.00 x 300.00)
    41                       (contentsScale 0.75)
     41                      (contentsScale 1.00)
    4242                      (tile cache coverage 0, 0 2800 x 300)
    4343                      (tile size 512 x 512)
    44                       (top left tile 0, 0 tiles grid 5 x 1)
     44                      (top left tile 0, 0 tiles grid 6 x 1)
    4545                    )
    4646                  )
  • trunk/LayoutTests/platform/mac/compositing/visible-rect/nested-transform-expected.txt

    r168244 r169229  
    2929                  (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])
    3030                  (visible rect 0.00, 0.00 0.00 x 0.00)
    31                   (contentsScale 1.25)
     31                  (contentsScale 1.00)
    3232                  (children 1
    3333                    (GraphicsLayer
     
    3636                      (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])
    3737                      (visible rect 0.00, 0.00 0.00 x 0.00)
    38                       (contentsScale 1.50)
     38                      (contentsScale 1.00)
    3939                      (children 1
    4040                        (GraphicsLayer
     
    7777                      (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])
    7878                      (visible rect 0.00, 0.00 0.00 x 0.00)
    79                       (contentsScale 1.75)
     79                      (contentsScale 1.00)
    8080                      (children 1
    8181                        (GraphicsLayer
     
    8484                          (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])
    8585                          (visible rect 0.00, 0.00 500.00 x 351.87)
    86                           (contentsScale 1.25)
     86                          (contentsScale 1.00)
    8787                        )
    8888                      )
  • trunk/Source/WebCore/ChangeLog

    r169223 r169229  
     12014-05-22  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r155977): Very stuttery 3D css animation on jtechcommunications.com
     4        https://bugs.webkit.org/show_bug.cgi?id=133179
     5        <rdar://problem/16864666>
     6
     7        Reviewed by Dean Jackson.
     8
     9        Revert code added in r155977 to try to pick a good contentsScale for layers
     10        based on a root-relative transform. This resulted in pages with too much
     11        backing store, and too many cases where layers repainted during animations,
     12        causing stutter.
     13
     14        * platform/graphics/ca/GraphicsLayerCA.cpp:
     15        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
     16        (WebCore::GraphicsLayerCA::flushCompositingState):
     17        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
     18        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
     19        (WebCore::GraphicsLayerCA::updateContentsOpaque):
     20        (WebCore::GraphicsLayerCA::updateAnimations):
     21        (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
     22        (WebCore::GraphicsLayerCA::setTransformAnimationEndpoints):
     23        (WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
     24        (WebCore::GraphicsLayerCA::updateContentsScale):
     25        (WebCore::clampedContentsScaleForScale): Deleted.
     26        (WebCore::maxScaleFromTransform): Deleted.
     27        (WebCore::GraphicsLayerCA::updateRootRelativeScale): Deleted.
     28        (WebCore::GraphicsLayerCA::getTransformFromAnimationsWithMaxScaleImpact): Deleted.
     29        * platform/graphics/ca/GraphicsLayerCA.h:
     30
    1312014-05-22  Martin Hock  <mhock@apple.com>
    232
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r169161 r169229  
    8686{
    8787    return static_cast<int>(value) == value;
    88 }
    89 
    90 static float clampedContentsScaleForScale(float rootRelativeScale, float fixedScale)
    91 {
    92     // To avoid too many repaints when the root-relative scale of layers changes, round
    93     // the scale to the nearest 0.25.
    94     const float roundingFactor = 4;
    95     float scale = roundf(rootRelativeScale * roundingFactor) / roundingFactor;
    96 
    97     scale *= fixedScale;
    98    
    99     // Define some reasonable limits.
    100     const float maxScale = 8;
    101     const float minScale = 0.01f;
    102 
    103     return std::max(minScale, std::min(scale, maxScale));
    10488}
    10589
     
    288272}
    289273
    290 static float maxScaleFromTransform(const TransformationMatrix& t)
    291 {
    292     if (t.isIdentityOrTranslation())
    293         return 1;
    294 
    295     TransformationMatrix::Decomposed4Type decomposeData;
    296     if (!t.decompose4(decomposeData))
    297         return 1;
    298 
    299     return std::max(fabsf(narrowPrecisionToFloat(decomposeData.scaleX)), fabsf(narrowPrecisionToFloat(decomposeData.scaleY)));
    300 }
    301 
    302274#if ENABLE(CSS_FILTERS) || !ASSERT_DISABLED
    303275static inline bool supportsAcceleratedFilterAnimations()
     
    367339    , m_contentsLayerPurpose(NoContentsLayer)
    368340    , m_isPageTiledBackingLayer(false)
    369     , m_rootRelativeScaleFactor(1)
    370341    , m_uncommittedChanges(0)
    371342    , m_isCommittingChanges(false)
     
    1025996{
    1026997    TransformState state(TransformState::UnapplyInverseTransformDirection, FloatQuad(clipRect));
    1027     TransformationMatrix rootRelativeTransform;
    1028     recursiveCommitChanges(CommitState(), state, rootRelativeTransform);
     998    recursiveCommitChanges(CommitState(), state);
    1029999}
    10301000
     
    11641134}
    11651135
    1166 void GraphicsLayerCA::updateRootRelativeScale(TransformationMatrix* transformFromRoot)
    1167 {
    1168     if (!transformFromRoot)
    1169         return;
    1170 
    1171     float rootRelativeScaleFactor;
    1172     TransformationMatrix maxScaleImpactTransform;
    1173     bool haveTransformAnimation = getTransformFromAnimationsWithMaxScaleImpact(*transformFromRoot, maxScaleImpactTransform, rootRelativeScaleFactor);
    1174     if (haveTransformAnimation)
    1175         transformFromRoot->multiply(maxScaleImpactTransform);
    1176     else if (!appliesPageScale()) {
    1177         TransformationMatrix unanimatedTransform = this->layerTransform(m_position);
    1178         transformFromRoot->multiply(unanimatedTransform);
    1179         rootRelativeScaleFactor = maxScaleFromTransform(*transformFromRoot);
    1180     }
    1181 
    1182     if (rootRelativeScaleFactor != m_rootRelativeScaleFactor) {
    1183         m_rootRelativeScaleFactor = rootRelativeScaleFactor;
    1184         m_uncommittedChanges |= ContentsScaleChanged | ContentsOpaqueChanged;
    1185     }
    1186 }
    1187 
    11881136// rootRelativeTransformForScaling is a transform from the root, but for layers with transform animations, it cherry-picked the state of the
    11891137// animation that contributes maximally to the scale (on every layer with animations down the hierarchy).
    1190 void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, const TransformState& state, const TransformationMatrix& rootRelativeTransformForScaling, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
     1138void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
    11911139{
    11921140    TransformState localState = state;
     
    12361184        baseRelativePosition += m_position;
    12371185   
    1238     TransformationMatrix transformFromRoot = rootRelativeTransformForScaling;
    12391186    {
    12401187        TemporaryChange<bool> committingChangesChange(m_isCommittingChanges, true);
    1241         commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition, oldVisibleRect, &transformFromRoot);
     1188        commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition, oldVisibleRect);
    12421189    }
    12431190
     
    12571204    for (size_t i = 0; i < numChildren; ++i) {
    12581205        GraphicsLayerCA* curChild = static_cast<GraphicsLayerCA*>(childLayers[i]);
    1259         curChild->recursiveCommitChanges(childCommitState, localState, transformFromRoot, pageScaleFactor, baseRelativePosition, affectedByPageScale);
     1206        curChild->recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
    12601207    }
    12611208
    12621209    if (m_replicaLayer)
    1263         static_cast<GraphicsLayerCA*>(m_replicaLayer)->recursiveCommitChanges(childCommitState, localState, transformFromRoot, pageScaleFactor, baseRelativePosition, affectedByPageScale);
     1210        static_cast<GraphicsLayerCA*>(m_replicaLayer)->recursiveCommitChanges(childCommitState, localState, pageScaleFactor, baseRelativePosition, affectedByPageScale);
    12641211
    12651212    if (m_maskLayer)
     
    13181265}
    13191266
    1320 void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState, float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect, TransformationMatrix* transformFromRoot)
     1267void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState, float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect)
    13211268{
    13221269    ++commitState.treeDepth;
     
    13281275        if (commitState.treeDepth > cMaxLayerTreeDepth)
    13291276            m_uncommittedChanges |= ChildrenChanged;
    1330 
    1331         updateRootRelativeScale(transformFromRoot);
    1332         return;
    13331277    }
    13341278
     
    13991343    if (m_uncommittedChanges & AnimationChanged)
    14001344        updateAnimations();
    1401 
    1402     // After committing animations, see if we need to adjust contentsScale accordingly.
    1403     updateRootRelativeScale(transformFromRoot);
    14041345
    14051346    // Updating the contents scale can cause parts of the layer to be invalidated,
     
    16601601    bool contentsOpaque = m_contentsOpaque;
    16611602    if (contentsOpaque) {
    1662         float contentsScale = clampedContentsScaleForScale(m_rootRelativeScaleFactor, pageScaleFactor * deviceScaleFactor());
     1603        float contentsScale = pageScaleFactor * deviceScaleFactor();
    16631604        if (!isIntegral(contentsScale) && !m_client.paintsOpaquelyAtNonIntegralScales(this))
    16641605            contentsOpaque = false;
     
    21612102void GraphicsLayerCA::updateAnimations()
    21622103{
    2163     HashSet<String> finishedAnimations;
    2164 
    21652104    if (m_animationsToProcess.size()) {
    21662105        AnimationsToProcessMap::const_iterator end = m_animationsToProcess.end();
     
    21852124            }
    21862125
    2187             if (processingInfo.action == Remove) {
     2126            if (processingInfo.action == Remove)
    21882127                m_runningAnimations.remove(currAnimationName);
    2189                 finishedAnimations.add(currAnimationName);
    2190             }
    21912128        }
    21922129   
     
    22102147                animations.append(pendingAnimation);
    22112148            }
    2212 
    2213             finishedAnimations.remove(pendingAnimation.m_name);
    22142149        }
    22152150        m_uncomittedAnimations.clear();
    22162151    }
    2217    
    2218     HashSet<String>::const_iterator end = finishedAnimations.end();
    2219     for (HashSet<String>::const_iterator it = finishedAnimations.begin(); it != end; ++it)
    2220         m_animationTransforms.remove(*it);
    22212152}
    22222153
     
    23822313
    23832314    RefPtr<PlatformCAAnimation> caAnimation;
    2384     Vector<TransformationMatrix> matrices;
    23852315    bool validMatrices = true;
    23862316    if (isKeyframe) {
    23872317        caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), additive);
    2388         validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize, matrices);
     2318        validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize);
    23892319    } else {
    23902320        caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), additive);
    2391         validMatrices = setTransformAnimationEndpoints(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize, matrices);
     2321        validMatrices = setTransformAnimationEndpoints(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize);
    23922322    }
    23932323   
     
    23952325        return false;
    23962326
    2397     m_animationTransforms.set(animationName, matrices);
    2398 
    23992327    m_uncomittedAnimations.append(LayerPropertyAnimation(caAnimation, animationName, valueList.property(), animationIndex, 0, timeOffset));
    24002328    return true;
    2401 }
    2402 
    2403 bool GraphicsLayerCA::getTransformFromAnimationsWithMaxScaleImpact(const TransformationMatrix& parentTransformFromRoot, TransformationMatrix& maxScaleTransform, float& maxScale) const
    2404 {
    2405     maxScale = 1;
    2406    
    2407     bool haveTransformAnimation = false;
    2408     AnimationsMap::const_iterator end = m_runningAnimations.end();
    2409     for (AnimationsMap::const_iterator it = m_runningAnimations.begin(); it != end; ++it) {
    2410         const Vector<LayerPropertyAnimation>& propertyAnimations = it->value;
    2411         size_t numAnimations = propertyAnimations.size();
    2412         for (size_t i = 0; i < numAnimations; ++i) {
    2413             const LayerPropertyAnimation& animation = propertyAnimations[i];
    2414             if (animation.m_property != AnimatedPropertyWebkitTransform)
    2415                 continue;
    2416 
    2417             haveTransformAnimation = true;
    2418 
    2419             TransformsMap::const_iterator it = m_animationTransforms.find(animation.m_name);
    2420             if (it != m_animationTransforms.end()) {
    2421                 const Vector<TransformationMatrix>& matrices = it->value;
    2422                
    2423                 for (size_t i = 0; i < matrices.size(); ++i) {
    2424                     TransformationMatrix rootRelativeTransformWithAnimation = parentTransformFromRoot;
    2425                     TransformationMatrix layerTransformWithAnimation = layerTransform(m_position, &matrices[i]);
    2426 
    2427                     rootRelativeTransformWithAnimation.multiply(layerTransformWithAnimation);
    2428                    
    2429                     float rootRelativeScale = maxScaleFromTransform(rootRelativeTransformWithAnimation);
    2430                     if (rootRelativeScale > maxScale) {
    2431                         maxScale = rootRelativeScale;
    2432                         maxScaleTransform = matrices[i];
    2433                     }
    2434                 }
    2435             }
    2436         }
    2437     }
    2438    
    2439     return haveTransformAnimation;
    24402329}
    24412330
     
    26762565}
    26772566
    2678 bool GraphicsLayerCA::setTransformAnimationEndpoints(const KeyframeValueList& valueList, const Animation* animation, PlatformCAAnimation* basicAnim, int functionIndex, TransformOperation::OperationType transformOpType, bool isMatrixAnimation, const FloatSize& boxSize, Vector<TransformationMatrix>& matrixes)
     2567bool GraphicsLayerCA::setTransformAnimationEndpoints(const KeyframeValueList& valueList, const Animation* animation, PlatformCAAnimation* basicAnim, int functionIndex, TransformOperation::OperationType transformOpType, bool isMatrixAnimation, const FloatSize& boxSize)
    26792568{
    26802569    ASSERT(valueList.size() == 2);
     
    26882577    const TransformAnimationValue& endValue = static_cast<const TransformAnimationValue&>(valueList.at(toIndex));
    26892578
    2690     TransformationMatrix fromTransform, toTransform;
    2691    
    26922579    if (isMatrixAnimation) {
     2580        TransformationMatrix fromTransform, toTransform;
    26932581        startValue.value().apply(boxSize, fromTransform);
    26942582        endValue.value().apply(boxSize, toTransform);
     
    27262614            basicAnim->setToValue(toValue);
    27272615        }
    2728 
    2729         startValue.value().apply(boxSize, fromTransform);
    2730         endValue.value().apply(boxSize, toTransform);
    2731     }
    2732     matrixes.append(fromTransform);
    2733     matrixes.append(toTransform);
     2616    }
    27342617
    27352618    // This codepath is used for 2-keyframe animations, so we still need to look in the start
     
    27452628}
    27462629
    2747 bool GraphicsLayerCA::setTransformAnimationKeyframes(const KeyframeValueList& valueList, const Animation* animation, PlatformCAAnimation* keyframeAnim, int functionIndex, TransformOperation::OperationType transformOpType, bool isMatrixAnimation, const FloatSize& boxSize, Vector<TransformationMatrix>& matrixes)
     2630bool GraphicsLayerCA::setTransformAnimationKeyframes(const KeyframeValueList& valueList, const Animation* animation, PlatformCAAnimation* keyframeAnim, int functionIndex, TransformOperation::OperationType transformOpType, bool isMatrixAnimation, const FloatSize& boxSize)
    27482631{
    27492632    Vector<float> keyTimes;
     
    27892672        }
    27902673
    2791         matrixes.append(transform);
    2792 
    27932674        if (i < (valueList.size() - 1))
    27942675            timingFunctions.append(timingFunctionForAnimationValue(forwards ? curValue : valueList.at(index - 1), *animation));
     
    29412822void GraphicsLayerCA::updateContentsScale(float pageScaleFactor)
    29422823{
    2943     float contentsScale = clampedContentsScaleForScale(m_rootRelativeScaleFactor, pageScaleFactor * deviceScaleFactor());
     2824    float contentsScale = pageScaleFactor * deviceScaleFactor();
    29442825
    29452826    if (m_isPageTiledBackingLayer && tiledBacking()) {
     
    29602841        return;
    29612842    }
     2843
    29622844    if (drawsContent())
    29632845        m_layer->setNeedsDisplay();
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r168559 r169229  
    157157        { }
    158158    };
    159     void recursiveCommitChanges(const CommitState&, const TransformState&, const TransformationMatrix& rootRelativeTransformForScaling, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
     159    void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
    160160
    161161    virtual void flushCompositingState(const FloatRect&) override;
     
    244244    bool setAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformCAAnimation*);
    245245
    246     bool setTransformAnimationEndpoints(const KeyframeValueList&, const Animation*, PlatformCAAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const FloatSize& boxSize, Vector<TransformationMatrix>& matrixes);
    247     bool setTransformAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformCAAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const FloatSize& boxSize, Vector<TransformationMatrix>& matrixes);
     246    bool setTransformAnimationEndpoints(const KeyframeValueList&, const Animation*, PlatformCAAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const FloatSize& boxSize);
     247    bool setTransformAnimationKeyframes(const KeyframeValueList&, const Animation*, PlatformCAAnimation*, int functionIndex, TransformOperation::OperationType, bool isMatrixAnimation, const FloatSize& boxSize);
    248248   
    249249#if ENABLE(CSS_FILTERS)
     
    259259    }
    260260
    261     void commitLayerChangesBeforeSublayers(CommitState&, float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect, TransformationMatrix* transformFromRoot = 0);
     261    void commitLayerChangesBeforeSublayers(CommitState&, float pageScaleFactor, const FloatPoint& positionRelativeToBase, const FloatRect& oldVisibleRect);
    262262    void commitLayerChangesAfterSublayers(CommitState&);
    263263
     
    268268
    269269    CompositingCoordinatesOrientation defaultContentsOrientation() const;
    270    
     270
    271271    void setupContentsLayer(PlatformCALayer*);
    272272    PlatformCALayer* contentsLayer() const { return m_contentsLayer.get(); }
     
    281281
    282282    TransformationMatrix layerTransform(const FloatPoint& position, const TransformationMatrix* customTransform = 0) const;
    283     void updateRootRelativeScale(TransformationMatrix* transformFromRoot);
    284283
    285284    enum ComputeVisibleRectFlag { RespectAnimatingTransforms = 1 << 0 };
     
    412411#endif
    413412
    414     // Returns true if any transform animations are running.
    415     bool getTransformFromAnimationsWithMaxScaleImpact(const TransformationMatrix& parentTransformFromRoot, TransformationMatrix&, float& maxScale) const;
    416    
    417413    enum LayerChange {
    418414        NoChange = 0,
     
    487483    bool m_isPageTiledBackingLayer : 1;
    488484   
    489     float m_rootRelativeScaleFactor;
    490    
    491485    Color m_contentsSolidColor;
    492486
     
    534528    AnimationsMap m_runningAnimations;
    535529
    536     // Map from animation key to TransformationMatrices for animations of transform. The vector contains a matrix for
    537     // the two endpoints, or each keyframe. Used for contentsScale adjustment.
    538     typedef HashMap<String, Vector<TransformationMatrix>> TransformsMap;
    539     TransformsMap m_animationTransforms;
    540 
    541530    Vector<FloatRect> m_dirtyRects;
    542531
Note: See TracChangeset for help on using the changeset viewer.