[Webkit-unassigned] [Bug 65767] New: toDataURL() uses stale data after putImageData()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 5 06:05:11 PDT 2011


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

           Summary: toDataURL() uses stale data after putImageData()
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.7
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Canvas
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: M8R-1o5lig at mailinator.com
                CC: mdelaney at apple.com


Created an attachment (id=103065)
 --> (https://bugs.webkit.org/attachment.cgi?id=103065&action=review)
Test case and workaround

toDataURL() appears to be using stale data if the canvas is updated using putImageData(). If the canvas is subsequently updated using ordinary drawing commands, a call to toDataURL() will work as expected.

To reproduce, open the attached sample code to generate an ordered list of:
1. The real canvas.
2. The toDataURL()-image for the uninitialized canvas.
3. The toDataURL()-image for the canvas after it is filled with red pixels using putImageData().
4. The toDataURL()-image for the canvas after a no-op drawing command.

Expected output (OK in Chromium 15.0.845.0 for Mac OS X 10.7.0):
1. A red square.
2. A blank square.
3. A red square.
4. A red square.

Output on Safari 5.1 (7534.48.3) and WebKit Nightly 5.1 (7534.48.3, r92445) for Mac OS X 10.7.0:
1. A red square.
2. A blank square.
3. A blank square (UNEXPECTED).
4. A red square.

By removing the moveTo(), lineTo(), stroke() lines, it can be verified that the canvas is indeed a red square already after putImageData().

Workaround:
As in the sample code, attempt to do some no-ops on the canvas: context.moveTo( 0, 0 ); context.lineTo( 0, 0 ); context.stroke();
(Beware of anti-aliasing ghosting!)

Observation:
If the size of the canvas is reduced (10x10 works) the problem goes away. Perhaps the issue is related to hardware acceleration?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list