[webkit-reviews] review granted: [Bug 184143] [CoordGraphics] Avoid painting backing stores for zero-opacity layers : [Attachment 418635] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 29 03:14:41 PST 2021


Carlos Garcia Campos <cgarcia at igalia.com> has granted Miguel Gomez
<magomez at igalia.com>'s request for review:
Bug 184143: [CoordGraphics] Avoid painting backing stores for zero-opacity
layers
https://bugs.webkit.org/show_bug.cgi?id=184143

Attachment 418635: Patch

https://bugs.webkit.org/attachment.cgi?id=418635&action=review




--- Comment #27 from Carlos Garcia Campos <cgarcia at igalia.com> ---
Comment on attachment 418635
  --> https://bugs.webkit.org/attachment.cgi?id=418635
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418635&action=review

>
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cp
p:1353
> +    // Optimize memory usage by not creating BackingStores for layers that
are invisible.
> +    bool isInvisibleBecauseOpacityZero = false;
> +
> +    // If the CSS opacity value is 0 and there's no animation over the
opacity property, the layer is invisible.
> +    isInvisibleBecauseOpacityZero = !opacity() &&
!m_animations.hasActiveAnimationsOfType(AnimatedPropertyOpacity);

I guess this could be merged.

>
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cp
p:1357
> +    for (auto& operation : filters().operations()) {

You could use Vector::findMatching().

>
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cp
p:1359
> +	       auto& o =
downcast<BasicComponentTransferFilterOperation>(*operation);

Don't use o for the name, use something like filterOperation, for example.

>
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cp
p:1360
> +	       if (o.amount() == 0.0) {

Don't compare to 0 use ! instead


More information about the webkit-reviews mailing list