Skip to content

Commit

Permalink
Rename RemoteLayerTreeTransaction::LayerProperties::keyPathsOfAnimati…
Browse files Browse the repository at this point in the history
…onsToRemove

https://bugs.webkit.org/show_bug.cgi?id=250642

Reviewed by Simon Fraser.

These aren't key paths in the sense a key path is provided to an API such as
`-[CAKeyframeAnimation animationWithKeyPath:]` but rather keys as used in
`-[CALayer addAnimation:forKey:]`.

* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::didCommit):
(WebKit::PlatformCALayerRemote::removeAnimationForKey):

Canonical link: https://commits.webkit.org/258937@main
  • Loading branch information
graouts committed Jan 15, 2023
1 parent 8562f15 commit 23ed9c1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Expand Up @@ -262,7 +262,7 @@ static void updateCustomAppearance(CALayer *layer, GraphicsLayer::CustomAppearan
PlatformCAFilters::setFiltersOnLayer(layer, properties.filters ? *properties.filters : FilterOperations());

if (properties.changedProperties & RemoteLayerTreeTransaction::AnimationsChanged)
PlatformCAAnimationRemote::updateLayerAnimations(layer, layerTreeHost, properties.addedAnimations, properties.keyPathsOfAnimationsToRemove);
PlatformCAAnimationRemote::updateLayerAnimations(layer, layerTreeHost, properties.addedAnimations, properties.keysOfAnimationsToRemove);

if (properties.changedProperties & RemoteLayerTreeTransaction::AntialiasesEdgesChanged)
layer.edgeAntialiasingMask = properties.antialiasesEdges ? (kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge) : 0;
Expand Down
Expand Up @@ -157,7 +157,7 @@ class RemoteLayerTreeTransaction {
Vector<WebCore::GraphicsLayer::PlatformLayerID> children;

Vector<std::pair<String, PlatformCAAnimationRemote::Properties>> addedAnimations;
HashSet<String> keyPathsOfAnimationsToRemove;
HashSet<String> keysOfAnimationsToRemove;

WebCore::FloatPoint3D position;
WebCore::FloatPoint3D anchorPoint { 0.5, 0.5, 0 };
Expand Down
Expand Up @@ -111,7 +111,7 @@
, name(other.name)
, children(other.children)
, addedAnimations(other.addedAnimations)
, keyPathsOfAnimationsToRemove(other.keyPathsOfAnimationsToRemove)
, keysOfAnimationsToRemove(other.keysOfAnimationsToRemove)
, position(other.position)
, anchorPoint(other.anchorPoint)
, bounds(other.bounds)
Expand Down Expand Up @@ -178,7 +178,7 @@

if (changedProperties & AnimationsChanged) {
encoder << addedAnimations;
encoder << keyPathsOfAnimationsToRemove;
encoder << keysOfAnimationsToRemove;
}

if (changedProperties & PositionChanged)
Expand Down Expand Up @@ -333,7 +333,7 @@
if (!decoder.decode(result.addedAnimations))
return false;

if (!decoder.decode(result.keyPathsOfAnimationsToRemove))
if (!decoder.decode(result.keysOfAnimationsToRemove))
return false;
}

Expand Down Expand Up @@ -957,7 +957,7 @@ static void dumpChangedLayers(TextStream& ts, const RemoteLayerTreeTransaction::
for (const auto& keyAnimationPair : layerProperties.addedAnimations)
ts.dumpProperty("animation " + keyAnimationPair.first, keyAnimationPair.second);

for (const auto& name : layerProperties.keyPathsOfAnimationsToRemove)
for (const auto& name : layerProperties.keysOfAnimationsToRemove)
ts.dumpProperty("removed animation", name);
}

Expand Down
Expand Up @@ -213,7 +213,7 @@ void PlatformCALayerRemote::recursiveBuildTransaction(RemoteLayerTreeContext& co
void PlatformCALayerRemote::didCommit()
{
m_properties.addedAnimations.clear();
m_properties.keyPathsOfAnimationsToRemove.clear();
m_properties.keysOfAnimationsToRemove.clear();
m_properties.resetChangedProperties();
}

Expand Down Expand Up @@ -420,7 +420,7 @@ void PlatformCALayerRemote::removeAnimationForKey(const String& key)
return pair.first == key;
});
}
m_properties.keyPathsOfAnimationsToRemove.add(key);
m_properties.keysOfAnimationsToRemove.add(key);
m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::AnimationsChanged);
}

Expand Down

0 comments on commit 23ed9c1

Please sign in to comment.