[webkit-reviews] review granted: [Bug 169988] [GTK][WPE] Support for backdrop-filter : [Attachment 405139] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 24 15:26:09 PDT 2020


Adrian Perez <aperez at igalia.com> has granted Carlos Garcia Campos
<cgarcia at igalia.com>'s request for review:
Bug 169988: [GTK][WPE] Support for backdrop-filter
https://bugs.webkit.org/show_bug.cgi?id=169988

Attachment 405139: Patch

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




--- Comment #5 from Adrian Perez <aperez at igalia.com> ---
Comment on attachment 405139
  --> https://bugs.webkit.org/attachment.cgi?id=405139
Patch

Wow, this is quite a neat patch overall, somehow before starting reading
it I thought it would end up being much more complicated ��️

I made just one comment below about the isFilterProperty lambda.

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

>
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cp
p:1358
> +    auto isFilterProperty = [&]() -> bool {

The lambda here only uses “valueList.property()” so I would only capture
that explicitly 

  auto isFilterProperty = [property = valueList.property()]() -> bool { /* ...
*/ };

Though, honestly I do not see the need to use a lambda here, as it is used
only once immediately and it calculates a simple value. Why not calculate
the value directly? One possible way:

      bool isFilterProperty;
      switch (valueList.property()) {
  #if ENABLE(FILTERS_LEVEL_2)
      case AnimatedPropertyWebkitBackdropFilter:
  #endif
      case AnimatedPropertyFilter:
	  isFilterProperty = true;
	  break;
      default:
	  isFilterProperty = false;
      }

      if (isFilterProperty) {
	  /* ... */
      }


More information about the webkit-reviews mailing list