Changeset 168175 in webkit


Ignore:
Timestamp:
May 2, 2014 10:29:22 AM (10 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] Animations on vox.com look wrong
https://bugs.webkit.org/show_bug.cgi?id=132462
<rdar://problem/16731884>

Reviewed by Sam Weinig.

PlatformCALayerRemote was managing animations incorrectly; aninations
would stick around in m_properties.addedAnimations and get added a second
time by mistake.

Animations have to be managed a little differently to other properties,
since they are not steady-state things. A given commit has to send over
the added and removed animations, and then clear the layer properties.

Do this by adding PlatformCALayerRemote::didCommit(), which is called
after the layer properties have been encoded, and have it clear the lists
of added and removed animations.

removeAnimationForKey() also has to remove the animation from addedAnimations
so that an add/remove in the same commit doesn't send the animation to the
UI process.

  • WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:

(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
(WebKit::PlatformCALayerRemote::didCommit):
(WebKit::PlatformCALayerRemote::removeAnimationForKey):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.h:
  • WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:

(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r168174 r168175  
     12014-05-01  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Animations on vox.com look wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=132462
     5        <rdar://problem/16731884>
     6
     7        Reviewed by Sam Weinig.
     8       
     9        PlatformCALayerRemote was managing animations incorrectly; aninations
     10        would stick around in m_properties.addedAnimations and get added a second
     11        time by mistake.
     12       
     13        Animations have to be managed a little differently to other properties,
     14        since they are not steady-state things. A given commit has to send over
     15        the added and removed animations, and then clear the layer properties.
     16       
     17        Do this by adding PlatformCALayerRemote::didCommit(), which is called
     18        after the layer properties have been encoded, and have it clear the lists
     19        of added and removed animations.
     20       
     21        removeAnimationForKey() also has to remove the animation from addedAnimations
     22        so that an add/remove in the same commit doesn't send the animation to the
     23        UI process.
     24
     25        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
     26        (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
     27        (WebKit::PlatformCALayerRemote::didCommit):
     28        (WebKit::PlatformCALayerRemote::removeAnimationForKey):
     29        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
     30        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
     31        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
     32
    1332014-05-01  Simon Fraser  <simon.fraser@apple.com>
    234
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

    r167980 r168175  
    136136        if (m_layerType == LayerTypeCustom) {
    137137            RemoteLayerTreePropertyApplier::applyProperties(platformLayer(), nullptr, m_properties, RemoteLayerTreePropertyApplier::RelatedLayerMap());
    138             m_properties.resetChangedProperties();
     138            didCommit();
    139139            return;
    140140        }
     
    151151    if (m_maskLayer)
    152152        m_maskLayer->recursiveBuildTransaction(transaction);
     153}
     154
     155void PlatformCALayerRemote::didCommit()
     156{
     157    m_properties.addedAnimations.clear();
     158    m_properties.keyPathsOfAnimationsToRemove.clear();
     159    m_properties.resetChangedProperties();
    153160}
    154161
     
    298305void PlatformCALayerRemote::removeAnimationForKey(const String& key)
    299306{
    300     // FIXME: remove from m_properties.addedAnimations ?
     307    m_properties.addedAnimations.remove(key);
    301308    m_properties.keyPathsOfAnimationsToRemove.add(key);
    302309    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::AnimationsChanged);
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h

    r167553 r168175  
    158158    RemoteLayerTreeTransaction::LayerProperties& properties() { return m_properties; }
    159159
     160    void didCommit();
     161
    160162    void clearContext() { m_context = nullptr; }
    161163
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm

    r167792 r168175  
    279279        if (layer->properties().changedProperties & RemoteLayerTreeTransaction::LayerChanges::BackingStoreChanged)
    280280            hadAnyChangedBackingStore = true;
    281         layer->properties().resetChangedProperties();
     281        layer->didCommit();
    282282    }
    283283
Note: See TracChangeset for help on using the changeset viewer.