Bug 119992

Summary: [Cairo] Canvas putImageData is not working as expected
Product: WebKit Reporter: Hurnjoo Lee <hurnjoo.lee>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, darin, d-r, gyuyoung.kim, mrobinson, rakuco
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
fixed patch
none
Fixed patch v2
none
fixed patch v3
darin: review+
patch for landing none

Description Hurnjoo Lee 2013-08-18 21:24:57 PDT
ImageBufferCairo::putImageArray didn't perform pre-multiply in case of zero alpha value.
If the alpha value is not 255, image data should always be pre-multiplied.
Comment 1 Hurnjoo Lee 2013-08-18 21:26:52 PDT
Created attachment 209049 [details]
patch
Comment 2 WebKit Commit Bot 2013-08-18 21:28:06 PDT
Attachment 209049 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast/canvas/canvas-putImageData-zero-alpha-expected.txt', u'LayoutTests/fast/canvas/canvas-putImageData-zero-alpha.html', u'LayoutTests/platform/efl/fast/canvas/canvas-putImageData-zero-alpha-expected.png', u'LayoutTests/platform/gtk/fast/canvas/canvas-putImageData-zero-alpha-expected.png', u'Source/WebCore/ChangeLog', u'Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp']" exit_code: 1
LayoutTests/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Source/WebCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 2 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Hurnjoo Lee 2013-08-18 21:32:44 PDT
Created attachment 209050 [details]
fixed patch
Comment 4 Hurnjoo Lee 2013-08-18 21:38:17 PDT
I'm sorry, there was some mistake.
I will upload patch again.
Comment 5 Hurnjoo Lee 2013-08-18 22:38:05 PDT
Created attachment 209055 [details]
Fixed patch v2
Comment 6 Chris Dumez 2013-08-18 23:09:48 PDT
Comment on attachment 209055 [details]
Fixed patch v2

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

> LayoutTests/fast/canvas/canvas-putImageData-zero-alpha.html:6
> +    background-color:blue;

Can this be a ref test instead?

> LayoutTests/fast/canvas/canvas-putImageData-zero-alpha.html:33
> +      if (window.testRunner) {

No need for curly brackets here.
Comment 7 Hurnjoo Lee 2013-08-18 23:43:56 PDT
Created attachment 209060 [details]
fixed patch v3
Comment 8 Hurnjoo Lee 2013-08-18 23:49:14 PDT
(In reply to comment #6)

Thanks for the review.

> (From update of attachment 209055 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=209055&action=review
> 
> > LayoutTests/fast/canvas/canvas-putImageData-zero-alpha.html:6
> > +    background-color:blue;
> 
> Can this be a ref test instead?

Done. I added the ref test.

> 
> > LayoutTests/fast/canvas/canvas-putImageData-zero-alpha.html:33
> > +      if (window.testRunner) {
> 
> No need for curly brackets here.

Done.
Comment 9 Martin Robinson 2013-08-19 06:47:41 PDT
(In reply to comment #8)
> (In reply to comment #6)
> 
> Thanks for the review.

Looks good to me, assuming this is how other ports work.
Comment 10 Hurnjoo Lee 2013-08-19 19:17:43 PDT
Created attachment 209148 [details]
patch for landing
Comment 11 WebKit Commit Bot 2013-08-19 23:47:38 PDT
Comment on attachment 209148 [details]
patch for landing

Clearing flags on attachment: 209148

Committed r154316: <http://trac.webkit.org/changeset/154316>
Comment 12 WebKit Commit Bot 2013-08-19 23:47:41 PDT
All reviewed patches have been landed.  Closing bug.