[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
mrobinson at webkit.org
mrobinson at webkit.org
Wed Dec 22 17:49:55 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit cf5d18928034051f54a3b4f6e545b04845361ee3
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Dec 1 01:36:11 2010 +0000
2010-11-30 Martin Robinson <mrobinson at igalia.com>
Reviewed by Xan Lopez.
[GTK] fillRect shadow has incorrect behavior when using ctx.scale(x,y)
https://bugs.webkit.org/show_bug.cgi?id=50283
Add platform exceptions for these tests. While this change fixes most issues
with them there are still bugs with our shadow code which prevents a total
pass.
* platform/gtk/fast/canvas/canvas-scale-fillPath-shadow-expected.txt: Added.
* platform/gtk/fast/canvas/canvas-scale-fillRect-shadow-expected.txt: Added.
2010-11-30 Martin Robinson <mrobinson at igalia.com>
Reviewed by Xan Lopez.
[GTK] fillRect shadow has incorrect behavior when using ctx.scale(x,y)
https://bugs.webkit.org/show_bug.cgi?id=50283
Adjust the mask rectangle for Cairo shadows, so that the origin
is not affected by the scale of the transformation matrix.
* platform/graphics/ContextShadow.h: Make this Qt-only member global.
* platform/graphics/cairo/ContextShadowCairo.cpp:
(WebCore::ContextShadow::beginShadowLayer): Save the original layer area.
(WebCore::ContextShadow::endShadowLayer): If the target context has a scale
transform, make sure not to scale the blur distance when blitting the shadow.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b02aa6a..9a140e2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-30 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] fillRect shadow has incorrect behavior when using ctx.scale(x,y)
+ https://bugs.webkit.org/show_bug.cgi?id=50283
+
+ Add platform exceptions for these tests. While this change fixes most issues
+ with them there are still bugs with our shadow code which prevents a total
+ pass.
+
+ * platform/gtk/fast/canvas/canvas-scale-fillPath-shadow-expected.txt: Added.
+ * platform/gtk/fast/canvas/canvas-scale-fillRect-shadow-expected.txt: Added.
+
2010-11-30 Ryosuke Niwa <rniwa at webkit.org>
Reviewed by Ojan Vafai.
diff --git a/LayoutTests/platform/gtk/fast/canvas/canvas-scale-fillPath-shadow-expected.txt b/LayoutTests/platform/gtk/fast/canvas/canvas-scale-fillPath-shadow-expected.txt
new file mode 100644
index 0000000..8572178
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/canvas/canvas-scale-fillPath-shadow-expected.txt
@@ -0,0 +1,57 @@
+Ensure correct behavior of canvas with path fill + shadow after scaling. A blue and red checkered pattern should be displayed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] should be 255. Was 191.
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] should be 255. Was 191.
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] should be 255. Was 143.
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] is not around 76 (actual: 57)
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] is not around 76 (actual: 57)
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] is not around 76 (actual: 57)
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 83
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 83
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 53
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 24
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 24
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 24
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/platform/gtk/fast/canvas/canvas-scale-fillRect-shadow-expected.txt b/LayoutTests/platform/gtk/fast/canvas/canvas-scale-fillRect-shadow-expected.txt
new file mode 100644
index 0000000..228d5fc
--- /dev/null
+++ b/LayoutTests/platform/gtk/fast/canvas/canvas-scale-fillRect-shadow-expected.txt
@@ -0,0 +1,57 @@
+Ensure correct behavior of canvas with fillRect+shadow after scaling. A blue and red checkered pattern should be displayed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] should be 255. Was 191.
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] should be 255. Was 191.
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] should be 255. Was 143.
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] is not around 76 (actual: 57)
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] is not around 76 (actual: 57)
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+FAIL d[3] is not around 76 (actual: 57)
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 83
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 83
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 53
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 24
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 24
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 24
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b1d4fe7..153760d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-30 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] fillRect shadow has incorrect behavior when using ctx.scale(x,y)
+ https://bugs.webkit.org/show_bug.cgi?id=50283
+
+ Adjust the mask rectangle for Cairo shadows, so that the origin
+ is not affected by the scale of the transformation matrix.
+
+ * platform/graphics/ContextShadow.h: Make this Qt-only member global.
+ * platform/graphics/cairo/ContextShadowCairo.cpp:
+ (WebCore::ContextShadow::beginShadowLayer): Save the original layer area.
+ (WebCore::ContextShadow::endShadowLayer): If the target context has a scale
+ transform, make sure not to scale the blur distance when blitting the shadow.
+
2010-11-30 Darin Adler <darin at apple.com>
Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/platform/graphics/ContextShadow.h b/WebCore/platform/graphics/ContextShadow.h
index 26f0a36..fa778af 100644
--- a/WebCore/platform/graphics/ContextShadow.h
+++ b/WebCore/platform/graphics/ContextShadow.h
@@ -120,10 +120,8 @@ private:
PlatformImage m_layerImage;
PlatformContext m_layerContext;
-#if PLATFORM(QT)
// Used for reference when canvas scale(x,y) was called.
FloatRect m_unscaledLayerRect;
-#endif
void blurLayerImage(unsigned char*, const IntSize& imageSize, int stride);
void calculateLayerBoundingRect(const FloatRect& layerArea, const IntRect& clipRect);
diff --git a/WebCore/platform/graphics/cairo/ContextShadowCairo.cpp b/WebCore/platform/graphics/cairo/ContextShadowCairo.cpp
index 8299b6a..699edf7 100644
--- a/WebCore/platform/graphics/cairo/ContextShadowCairo.cpp
+++ b/WebCore/platform/graphics/cairo/ContextShadowCairo.cpp
@@ -84,6 +84,8 @@ static cairo_surface_t* getScratchBuffer(const IntSize& size)
PlatformContext ContextShadow::beginShadowLayer(PlatformContext context, const FloatRect& layerArea)
{
+ m_unscaledLayerRect = layerArea;
+
double x1, x2, y1, y2;
cairo_clip_extents(context, &x1, &y1, &x2, &y2);
calculateLayerBoundingRect(layerArea, IntRect(x1, y1, x2 - x1, y2 - y1));
@@ -120,7 +122,19 @@ void ContextShadow::endShadowLayer(cairo_t* cr)
cairo_save(cr);
setSourceRGBAFromColor(cr, m_color);
- cairo_mask_surface(cr, m_layerImage, m_layerRect.x(), m_layerRect.y());
+
+ cairo_matrix_t transform;
+ cairo_get_matrix(cr, &transform);
+ double x = m_layerRect.x();
+ double y = m_layerRect.y();
+
+ double xScale = sqrt(transform.xx * transform.xx + transform.yx * transform.yx);
+ double yScale = sqrt(transform.xy * transform.xy + transform.yy * transform.yy);
+ if (xScale != 1 || yScale != 1) {
+ x = m_unscaledLayerRect.x() + m_offset.width() / transform.xx - m_blurDistance;
+ y = m_unscaledLayerRect.y() + m_offset.height() / transform.yy - m_blurDistance;
+ }
+ cairo_mask_surface(cr, m_layerImage, x, y);
cairo_restore(cr);
// Schedule a purge of the scratch buffer. We do not need to destroy the surface.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list