Bug 18821 - Canvas putImageData incorrect when data has alpha
Summary: Canvas putImageData incorrect when data has alpha
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows Vista
: P2 Normal
Assignee: Dave Hyatt
URL: http://philip.html5.org/tests/canvas/...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-30 18:31 PDT by Philip Taylor
Modified: 2008-05-05 11:29 PDT (History)
0 users

See Also:


Attachments
Fix bugs in the loops of both get and putImageData (3.82 KB, patch)
2008-05-01 11:50 PDT, Dave Hyatt
hyatt: review-
Details | Formatted Diff | Diff
Fix bugs in the loops of both get and putImageData (2.08 KB, patch)
2008-05-01 11:51 PDT, Dave Hyatt
eric: review+
Details | Formatted Diff | Diff
Patch to fix the bug (5.11 KB, patch)
2008-05-05 11:19 PDT, Dave Hyatt
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Taylor 2008-04-30 18:31:11 PDT
See test case in URL. It draws a very-transparent red column on the left, then fills the rest of the canvas with slightly-transparent green, then calls putImageData(getImageData(...), ...) which should have no effect.

Expected output: alert box saying "0,255,0,254" (or maybe 253), alert box saying "0,255,0,254" (or maybe 253), green canvas.

Actual output: alert box saying "0,255,0,253", alert box saying "255,0,0,253", red canvas.

Tested on Windows r32574.
Comment 1 Dave Hyatt 2008-05-01 11:50:41 PDT
Created attachment 20914 [details]
Fix bugs in the loops of both get and putImageData
Comment 2 Dave Hyatt 2008-05-01 11:51:57 PDT
Created attachment 20915 [details]
Fix bugs in the loops of both get and putImageData
Comment 3 Eric Seidel (no email) 2008-05-01 19:41:15 PDT
Comment on attachment 20915 [details]
Fix bugs in the loops of both get and putImageData

Needs a test case and changelog when you land.  Otherwise fine.
Comment 4 Dave Hyatt 2008-05-05 11:19:38 PDT
Created attachment 20971 [details]
Patch to fix the bug
Comment 5 Eric Seidel (no email) 2008-05-05 11:27:45 PDT
Comment on attachment 20971 [details]
Patch to fix the bug

Looks saner.  Still needs a ChangeLog when landing.
Comment 6 Dave Hyatt 2008-05-05 11:29:58 PDT
Fixed in r32878.