[webkit-reviews] review granted: [Bug 194746] drawImage does not work correctly when source and destination have overlap : [Attachment 362445] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 19 17:31:52 PST 2019


Dean Jackson <dino at apple.com> has granted Said Abou-Hallawa
<sabouhallawa at apple.com>'s request for review:
Bug 194746: drawImage does not work correctly when source and destination have
overlap
https://bugs.webkit.org/show_bug.cgi?id=194746

Attachment 362445: Patch

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




--- Comment #9 from Dean Jackson <dino at apple.com> ---
Comment on attachment 362445
  --> https://bugs.webkit.org/attachment.cgi?id=362445
Patch

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

> Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:1602
> +std::unique_ptr<ImageBuffer>
CanvasRenderingContext2DBase::drawCanvasToBuffer(const FloatRect& srcRect)
const

I wonder if this should be called copyCanvasRegionToBuffer?

> Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:1611
> +    auto& canvas = downcast<HTMLCanvasElement>(canvasBase());
> +    ImageBuffer* srcBuffer = canvas.buffer();
> +    if (!srcBuffer)
> +	   return nullptr;

This can go first in the function to skip creating the dstBuffer if it fails.


More information about the webkit-reviews mailing list