[webkit-reviews] review granted: [Bug 232411] [GPU Process] Pattern should hold SourceImage which can be converted to a NativeImage only when needed : [Attachment 449781] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 23 23:26:26 PST 2022


Darin Adler <darin at apple.com> has granted Said Abou-Hallawa
<sabouhallawa at apple.com>'s request for review:
Bug 232411: [GPU Process] Pattern should hold SourceImage which can be
converted to a NativeImage only when needed
https://bugs.webkit.org/show_bug.cgi?id=232411

Attachment 449781: Patch

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




--- Comment #14 from Darin Adler <darin at apple.com> ---
Comment on attachment 449781
  --> https://bugs.webkit.org/attachment.cgi?id=449781
Patch

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

> Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:1956
> +    return RefPtr<CanvasPattern> { CanvasPattern::create({
nativeImage.releaseNonNull() }, repeatX, repeatY, originClean) };

Since you are touching these source lines, it’s worth noting we can probably
change them to RefPtr instead of RefPtr<CanvasPattern> now.

> Source/WebCore/platform/graphics/Pattern.h:68
> +    SourceImage& tileImage() const { return m_tileImage; }

Can we change this to return a const reference? As far as I can tell, this is
only used for encoding, and so there's no need for this to return a non-const
reference, even though this still needs to be mutable in the class of rthe
benefit of the tileNativeImage() and tileImagebuffer() functions.


More information about the webkit-reviews mailing list