Changeset 170862 in webkit


Ignore:
Timestamp:
Jul 7, 2014, 4:44:49 PM (12 years ago)
Author:
Simon Fraser
Message:

[UI-side compositing] Crash when starting a filter transition on a reflected layer
https://bugs.webkit.org/show_bug.cgi?id=134694

Reviewed by Tim Horton.

Source/WebCore:

Don't call the owner if we failed to find the animation key (which actually
isn't used by PlatformCALayerMac anyway).

  • platform/graphics/ca/mac/PlatformCALayerMac.mm:

(-[WebAnimationDelegate animationDidStart:]):

Source/WebKit2:

When cloned layers had animations, we would fire two animationDidStart callbacks,
but the second would pass an empty animationKey string to the web process, resulting
in a crash.

Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
since the clone would include addedAnimations, and then get the same animations
added on top by the caller.

Also protect against an empty animation key in the animationDidStart callback.

  • UIProcess/mac/RemoteLayerTreeHost.mm:

(WebKit::RemoteLayerTreeHost::animationDidStart):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:

(WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
them manually as PlatformCALayerMac does. Only copy the big things if they don't
have their default values.
(WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
for clone() to call.

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r170849 r170862  
     12014-07-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [UI-side compositing] Crash when starting a filter transition on a reflected layer
     4        https://bugs.webkit.org/show_bug.cgi?id=134694
     5
     6        Reviewed by Tim Horton.
     7
     8        Don't call the owner if we failed to find the animation key (which actually
     9        isn't used by PlatformCALayerMac anyway).
     10
     11        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
     12        (-[WebAnimationDelegate animationDidStart:]):
     13
    1142014-07-07  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm

    r170071 r170862  
    133133        }
    134134
    135         m_owner->animationStarted(animationKey, startTime);
     135        if (!animationKey.isEmpty())
     136            m_owner->animationStarted(animationKey, startTime);
    136137    }
    137138}
  • trunk/Source/WebKit2/ChangeLog

    r170859 r170862  
     12014-07-07  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [UI-side compositing] Crash when starting a filter transition on a reflected layer
     4        https://bugs.webkit.org/show_bug.cgi?id=134694
     5
     6        Reviewed by Tim Horton.
     7       
     8        When cloned layers had animations, we would fire two animationDidStart callbacks,
     9        but the second would pass an empty animationKey string to the web process, resulting
     10        in a crash.
     11       
     12        Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
     13        since the clone would include addedAnimations, and then get the same animations
     14        added on top by the caller.
     15       
     16        Also protect against an empty animation key in the animationDidStart callback.
     17
     18        * UIProcess/mac/RemoteLayerTreeHost.mm:
     19        (WebKit::RemoteLayerTreeHost::animationDidStart):
     20        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
     21        (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
     22        (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
     23        them manually as PlatformCALayerMac does. Only copy the big things if they don't
     24        have their default values.
     25        (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
     26        for clone() to call.
     27
    1282014-07-07  Tim Horton  <timothy_horton@apple.com>
    229
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm

    r170071 r170862  
    149149    }
    150150
    151     m_drawingArea.acceleratedAnimationDidStart(layerID, animationKey, startTime);
     151    if (!animationKey.isEmpty())
     152        m_drawingArea.acceleratedAnimationDidStart(layerID, animationKey, startTime);
    152153}
    153154
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

    r170656 r170862  
    9191PlatformCALayerRemote::PlatformCALayerRemote(const PlatformCALayerRemote& other, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
    9292    : PlatformCALayer(other.layerType(), owner)
    93     , m_properties(other.m_properties)
    9493    , m_superlayer(nullptr)
    9594    , m_maskLayer(nullptr)
     
    103102    RefPtr<PlatformCALayerRemote> clone = PlatformCALayerRemote::create(*this, client, *m_context);
    104103
    105     clone->m_properties.notePropertiesChanged(static_cast<RemoteLayerTreeTransaction::LayerChange>(m_properties.everChangedProperties & ~RemoteLayerTreeTransaction::BackingStoreChanged));
     104    clone->setPosition(position());
     105    clone->setBounds(bounds());
     106    clone->setAnchorPoint(anchorPoint());
     107
     108    if (m_properties.transform)
     109        clone->setTransform(*m_properties.transform);
     110
     111    if (m_properties.sublayerTransform)
     112        clone->setSublayerTransform(*m_properties.sublayerTransform);
     113
     114    clone->setContents(contents());
     115    clone->setMasksToBounds(masksToBounds());
     116    clone->setDoubleSided(isDoubleSided());
     117    clone->setOpaque(isOpaque());
     118    clone->setBackgroundColor(backgroundColor());
     119    clone->setContentsScale(contentsScale());
     120#if ENABLE(CSS_FILTERS)
     121    if (m_properties.filters)
     122        clone->copyFiltersFrom(this);
     123#endif
     124    clone->updateCustomAppearance(customAppearance());
    106125
    107126    clone->setClonedLayer(this);
     
    578597void PlatformCALayerRemote::copyFiltersFrom(const PlatformCALayer* sourceLayer)
    579598{
    580     ASSERT_NOT_REACHED();
     599    if (const FilterOperations* filters = toPlatformCALayerRemote(sourceLayer)->m_properties.filters.get())
     600        setFilters(*filters);
     601    else if (m_properties.filters)
     602        m_properties.filters = nullptr;
     603
     604    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::FiltersChanged);
    581605}
    582606
Note: See TracChangeset for help on using the changeset viewer.