[Webkit-unassigned] [Bug 255208] New: CanvasRenderingContext2D drawImage doesn't work correctly with transform when copying from self

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 9 16:55:30 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=255208

            Bug ID: 255208
           Summary: CanvasRenderingContext2D drawImage doesn't work
                    correctly with transform when copying from self
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Canvas
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: gman at chromium.org
                CC: dino at apple.com

Created attachment 465824

  --> https://bugs.webkit.org/attachment.cgi?id=465824&action=review

repo of canvas drawImage issue

Here's an example where a canvas is 400x200

It sets the scale to 2x2  eg: ctx.scale(2,2)
It then copies the canvas to itself with

    ctx.drawImage(ctx.canvas
      2, 0, 398, 200,    // these values are in source pixels (ie, 400x200)
      0, 0, 199, 100);   // these values are in transformed pixels (ie, 200x100)

this works in Firefox and Chrome but fails in Safari

https://jsgist.org/?src=fedaf98f88bb57622af24481944bbefc

Attached a stand alone repo

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230409/dacde1bf/attachment-0001.htm>


More information about the webkit-unassigned mailing list