[webkit-reviews] review granted: [Bug 238851] Unify the two ImageBuffer::create() functions, passing RenderingPurpose everywhere : [Attachment 456768] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 5 17:24:56 PDT 2022


Said Abou-Hallawa <sabouhallawa at apple.com> has granted Simon Fraser (smfr)
<simon.fraser at apple.com>'s request for review:
Bug 238851: Unify the two ImageBuffer::create() functions, passing
RenderingPurpose everywhere
https://bugs.webkit.org/show_bug.cgi?id=238851

Attachment 456768: Patch

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




--- Comment #3 from Said Abou-Hallawa <sabouhallawa at apple.com> ---
Comment on attachment 456768
  --> https://bugs.webkit.org/attachment.cgi?id=456768
Patch

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

> Source/WebCore/platform/graphics/ImageBuffer.h:67
> +    WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&,
OptionSet<ImageBufferOptions>, RenderingPurpose, float resolutionScale, const
DestinationColorSpace&, PixelFormat, const CreationContext& = { });

I think ImageBufferOptions can be moved to the end just before CreationContext
and it can have a default value { }. So many callers do not have to pass { }
for it.

> Source/WebCore/platform/graphics/RenderingMode.h:47
> +enum class ImageBufferOptions : uint8_t {

Should this be moved to ImageBuffer.h since it is only used for ImageBuffer?

>
Source/WebCore/platform/graphics/filters/software/FETileSoftwareApplier.cpp:54
> +    OptionSet<ImageBufferOptions> bufferOptions;
> +    if (filter.renderingMode() == RenderingMode::Accelerated)
> +	   bufferOptions.add(ImageBufferOptions::Accelerated);

This code is repeated many times in the patch. Can't we add an inline function
in RenderingMode.h

inline OptionSet<ImageBufferOptions> bufferOptions(RenderingMode
renderringMode)
{

}

Or something else. And use this inline directly in the call to
ImageBuffer::create(tileRect.size(), bufferOptions(filter.renderingMode()),
...).


More information about the webkit-reviews mailing list