[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d

bdakin at apple.com bdakin at apple.com
Thu Dec 3 13:33:03 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit f29ea7f26e05d030a75a6f4d42a7c7f32df08b4d
Author: bdakin at apple.com <bdakin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 12 01:51:00 2009 +0000

    WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=31382
    Make -webkit-color-correction work with shadows
    
    Reviewed by Simon Fraser.
    
    From canvas, just send DeviceColorSpace to setShadow() for now.
    Will fix soon when I address https://bugs.webkit.org/show_bug.cgi?id=31319
    * html/canvas/CanvasRenderingContext2D.cpp:
    (WebCore::CanvasRenderingContext2D::setShadow):
    (WebCore::CanvasRenderingContext2D::applyShadow):
    
    setShadow() and setPlatformShadow() now take a ColorSpace.
    * platform/graphics/GraphicsContext.cpp:
    (WebCore::GraphicsContext::setShadow):
    * platform/graphics/GraphicsContext.h:
    * platform/graphics/cg/GraphicsContextCG.cpp:
    (WebCore::createCGColorWithColorSpace): New helper to create a
    color in a ColorSpace.
    (WebCore::setCGFillColor): Call new helper.
    (WebCore::setCGStrokeColor): Call new helper.
    (WebCore::GraphicsContext::setPlatformShadow): Call new helper.
    * platform/graphics/haiku/GraphicsContextHaiku.cpp:
    (WebCore::GraphicsContext::setPlatformShadow):
    
    Send appropriate ColorSpace to setShadow().
    * platform/graphics/mac/FontMac.mm:
    (WebCore::Font::drawGlyphs):
    * rendering/EllipsisBox.cpp:
    (WebCore::EllipsisBox::paint):
    * rendering/InlineFlowBox.cpp:
    (WebCore::InlineFlowBox::paintTextDecorations):
    * rendering/InlineTextBox.cpp:
    (WebCore::paintTextWithShadows):
    (WebCore::InlineTextBox::paintDecoration):
    * rendering/RenderBoxModelObject.cpp:
    (WebCore::RenderBoxModelObject::paintBoxShadow):
    * rendering/SVGInlineTextBox.cpp:
    (WebCore::SVGInlineTextBox::paintCharacters):
    * rendering/SVGRenderSupport.cpp:
    (WebCore::SVGRenderBase::prepareToRenderSVGContent):
    
    Attempt to keep ports building.
    * platform/graphics/cairo/GraphicsContextCairo.cpp:
    (WebCore::GraphicsContext::setPlatformShadow):
    * platform/graphics/qt/GraphicsContextQt.cpp:
    (WebCore::GraphicsContext::setPlatformShadow):
    * platform/graphics/skia/GraphicsContextSkia.cpp:
    (WebCore::GraphicsContext::setPlatformShadow):
    * platform/graphics/wince/GraphicsContextWince.cpp:
    (WebCore::GraphicsContext::setPlatformShadow):
    * platform/graphics/wx/GraphicsContextWx.cpp:
    (WebCore::GraphicsContext::setPlatformShadow):
    
    LayoutTests: Tests for https://bugs.webkit.org/show_bug.cgi?id=31382
    Make -webkit-color-correction work with shadows
    
    Reviewed by Simon Fraser.
    
    * fast/css/color-correction-on-box-shadow.html: Added.
    * fast/css/color-correction-on-text-shadow.html: Added.
    * platform/mac/fast/css/color-correction-on-box-shadow-expected.checksum: Added.
    * platform/mac/fast/css/color-correction-on-box-shadow-expected.png: Added.
    * platform/mac/fast/css/color-correction-on-box-shadow-expected.txt: Added.
    * platform/mac/fast/css/color-correction-on-text-shadow-expected.checksum: Added.
    * platform/mac/fast/css/color-correction-on-text-shadow-expected.png: Added.
    * platform/mac/fast/css/color-correction-on-text-shadow-expected.txt: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50852 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b85abbd..1adb6f4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2009-11-11  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Tests for https://bugs.webkit.org/show_bug.cgi?id=31382
+        Make -webkit-color-correction work with shadows
+
+        * fast/css/color-correction-on-box-shadow.html: Added.
+        * fast/css/color-correction-on-text-shadow.html: Added.
+        * platform/mac/fast/css/color-correction-on-box-shadow-expected.checksum: Added.
+        * platform/mac/fast/css/color-correction-on-box-shadow-expected.png: Added.
+        * platform/mac/fast/css/color-correction-on-box-shadow-expected.txt: Added.
+        * platform/mac/fast/css/color-correction-on-text-shadow-expected.checksum: Added.
+        * platform/mac/fast/css/color-correction-on-text-shadow-expected.png: Added.
+        * platform/mac/fast/css/color-correction-on-text-shadow-expected.txt: Added.
+
 2009-11-11  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/css/color-correction-on-box-shadow.html b/LayoutTests/fast/css/color-correction-on-box-shadow.html
new file mode 100644
index 0000000..39f7f52
--- /dev/null
+++ b/LayoutTests/fast/css/color-correction-on-box-shadow.html
@@ -0,0 +1,26 @@
+<html>
+<style>
+.purple-corrected {
+    background-color:#560063; 
+    width:100px; 
+    height:100px; 
+    -webkit-color-correction:sRGB; 
+    -webkit-box-shadow: 50px 50px 50px #560063
+}
+
+.purple-uncorrected {
+    background-color:#560063; 
+    width:100px; 
+    height:100px; 
+    -webkit-color-correction:default;  
+}
+</style>
+<body>
+
+<p>The shadow should match the color of the top square and not the color of the bottom square. The top square and its shadow are both color-corrected from sRGB.</p>
+<div class="purple-corrected"></div>
+<br/>
+<div class="purple-uncorrected"></div>
+
+</body>
+</html>
diff --git a/LayoutTests/fast/css/color-correction-on-text-shadow.html b/LayoutTests/fast/css/color-correction-on-text-shadow.html
new file mode 100644
index 0000000..c9bdc05
--- /dev/null
+++ b/LayoutTests/fast/css/color-correction-on-text-shadow.html
@@ -0,0 +1,26 @@
+<html>
+<style>
+.purple-corrected {
+    color:#560063; 
+    font-weight: bold;
+    font-size: 100px;
+    -webkit-color-correction:sRGB; 
+    text-shadow: 50px 50px 2px #560063
+}
+
+.purple-uncorrected {
+    color:#560063; 
+    font-weight: bold;
+    font-size: 100px;
+    -webkit-color-correction:default;  
+}
+</style>
+<body>
+
+<p>This is subtle, but the shadow should match the color of the top H and not the color of the bottom H. The top H and its shadow are both color-corrected from sRGB.</p>
+<span class="purple-corrected">H</span>
+<br/>
+<span class="purple-uncorrected">H</span>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.checksum b/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.checksum
new file mode 100644
index 0000000..914d6da
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.checksum
@@ -0,0 +1 @@
+ec97d26c065daa3d3c5fc9036d0dfede
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.png b/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.png
new file mode 100644
index 0000000..913a4dc
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.txt b/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.txt
new file mode 100644
index 0000000..8a10ff6
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/color-correction-on-box-shadow-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 777x36
+          text run at (0,0) width 777: "The shadow should match the color of the top square and not the color of the bottom square. The top square and its shadow"
+          text run at (0,18) width 232: "are both color-corrected from sRGB."
+      RenderBlock {DIV} at (0,52) size 100x100 [bgcolor=#560063]
+      RenderBlock (anonymous) at (0,152) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+      RenderBlock {DIV} at (0,170) size 100x100 [bgcolor=#560063]
diff --git a/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.checksum b/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.checksum
new file mode 100644
index 0000000..250eba3
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.checksum
@@ -0,0 +1 @@
+25ffc834d42c88a5cd723675b2867815
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.png b/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.png
new file mode 100644
index 0000000..7b557f6
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.txt b/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.txt
new file mode 100644
index 0000000..256af17
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/color-correction-on-text-shadow-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 746x36
+          text run at (0,0) width 746: "This is subtle, but the shadow should match the color of the top H and not the color of the bottom H. The top H and its"
+          text run at (0,18) width 285: "shadow are both color-corrected from sRGB."
+      RenderBlock (anonymous) at (0,52) size 784x230
+        RenderInline {SPAN} at (0,0) size 78x115 [color=#560063]
+          RenderText {#text} at (0,0) size 78x115
+            text run at (0,0) width 78: "H"
+        RenderText {#text} at (78,76) size 4x18
+          text run at (78,76) width 4: " "
+        RenderBR {BR} at (82,90) size 0x0
+        RenderInline {SPAN} at (0,0) size 78x115 [color=#560063]
+          RenderText {#text} at (0,115) size 78x115
+            text run at (0,115) width 78: "H"
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
+        RenderText {#text} at (0,0) size 0x0
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c8fc95b..083c526 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,58 @@
+2009-11-11  Beth Dakin  <bdakin at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=31382
+        Make -webkit-color-correction work with shadows
+
+        From canvas, just send DeviceColorSpace to setShadow() for now. 
+        Will fix soon when I address https://bugs.webkit.org/show_bug.cgi?id=31319
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::setShadow):
+        (WebCore::CanvasRenderingContext2D::applyShadow):
+
+        setShadow() and setPlatformShadow() now take a ColorSpace.
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::setShadow):
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::createCGColorWithColorSpace): New helper to create a 
+        color in a ColorSpace.
+        (WebCore::setCGFillColor): Call new helper.
+        (WebCore::setCGStrokeColor): Call new helper.
+        (WebCore::GraphicsContext::setPlatformShadow): Call new helper.
+        * platform/graphics/haiku/GraphicsContextHaiku.cpp:
+        (WebCore::GraphicsContext::setPlatformShadow):
+
+        Send appropriate ColorSpace to setShadow().
+        * platform/graphics/mac/FontMac.mm:
+        (WebCore::Font::drawGlyphs):
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::paint):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::paintTextDecorations):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::paintTextWithShadows):
+        (WebCore::InlineTextBox::paintDecoration):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBoxShadow):
+        * rendering/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::paintCharacters):
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderBase::prepareToRenderSVGContent):
+
+        Attempt to keep ports building.
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::GraphicsContext::setPlatformShadow):
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::setPlatformShadow):
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+        (WebCore::GraphicsContext::setPlatformShadow):
+        * platform/graphics/wince/GraphicsContextWince.cpp:
+        (WebCore::GraphicsContext::setPlatformShadow):
+        * platform/graphics/wx/GraphicsContextWx.cpp:
+        (WebCore::GraphicsContext::setPlatformShadow):
+
 2009-11-11  Kent Tamura  <tkent at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index f19379b..0f4925e 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -817,7 +817,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
         return;
 
     RGBA32 rgba = makeRGBA32FromFloats(grayLevel, grayLevel, grayLevel, 1.0f);
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba));
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba), DeviceColorSpace);
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur, const String& color, float alpha)
@@ -833,7 +833,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
     RGBA32 rgba = 0; // default is transparent black
     if (!state().m_shadowColor.isEmpty())
         CSSParser::parseColor(rgba, state().m_shadowColor);
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(colorWithOverrideAlpha(rgba, alpha)));
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(colorWithOverrideAlpha(rgba, alpha)), DeviceColorSpace);
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur, float grayLevel, float alpha)
@@ -847,7 +847,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
         return;
 
     RGBA32 rgba = makeRGBA32FromFloats(grayLevel, grayLevel, grayLevel, alpha);
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba));
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba), DeviceColorSpace);
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur, float r, float g, float b, float a)
@@ -863,7 +863,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
     RGBA32 rgba = makeRGBA32FromFloats(r, g, b, a); // default is transparent black
     if (!state().m_shadowColor.isEmpty())
         CSSParser::parseColor(rgba, state().m_shadowColor);
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba));
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba), DeviceColorSpace);
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur, float c, float m, float y, float k, float a)
@@ -883,7 +883,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
     CGContextSetShadowWithColor(dc->platformContext(), adjustedShadowSize(width, -height), blur, shadowColor);
     CGColorRelease(shadowColor);
 #else
-    dc->setShadow(IntSize(width, -height), blur, Color(c, m, y, k, a));
+    dc->setShadow(IntSize(width, -height), blur, Color(c, m, y, k, a), DeviceColorSpace);
 #endif
 }
 
@@ -906,7 +906,7 @@ void CanvasRenderingContext2D::applyShadow()
         CSSParser::parseColor(rgba, state().m_shadowColor);
     float width = state().m_shadowOffset.width();
     float height = state().m_shadowOffset.height();
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba));
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, Color(rgba), DeviceColorSpace);
 }
 
 static IntSize size(HTMLImageElement* image)
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index 0f53d4a..bf4600e 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -128,12 +128,12 @@ void GraphicsContext::setStrokeColor(const Color& color, ColorSpace colorSpace)
     setPlatformStrokeColor(color, colorSpace);
 }
 
-void GraphicsContext::setShadow(const IntSize& size, int blur, const Color& color)
+void GraphicsContext::setShadow(const IntSize& size, int blur, const Color& color, ColorSpace colorSpace)
 {
     m_common->state.shadowSize = size;
     m_common->state.shadowBlur = blur;
     m_common->state.shadowColor = color;
-    setPlatformShadow(size, blur, color);
+    setPlatformShadow(size, blur, color, colorSpace);
 }
 
 void GraphicsContext::clearShadow()
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 54e57a0..7aac04b 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -264,7 +264,7 @@ namespace WebCore {
         void beginTransparencyLayer(float opacity);
         void endTransparencyLayer();
 
-        void setShadow(const IntSize&, int blur, const Color&);
+        void setShadow(const IntSize&, int blur, const Color&, ColorSpace);
         bool getShadow(IntSize&, int&, Color&) const;
         void clearShadow();
 
@@ -406,7 +406,7 @@ namespace WebCore {
 
         void setPlatformShouldAntialias(bool b);
 
-        void setPlatformShadow(const IntSize&, int blur, const Color&);
+        void setPlatformShadow(const IntSize&, int blur, const Color&, ColorSpace);
         void clearPlatformShadow();
 
         static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, const StrokeStyle&);
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 46b631a..f0b05bc 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -726,7 +726,7 @@ void GraphicsContext::clipToImageBuffer(const FloatRect& rect, const ImageBuffer
     notImplemented();
 }
 
-void GraphicsContext::setPlatformShadow(IntSize const&, int, Color const&)
+void GraphicsContext::setPlatformShadow(IntSize const&, int, Color const&, ColorSpace)
 {
     notImplemented();
 }
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index 719bb96..9f79a4d 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -78,32 +78,30 @@ static CGColorSpaceRef sRGBColorSpaceRef()
 #endif
 }
 
-static void setCGFillColor(CGContextRef context, const Color& color, ColorSpace colorSpace)
+static CGColorRef createCGColorWithColorSpace(const Color& color, ColorSpace colorSpace)
 {
     CGFloat components[4];
     color.getRGBA(components[0], components[1], components[2], components[3]);
 
-    CGColorRef cgColor;
+    CGColorRef cgColor = 0;
     if (colorSpace == sRGBColorSpace)
         cgColor = CGColorCreate(sRGBColorSpaceRef(), components);
     else
         cgColor = CGColorCreate(deviceRGBColorSpaceRef(), components);
 
+    return cgColor;
+}
+
+static void setCGFillColor(CGContextRef context, const Color& color, ColorSpace colorSpace)
+{
+    CGColorRef cgColor = createCGColorWithColorSpace(color, colorSpace);
     CGContextSetFillColorWithColor(context, cgColor);
     CFRelease(cgColor);
 }
 
 static void setCGStrokeColor(CGContextRef context, const Color& color, ColorSpace colorSpace)
 {
-    CGFloat components[4];
-    color.getRGBA(components[0], components[1], components[2], components[3]);
-
-    CGColorRef cgColor;
-    if (colorSpace == sRGBColorSpace)
-        cgColor = CGColorCreate(sRGBColorSpaceRef(), components);
-    else
-        cgColor = CGColorCreate(deviceRGBColorSpaceRef(), components);
-
+    CGColorRef cgColor = createCGColorWithColorSpace(color, colorSpace);
     CGContextSetStrokeColorWithColor(context, cgColor);
     CFRelease(cgColor);
 }
@@ -764,7 +762,7 @@ void GraphicsContext::endTransparencyLayer()
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
-void GraphicsContext::setPlatformShadow(const IntSize& size, int blur, const Color& color)
+void GraphicsContext::setPlatformShadow(const IntSize& size, int blur, const Color& color, ColorSpace colorSpace)
 {
     if (paintingDisabled())
         return;
@@ -811,7 +809,7 @@ void GraphicsContext::setPlatformShadow(const IntSize& size, int blur, const Col
     if (!color.isValid())
         CGContextSetShadow(context, CGSizeMake(width, height), blurRadius);
     else {
-        RetainPtr<CGColorRef> colorCG(AdoptCF, createCGColor(color));
+        RetainPtr<CGColorRef> colorCG(AdoptCF, createCGColorWithColorSpace(color, colorSpace));
         CGContextSetShadowWithColor(context,
                                     CGSizeMake(width, height),
                                     blurRadius,
diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
index 9b97c6f..616b555 100644
--- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
@@ -532,7 +532,7 @@ void GraphicsContext::clearPlatformShadow()
     notImplemented();
 }
 
-void GraphicsContext::setPlatformShadow(IntSize const&, int, Color const&)
+void GraphicsContext::setPlatformShadow(IntSize const&, int, Color const&, ColorSpace)
 {
     notImplemented();
 }
diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm
index 7f110c2..bb9561e 100644
--- a/WebCore/platform/graphics/mac/FontMac.mm
+++ b/WebCore/platform/graphics/mac/FontMac.mm
@@ -115,6 +115,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
     IntSize shadowSize;
     int shadowBlur;
     Color shadowColor;
+    ColorSpace fillColorSpace = context->fillColorSpace();
     context->getShadow(shadowSize, shadowBlur, shadowColor);
 
     bool hasSimpleShadow = context->textDrawingMode() == cTextFill && shadowColor.isValid() && !shadowBlur;
@@ -122,7 +123,6 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
         // Paint simple shadows ourselves instead of relying on CG shadows, to avoid losing subpixel antialiasing.
         context->clearShadow();
         Color fillColor = context->fillColor();
-        ColorSpace fillColorSpace = context->fillColorSpace();
         Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
         context->setFillColor(shadowFillColor, fillColorSpace);
         CGContextSetTextPosition(cgContext, point.x() + shadowSize.width(), point.y() + shadowSize.height());
@@ -142,7 +142,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
     }
 
     if (hasSimpleShadow)
-        context->setShadow(shadowSize, shadowBlur, shadowColor);
+        context->setShadow(shadowSize, shadowBlur, shadowColor, fillColorSpace);
 
     if (originalShouldUseFontSmoothing != newShouldUseFontSmoothing)
         CGContextSetShouldSmoothFonts(cgContext, originalShouldUseFontSmoothing);
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 903e48b..5cdfac2 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -886,7 +886,7 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect)
     return FloatRect(QRectF(result));
 }
 
-void GraphicsContext::setPlatformShadow(const IntSize& size, int, const Color&)
+void GraphicsContext::setPlatformShadow(const IntSize& size, int, const Color&, ColorSpace)
 {
     // Qt doesn't support shadows natively, they are drawn manually in the draw*
     // functions
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index b897736..01737a1 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -975,7 +975,8 @@ void GraphicsContext::setPlatformFillPattern(Pattern* pattern)
 
 void GraphicsContext::setPlatformShadow(const IntSize& size,
                                         int blurInt,
-                                        const Color& color)
+                                        const Color& color,
+                                        ColorSpace colorSpace)
 {
     if (paintingDisabled())
         return;
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
index 7be4243..441cd28 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
@@ -1545,7 +1545,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
         fillRect(rect, fillColor(), DeviceColorSpace);
 }
 
-void GraphicsContext::setPlatformShadow(const IntSize&, int, const Color&, ColorSpace colorSpace)
+void GraphicsContext::setPlatformShadow(const IntSize&, int, const Color&, ColorSpace)
 {
     notImplemented();
 }
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index c5979c3..a4dde2a 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -511,7 +511,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
         return;
 }
 
-void GraphicsContext::setPlatformShadow(IntSize const&,int,Color const&) 
+void GraphicsContext::setPlatformShadow(IntSize const&,int,Color const&, ColorSpace) 
 { 
     notImplemented(); 
 }
diff --git a/WebCore/rendering/EllipsisBox.cpp b/WebCore/rendering/EllipsisBox.cpp
index 2959f35..bea9d73 100644
--- a/WebCore/rendering/EllipsisBox.cpp
+++ b/WebCore/rendering/EllipsisBox.cpp
@@ -36,7 +36,7 @@ void EllipsisBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
     bool setShadow = false;
     if (style->textShadow()) {
         context->setShadow(IntSize(style->textShadow()->x, style->textShadow()->y),
-                           style->textShadow()->blur, style->textShadow()->color);
+                           style->textShadow()->blur, style->textShadow()->color, style->colorSpace());
         setShadow = true;
     }
 
diff --git a/WebCore/rendering/InlineFlowBox.cpp b/WebCore/rendering/InlineFlowBox.cpp
index 840ee22..2bd1683 100644
--- a/WebCore/rendering/InlineFlowBox.cpp
+++ b/WebCore/rendering/InlineFlowBox.cpp
@@ -974,6 +974,7 @@ void InlineFlowBox::paintTextDecorations(RenderObject::PaintInfo& paintInfo, int
             setClip = true;
         }
 
+        ColorSpace colorSpace = renderer()->style()->colorSpace();
         bool setShadow = false;
         do {
             if (shadow) {
@@ -982,24 +983,24 @@ void InlineFlowBox::paintTextDecorations(RenderObject::PaintInfo& paintInfo, int
                     ty -= extraOffset;
                     extraOffset = 0;
                 }
-                context->setShadow(IntSize(shadow->x, shadow->y - extraOffset), shadow->blur, shadow->color);
+                context->setShadow(IntSize(shadow->x, shadow->y - extraOffset), shadow->blur, shadow->color, colorSpace);
                 setShadow = true;
                 shadow = shadow->next;
             }
 
             if (paintUnderline) {
-                context->setStrokeColor(underline, renderer()->style()->colorSpace());
+                context->setStrokeColor(underline, colorSpace);
                 context->setStrokeStyle(SolidStroke);
                 // Leave one pixel of white between the baseline and the underline.
                 context->drawLineForText(IntPoint(tx, ty + baselinePos + 1), w, isPrinting);
             }
             if (paintOverline) {
-                context->setStrokeColor(overline, renderer()->style()->colorSpace());
+                context->setStrokeColor(overline, colorSpace);
                 context->setStrokeStyle(SolidStroke);
                 context->drawLineForText(IntPoint(tx, ty), w, isPrinting);
             }
             if (paintLineThrough) {
-                context->setStrokeColor(linethrough, renderer()->style()->colorSpace());
+                context->setStrokeColor(linethrough, colorSpace);
                 context->setStrokeStyle(SolidStroke);
                 context->drawLineForText(IntPoint(tx, ty + 2 * baselinePos / 3), w, isPrinting);
             }
diff --git a/WebCore/rendering/InlineTextBox.cpp b/WebCore/rendering/InlineTextBox.cpp
index 8f830bd..292f247 100644
--- a/WebCore/rendering/InlineTextBox.cpp
+++ b/WebCore/rendering/InlineTextBox.cpp
@@ -280,7 +280,7 @@ static void paintTextWithShadows(GraphicsContext* context, const Font& font, con
                 extraOffset = IntSize(0, 2 * h + max(0, shadowOffset.height()) + shadowBlur);
                 shadowOffset -= extraOffset;
             }
-            context->setShadow(shadowOffset, shadowBlur, shadowColor);
+            context->setShadow(shadowOffset, shadowBlur, shadowColor, fillColorSpace);
         } else if (!opaque)
             context->setFillColor(fillColor, fillColorSpace);
 
@@ -661,6 +661,7 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
         setClip = true;
     }
 
+    ColorSpace colorSpace = renderer()->style()->colorSpace();
     bool setShadow = false;
     
     do {
@@ -670,24 +671,24 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, in
                 ty -= extraOffset;
                 extraOffset = 0;
             }
-            context->setShadow(IntSize(shadow->x, shadow->y - extraOffset), shadow->blur, shadow->color);
+            context->setShadow(IntSize(shadow->x, shadow->y - extraOffset), shadow->blur, shadow->color, colorSpace);
             setShadow = true;
             shadow = shadow->next;
         }
 
         if (deco & UNDERLINE) {
-            context->setStrokeColor(underline, renderer()->style()->colorSpace());
+            context->setStrokeColor(underline, colorSpace);
             context->setStrokeStyle(SolidStroke);
             // Leave one pixel of white between the baseline and the underline.
             context->drawLineForText(IntPoint(tx, ty + baseline + 1), width, isPrinting);
         }
         if (deco & OVERLINE) {
-            context->setStrokeColor(overline, renderer()->style()->colorSpace());
+            context->setStrokeColor(overline, colorSpace);
             context->setStrokeStyle(SolidStroke);
             context->drawLineForText(IntPoint(tx, ty), width, isPrinting);
         }
         if (deco & LINE_THROUGH) {
-            context->setStrokeColor(linethrough, renderer()->style()->colorSpace());
+            context->setStrokeColor(linethrough, colorSpace);
             context->setStrokeStyle(SolidStroke);
             context->drawLineForText(IntPoint(tx, ty + 2 * baseline / 3), width, isPrinting);
         }
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index 3ba1c34..f37bebb 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -1198,7 +1198,7 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
             shadowOffset -= extraOffset;
             fillRect.move(extraOffset);
 
-            context->setShadow(shadowOffset, shadowBlur, shadowColor);
+            context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
             if (hasBorderRadius) {
                 IntRect rectToClipOut = rect;
                 IntSize topLeftToClipOut = topLeft;
@@ -1321,7 +1321,7 @@ void RenderBoxModelObject::paintBoxShadow(GraphicsContext* context, int tx, int
 
             context->setFillRule(RULE_EVENODD);
             context->setFillColor(fillColor, s->colorSpace());
-            context->setShadow(shadowOffset, shadowBlur, shadowColor);
+            context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
             context->fillPath();
 
             context->restore();
diff --git a/WebCore/rendering/SVGInlineTextBox.cpp b/WebCore/rendering/SVGInlineTextBox.cpp
index a5d440d..cf8464e 100644
--- a/WebCore/rendering/SVGInlineTextBox.cpp
+++ b/WebCore/rendering/SVGInlineTextBox.cpp
@@ -382,7 +382,8 @@ void SVGInlineTextBox::paintCharacters(RenderObject::PaintInfo& paintInfo, int t
     bool setShadow = false;
     if (styleToUse->textShadow()) {
         paintInfo.context->setShadow(IntSize(styleToUse->textShadow()->x, styleToUse->textShadow()->y),
-                                     styleToUse->textShadow()->blur, styleToUse->textShadow()->color);
+                                     styleToUse->textShadow()->blur, styleToUse->textShadow()->color,
+                                     styleToUse->colorSpace());
         setShadow = true;
     }
 
diff --git a/WebCore/rendering/SVGRenderSupport.cpp b/WebCore/rendering/SVGRenderSupport.cpp
index ea087f9..99a990c 100644
--- a/WebCore/rendering/SVGRenderSupport.cpp
+++ b/WebCore/rendering/SVGRenderSupport.cpp
@@ -95,7 +95,7 @@ void SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject
     }
 
     if (ShadowData* shadow = svgStyle->shadow())
-        paintInfo.context->setShadow(IntSize(shadow->x, shadow->y), shadow->blur, shadow->color); 
+        paintInfo.context->setShadow(IntSize(shadow->x, shadow->y), shadow->blur, shadow->color, style->colorSpace()); 
 
 #if ENABLE(FILTERS)
     AtomicString filterId(svgStyle->filter());

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list