Bug 93244 - [Cairo] canvas/philip/tests/2d.drawImage.self.2.html test failing on ports using Cairo
Summary: [Cairo] canvas/philip/tests/2d.drawImage.self.2.html test failing on ports us...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dominik Röttsches (drott)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-06 02:39 PDT by Sudarsana Nagineni (babu)
Modified: 2012-08-16 03:40 PDT (History)
9 users (show)

See Also:


Attachments
Copying buffer when src and dst are identical. (5.50 KB, patch)
2012-08-13 10:49 PDT, Dominik Röttsches (drott)
no flags Details | Formatted Diff | Diff
Copying buffer when src and dst are identical, v2. (5.54 KB, patch)
2012-08-13 11:11 PDT, Dominik Röttsches (drott)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sudarsana Nagineni (babu) 2012-08-06 02:39:16 PDT
canvas/philip/tests/2d.drawImage.self.2.html test failing on ports using Cairo. The failure looks like this:

--- WebKit/WebKitBuild/Release/layout-test-results/canvas/philip/tests/2d.drawImage.self.2-expected.txt
+++ WebKit/WebKitBuild/Release/layout-test-results/canvas/philip/tests/2d.drawImage.self.2-actual.txt
@@ -1 +1,2 @@
-Passed
+Failed assertion: got pixel [255,0,0,255] at (0,49), expected [0,255,0,255] +/- 2
+Failed assertion: got pixel [255,0,0,255] at (99,49), expected [0,255,0,255] +/- 2
Comment 1 Dominik Röttsches (drott) 2012-08-13 06:09:48 PDT
https://bugs.webkit.org/show_bug.cgi?id=54458#c7 has some insight:
# When drawing canvas into itself, WebCore draws canvas's buffer into the same buffer. This
# results in recursive drawing into cairo surface. We should either use groups when drawing
# with cairo or copy the buffer every time the HTMLCanvasElement gets repainted.
canvas/philip/tests/2d.drawImage.self.2.html
Comment 2 Dominik Röttsches (drott) 2012-08-13 10:49:51 PDT
Created attachment 158040 [details]
Copying buffer when src and dst are identical.
Comment 3 Kenneth Rohde Christiansen 2012-08-13 10:55:21 PDT
Comment on attachment 158040 [details]
Copying buffer when src and dst are identical.

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

> Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp:99
> +void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,

why not write it out destinationContext or just destination.
Comment 4 Dominik Röttsches (drott) 2012-08-13 11:11:14 PDT
Created attachment 158048 [details]
Copying buffer when src and dst are identical, v2.
Comment 5 Dominik Röttsches (drott) 2012-08-13 11:12:19 PDT
Thanks Kenneth, updated patch with review comment addressed.
Comment 6 WebKit Review Bot 2012-08-13 12:09:56 PDT
Comment on attachment 158048 [details]
Copying buffer when src and dst are identical, v2.

Clearing flags on attachment: 158048

Committed r125432: <http://trac.webkit.org/changeset/125432>
Comment 7 WebKit Review Bot 2012-08-13 12:10:02 PDT
All reviewed patches have been landed.  Closing bug.