Skip to content

Commit

Permalink
[threaded-animation-resolution] avoid uploading a new effect stack to…
Browse files Browse the repository at this point in the history
… the UIProcess if it remains empty

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

Reviewed by Dean Jackson.

Fix the `GraphicsLayerCA::setAcceleratedEffectsAndBaseValues()` method to return early if the effect stack
remains empty in order to avoid a layer property change and a subsequent upload to the UIProcess.

* Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setAcceleratedEffectsAndBaseValues):

Canonical link: https://commits.webkit.org/274754@main
  • Loading branch information
graouts committed Feb 15, 2024
1 parent 637d39c commit 7d701b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5041,8 +5041,14 @@ RefPtr<GraphicsLayerAsyncContentsDisplayDelegate> GraphicsLayerCA::createAsyncCo
#if ENABLE(THREADED_ANIMATION_RESOLUTION)
void GraphicsLayerCA::setAcceleratedEffectsAndBaseValues(AcceleratedEffects&& effects, AcceleratedEffectValues&& baseValues)
{
auto hadEffectStack = !!acceleratedEffectStack();

GraphicsLayer::setAcceleratedEffectsAndBaseValues(WTFMove(effects), WTFMove(baseValues));

// Nothing to do if we didn't have an accelerated stack and we still don't.
if (!hadEffectStack && !acceleratedEffectStack())
return;

auto* layer = primaryLayer();
ASSERT(layer);

Expand Down

0 comments on commit 7d701b1

Please sign in to comment.