Title: [125432] trunk
Revision
125432
Author
[email protected]
Date
2012-08-13 12:09:41 -0700 (Mon, 13 Aug 2012)

Log Message

[Cairo] canvas/philip/tests/2d.drawImage.self.2.html test failing on ports using Cairo
https://bugs.webkit.org/show_bug.cgi?id=93244

Patch by Dominik Röttsches <[email protected]> on 2012-08-13
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Similar to Skia's and Qt's ImageBuffer implementation we need to make sure that buffers
for images are copied when the destination canvas is identical to the
image buffer's context. This happens mostly in JS calls to canvas' drawImage method.
For now fixing the drawImage case, drawPattern case is handled in bug 93854.

No new tests, covered by canvas/philip/tests/2d.drawImage.self.2.html

* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::draw): Making sure buffer is copied when source and destination contexts are identical.

LayoutTests:

Unskipping canvas/philip/tests/2d.drawImage.self.2.html for GTK and EFL now that it's working.

* platform/efl/Skipped:
* platform/gtk/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (125431 => 125432)


--- trunk/LayoutTests/ChangeLog	2012-08-13 19:07:15 UTC (rev 125431)
+++ trunk/LayoutTests/ChangeLog	2012-08-13 19:09:41 UTC (rev 125432)
@@ -1,3 +1,15 @@
+2012-08-13  Dominik Röttsches  <[email protected]>
+
+        [Cairo] canvas/philip/tests/2d.drawImage.self.2.html test failing on ports using Cairo
+        https://bugs.webkit.org/show_bug.cgi?id=93244
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Unskipping canvas/philip/tests/2d.drawImage.self.2.html for GTK and EFL now that it's working.
+
+        * platform/efl/Skipped:
+        * platform/gtk/TestExpectations:
+
 2012-08-13  Lauro Neto  <[email protected]>
 
         [Qt] new test css3/flexbox/line-wrapping.html failing

Modified: trunk/LayoutTests/platform/efl/Skipped (125431 => 125432)


--- trunk/LayoutTests/platform/efl/Skipped	2012-08-13 19:07:15 UTC (rev 125431)
+++ trunk/LayoutTests/platform/efl/Skipped	2012-08-13 19:09:41 UTC (rev 125432)
@@ -354,11 +354,6 @@
 # These tests are failing for us, but not for Mac. This likely
 # indicates platform specific problems (via GTK+).
 
-# 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
-
 # A testcase for this failure is already in cairo tree, but has not yet been fixed.
 # Cairo commit http://cgit.freedesktop.org/cairo/commit/?id=4d4056872db94573183473610ad1d81d5439fdc6
 # https://bugs.webkit.org/show_bug.cgi?id=54471

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (125431 => 125432)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2012-08-13 19:07:15 UTC (rev 125431)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2012-08-13 19:09:41 UTC (rev 125432)
@@ -922,11 +922,6 @@
 // These tests are failing for us, but not for Mac. This likely
 // indicates platform specific problems.
 
-// 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.
-BUGWK93244 : canvas/philip/tests/2d.drawImage.self.2.html = TEXT
-
 // A testcase for this failure is already in cairo tree, but has not yet been fixed.
 // http://cgit.freedesktop.org/cairo/commit/?id=4d4056872db94573183473610ad1d81d5439fdc6
 BUGWK54471 : canvas/philip/tests/2d.path.arc.selfintersect.1.html = TEXT

Modified: trunk/Source/WebCore/ChangeLog (125431 => 125432)


--- trunk/Source/WebCore/ChangeLog	2012-08-13 19:07:15 UTC (rev 125431)
+++ trunk/Source/WebCore/ChangeLog	2012-08-13 19:09:41 UTC (rev 125432)
@@ -1,3 +1,20 @@
+2012-08-13  Dominik Röttsches  <[email protected]>
+
+        [Cairo] canvas/philip/tests/2d.drawImage.self.2.html test failing on ports using Cairo
+        https://bugs.webkit.org/show_bug.cgi?id=93244
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Similar to Skia's and Qt's ImageBuffer implementation we need to make sure that buffers
+        for images are copied when the destination canvas is identical to the
+        image buffer's context. This happens mostly in JS calls to canvas' drawImage method.
+        For now fixing the drawImage case, drawPattern case is handled in bug 93854.
+
+        No new tests, covered by canvas/philip/tests/2d.drawImage.self.2.html
+
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBuffer::draw): Making sure buffer is copied when source and destination contexts are identical.
+
 2012-06-24  Robert Hogan  <[email protected]>
 
         CSS 2.1 failure: Word-spacing affects each space and non-breaking space

Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (125431 => 125432)


--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2012-08-13 19:07:15 UTC (rev 125431)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2012-08-13 19:09:41 UTC (rev 125432)
@@ -96,11 +96,12 @@
     context->platformContext()->pushImageMask(m_data.m_surface, maskRect);
 }
 
-void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+void ImageBuffer::draw(GraphicsContext* destinationContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
                        CompositeOperator op , bool useLowQualityScale)
 {
-    RefPtr<Image> image = copyImage(DontCopyBackingStore);
-    context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, DoNotRespectImageOrientation, useLowQualityScale);
+    BackingStoreCopy copyMode = destinationContext == context() ? CopyBackingStore : DontCopyBackingStore;
+    RefPtr<Image> image = copyImage(copyMode);
+    destinationContext->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, DoNotRespectImageOrientation, useLowQualityScale);
 }
 
 void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to