RESOLVED FIXED79566
Fixed a typo in CanvasRenderingContext2D::drawImage(HTMLCanvasElement); incorrect source and destination rect used
https://bugs.webkit.org/show_bug.cgi?id=79566
Summary Fixed a typo in CanvasRenderingContext2D::drawImage(HTMLCanvasElement); incor...
Dongseong Hwang
Reported 2012-02-25 01:11:52 PST
Fixed a type of Canvas drawImage(canvas). Exchanged dstRect and bufferSrcRect when calling fullCanvasCompositedDrawImage.
Attachments
patch (2.14 KB, patch)
2012-02-25 01:13 PST, Dongseong Hwang
no flags
patch v.2 (5.04 KB, patch)
2012-02-27 03:01 PST, Dongseong Hwang
dbates: review+
dbates: commit-queue-
patch v.3 (5.79 KB, patch)
2012-02-27 15:26 PST, Dongseong Hwang
dbates: review+
dbates: commit-queue-
patch v.4 (5.61 KB, patch)
2012-02-27 15:39 PST, Dongseong Hwang
no flags
Dongseong Hwang
Comment 1 2012-02-25 01:13:17 PST
Dongseong Hwang
Comment 2 2012-02-25 01:13:46 PST
It is from bug 71537.
Dongseong Hwang
Comment 3 2012-02-25 01:20:46 PST
This bug appear explicitly following test case. https://bug-66920-attachments.webkit.org/attachment.cgi?id=105127
Ben Wells
Comment 4 2012-02-26 16:00:52 PST
The test case referenced does look wrong, as does the code. The source-is-image and source-is-canvas cases should look the same. The fix looks right. (I'm not a reviewer so cannot r+). This makes me wonder what is special about the test I added originally to test this case. LayoutTests/fast/canvas/canvas-composite-image.html and canvas-composite-canvas.html are the tests for source-is-image and source-is-canvas respectively, and I think both produce the same / correct results.
Dongseong Hwang
Comment 5 2012-02-26 16:13:47 PST
The source-is-image and source-is-canvas cases of source-in, source-out, destination-in and destination-atop in the test case referenced are different. The source-is-canvas does not have offset, so is rendered on left-top without padding. I think the layout tests, LayoutTests/fast/canvas/canvas-composite-image.html and canvas-composite-canvas.html, do not reproduce this bug because those may not have offset for image that is rendered into canvas.
Ben Wells
Comment 6 2012-02-26 16:36:18 PST
(In reply to comment #5) > The source-is-image and source-is-canvas cases of source-in, source-out, destination-in and destination-atop in the test case referenced are different. > The source-is-canvas does not have offset, so is rendered on left-top without padding. Yes, agreed. And as mentioned your code looks like the correct fix. > > I think the layout tests, LayoutTests/fast/canvas/canvas-composite-image.html and canvas-composite-canvas.html, do not reproduce this bug because those may not have offset for image that is rendered into canvas. It would be good to update these tests to cover this case.
Dongseong Hwang
Comment 7 2012-02-26 16:38:13 PST
OK, I will update in this bug. :)
Dongseong Hwang
Comment 8 2012-02-27 03:01:50 PST
Created attachment 129002 [details] patch v.2
Dongseong Hwang
Comment 9 2012-02-27 03:02:05 PST
I amended canvas-composite-image and canvas-composite-canvas to cover this bug.
Kenneth Russell
Comment 10 2012-02-27 10:40:36 PST
senorblanco, is this something you could review?
Daniel Bates
Comment 11 2012-02-27 10:45:13 PST
Comment on attachment 129002 [details] patch v.2 View in context: https://bugs.webkit.org/attachment.cgi?id=129002&action=review This patch looks good to me, but we need a change log entry for the layout test changes. You may also want to add a remark in the layout test change log entry that this patch only affects the results of LayoutTests/fast/canvas/canvas-composite-canvas.html and that the changes made to canvas-composite-image.html are a side effect of the change made to LayoutTests/fast/canvas/resources/canvas-composite-image-common.js. > LayoutTests/ChangeLog:3 > + Fixed a typo of Canvas drawImage(canvas). Nit: I updated the title of this bug to elaborate on the typo. For consistency, we should update this line to match the updated bug title. The updated title is a bit verbose. Feel free to come up with an alternative bug title.
Daniel Bates
Comment 12 2012-02-27 10:47:46 PST
Comment on attachment 129002 [details] patch v.2 Disregard my remark about missing a change log entry for the layout tests. Before landing I suggest updating the bug title in the change log entries and adding the remark about the reason for updating fast/canvas/canvas-composite-image.html (see previous comment).
Dongseong Hwang
Comment 13 2012-02-27 15:26:25 PST
Created attachment 129112 [details] patch v.3
Dongseong Hwang
Comment 14 2012-02-27 15:27:30 PST
Thanks for good title. :)
Daniel Bates
Comment 15 2012-02-27 15:34:44 PST
Comment on attachment 129112 [details] patch v.3 View in context: https://bugs.webkit.org/attachment.cgi?id=129112&action=review > Source/WebCore/ChangeLog:11 > + I amended canvas-composite-canvas to cover this bug, and I also amended > + canvas-composite-image because I changed > + LayoutTests/fast/canvas/resources/canvas-composite-image-common.js. > + However, the change of canvas-composite-image is reasonable because > + drawImage(HTMLImageElement) will be able to have a similar bug. Did you mean to use the same description in the WebCore change log? I suggest writing something specific to the WebCore change in this change log entry, like: "Pass dstRect and bufferSrcRect to CanvasRenderingContext2D::fullCanvasCompositedDrawImage() for the destination and source rect, respectively."
Dongseong Hwang
Comment 16 2012-02-27 15:39:43 PST
Created attachment 129114 [details] patch v.4 I had misunderstanding that changelogs should be consistent.
Daniel Bates
Comment 17 2012-02-27 15:42:16 PST
Comment on attachment 129114 [details] patch v.4 Thanks Huang for the updated patch.
Dongseong Hwang
Comment 18 2012-02-27 17:48:45 PST
You're welcome. ;)
WebKit Review Bot
Comment 19 2012-02-27 19:09:58 PST
Comment on attachment 129114 [details] patch v.4 Clearing flags on attachment: 129114 Committed r109062: <http://trac.webkit.org/changeset/109062>
WebKit Review Bot
Comment 20 2012-02-27 19:10:03 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.