RESOLVED FIXED Bug 53757
[Chromium] Issue 58536: Fix Layout Test canvas/philip/tests/2d.imageData.put.alpha.html with --accelerated-2d-canvas.
https://bugs.webkit.org/show_bug.cgi?id=53757
Summary [Chromium] Issue 58536: Fix Layout Test canvas/philip/tests/2d.imageData.put....
Naoki Takano
Reported 2011-02-03 21:59:48 PST
[Chromium] Issue 58536: Fix Layout Test canvas/philip/tests/2d.imageData.put.alpha.html with --accelerated-2d-canvas.
Attachments
Patch (2.20 KB, patch)
2011-02-03 22:12 PST, Naoki Takano
no flags
Patch (2.32 KB, patch)
2011-02-07 21:14 PST, Naoki Takano
no flags
Patch (2.19 KB, patch)
2011-02-08 19:32 PST, Naoki Takano
no flags
Naoki Takano
Comment 1 2011-02-03 22:12:25 PST
Naoki Takano
Comment 2 2011-02-03 22:16:11 PST
Could you review my patch?
Adam Barth
Comment 3 2011-02-03 22:31:24 PST
This is a bit outside my area of expertise.
Naoki Takano
Comment 4 2011-02-03 23:13:36 PST
Do you know who is the right person? (In reply to comment #3) > This is a bit outside my area of expertise.
Adam Barth
Comment 5 2011-02-03 23:27:39 PST
You can try running "webkit-patch suggest-reviewers" on your patch to see which reviewers it suggests.
Adam Barth
Comment 6 2011-02-03 23:29:59 PST
abarth@quadzen:~/svn/webkit3$ ./Tools/Scripts/webkit-patch suggest-reviewers Dan Bernstein David Hyatt Dirk Schulze Nikolas Zimmermann Oliver Hunt Simon Fraser James Robinson
Naoki Takano
Comment 7 2011-02-04 00:09:19 PST
Added a couple of people whom Adam recommended. Could you review my patch?
Naoki Takano
Comment 8 2011-02-05 10:08:05 PST
Is there anybody who can review my patch?
Kenneth Russell
Comment 9 2011-02-07 13:31:52 PST
Comment on attachment 81189 [details] Patch I think this fix should go in ImageBufferSkia.cpp rather than in the common code. Conceptually, ImageBuffer::putUnmultipliedImageData is supposed to be unaffected by the CompositeOperator.
Naoki Takano
Comment 10 2011-02-07 14:40:11 PST
Thanks, Kenneth!! I also uploaded, https://bugs.webkit.org/show_bug.cgi?id=53857 If you have time, could you review it too? (In reply to comment #9) > (From update of attachment 81189 [details]) > I think this fix should go in ImageBufferSkia.cpp rather than in the common code. Conceptually, ImageBuffer::putUnmultipliedImageData is supposed to be unaffected by the CompositeOperator.
Kenneth Russell
Comment 11 2011-02-07 19:03:19 PST
(In reply to comment #10) > Thanks, Kenneth!! > > I also uploaded, > https://bugs.webkit.org/show_bug.cgi?id=53857 > > If you have time, could you review it too? Reviewed. Looking forward to revised versions of these two patches to be able to r+ them. Please be sure to set the cq bit to cq? if you want these landed via the commit queue.
Naoki Takano
Comment 12 2011-02-07 21:14:18 PST
Naoki Takano
Comment 13 2011-02-07 21:14:57 PST
Comment on attachment 81578 [details] Patch Ok, I move the logic to ImageBufferSkia.cpp. Please review.
James Robinson
Comment 14 2011-02-07 21:17:26 PST
Comment on attachment 81578 [details] Patch Why should changing the composite operator have any effect on how putImageData works? If putImageData() is wrong, fix that don't patch putUnmultipliedImageData.
Naoki Takano
Comment 15 2011-02-07 23:20:51 PST
As I wrote in the change log and the comment, syncing between software and hardware doesn't work well if the composite operator is wrong. As you know, if there is no hardware usage, it looks working fine. But logically putImageData() is wrong because of wrong operator inside. That is my intention for the first patch. What do you think, Kenneth? If my intention is right, as James suggested, should we use the first patch? (In reply to comment #14) > (From update of attachment 81578 [details]) > Why should changing the composite operator have any effect on how putImageData works? If putImageData() is wrong, fix that don't patch putUnmultipliedImageData.
Naoki Takano
Comment 16 2011-02-08 09:54:52 PST
After thinking again last night, I flip to the second patch. Because putUnmultipliedImageData() shouldn't change the result according to the operation as Kenneth says. As you see, putImageData<Unmultiplied>() always overwrite the whole pixels, so the function purpose is "overwriting the destination", it means setCompositeOperation(CompositeDestinationIn) in putUnmultipliedImageData(). What do you think, James? My and Kenneth's thoughts are wrong? Thanks, (In reply to comment #15) > As I wrote in the change log and the comment, syncing between software and hardware doesn't work well if the composite operator is wrong. > As you know, if there is no hardware usage, it looks working fine. But logically putImageData() is wrong because of wrong operator inside. That is my intention for the first patch. > > What do you think, Kenneth? > > If my intention is right, as James suggested, should we use the first patch? > > (In reply to comment #14) > > (From update of attachment 81578 [details] [details]) > > Why should changing the composite operator have any effect on how putImageData works? If putImageData() is wrong, fix that don't patch putUnmultipliedImageData.
Kenneth Russell
Comment 17 2011-02-08 10:57:04 PST
Looking at this more, I think the bug is that ImageBuffer::putUnmultipliedImageData() (ImageBufferSkia.cpp) is calling PlatformContextSkia::prepareForSoftwareDraw() where it should be calling syncSoftwareCanvas(). (See copyImage() higher in the file.) putPremultipliedImageData() looks like it has a similar bug.
Naoki Takano
Comment 18 2011-02-08 11:23:42 PST
Kenneth, You are right, I didn't notice the function, syncSoftwareCanvas();-( Ok, I will replace prepareForSoftwareDraw() to syncSoftwareCanvas() in both putPremultipliedImageda() and putUnmultipliedImageData(). (In reply to comment #17) > Looking at this more, I think the bug is that ImageBuffer::putUnmultipliedImageData() (ImageBufferSkia.cpp) is calling PlatformContextSkia::prepareForSoftwareDraw() where it should be calling syncSoftwareCanvas(). (See copyImage() higher in the file.) putPremultipliedImageData() looks like it has a similar bug.
Naoki Takano
Comment 19 2011-02-08 19:32:21 PST
Naoki Takano
Comment 20 2011-02-08 19:32:39 PST
Comment on attachment 81732 [details] Patch Please review again.
Kenneth Russell
Comment 21 2011-02-09 10:40:22 PST
Comment on attachment 81732 [details] Patch Looks good to me.
WebKit Commit Bot
Comment 22 2011-02-09 12:06:47 PST
Comment on attachment 81732 [details] Patch Clearing flags on attachment: 81732 Committed r78103: <http://trac.webkit.org/changeset/78103>
WebKit Commit Bot
Comment 23 2011-02-09 12:06:53 PST
All reviewed patches have been landed. Closing bug.
Stephen White
Comment 24 2011-02-10 07:43:00 PST
(In reply to comment #23) > All reviewed patches have been landed. Closing bug. Thanks very much for fixing this!
Note You need to log in before you can comment on or make changes to this bug.