[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

simon.fraser at apple.com simon.fraser at apple.com
Mon Dec 27 16:29:34 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b4a8022c3cb777a8a574c7e864deb9067e004743
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 22 05:58:31 2010 +0000

    2010-12-21  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Darin Adler.
    
            Include the shadow color space as part of the GraphicsContext state
            https://bugs.webkit.org/show_bug.cgi?id=51420
    
            Include the ColorSpace for the shadow color as part of the graphics
            state. This will be used later for a shadow implementation that
            does not rely on platform shadow code.
    
            * platform/graphics/GraphicsContext.cpp:
            (WebCore::GraphicsContext::setShadow):
            (WebCore::GraphicsContext::clearShadow):
            (WebCore::GraphicsContext::getShadow):
            * platform/graphics/GraphicsContext.h:
            (WebCore::GraphicsContextState::GraphicsContextState):
            * platform/graphics/chromium/FontChromiumWin.cpp:
            (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
            (WebCore::Font::drawComplexText):
            * platform/graphics/mac/FontMac.mm:
            (WebCore::Font::drawGlyphs):
            * platform/graphics/skia/SkiaFontWin.cpp:
            (WebCore::windowsCanHandleDrawTextShadow):
            * platform/graphics/win/FontCGWin.cpp:
            (WebCore::drawGDIGlyphs):
            (WebCore::Font::drawGlyphs):
            * platform/graphics/wince/GraphicsContextWinCE.cpp:
            (WebCore::GraphicsContext::fillRoundedRect):
            (WebCore::GraphicsContext::drawText):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74463 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ca2a8b0..b5d07e0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,34 @@
+2010-12-21  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Include the shadow color space as part of the GraphicsContext state
+        https://bugs.webkit.org/show_bug.cgi?id=51420
+        
+        Include the ColorSpace for the shadow color as part of the graphics
+        state. This will be used later for a shadow implementation that
+        does not rely on platform shadow code.
+
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::setShadow):
+        (WebCore::GraphicsContext::clearShadow):
+        (WebCore::GraphicsContext::getShadow):
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::GraphicsContextState::GraphicsContextState):
+        * platform/graphics/chromium/FontChromiumWin.cpp:
+        (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
+        (WebCore::Font::drawComplexText):
+        * platform/graphics/mac/FontMac.mm:
+        (WebCore::Font::drawGlyphs):
+        * platform/graphics/skia/SkiaFontWin.cpp:
+        (WebCore::windowsCanHandleDrawTextShadow):
+        * platform/graphics/win/FontCGWin.cpp:
+        (WebCore::drawGDIGlyphs):
+        (WebCore::Font::drawGlyphs):
+        * platform/graphics/wince/GraphicsContextWinCE.cpp:
+        (WebCore::GraphicsContext::fillRoundedRect):
+        (WebCore::GraphicsContext::drawText):
+
 2010-12-21  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index 9b621f8..f323969 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -135,6 +135,7 @@ void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color
     m_state.shadowOffset = offset;
     m_state.shadowBlur = blur;
     m_state.shadowColor = color;
+    m_state.shadowColorSpace = colorSpace;
     setPlatformShadow(offset, blur, color, colorSpace);
 }
 
@@ -143,14 +144,16 @@ void GraphicsContext::clearShadow()
     m_state.shadowOffset = FloatSize();
     m_state.shadowBlur = 0;
     m_state.shadowColor = Color();
+    m_state.shadowColorSpace = ColorSpaceDeviceRGB;
     clearPlatformShadow();
 }
 
-bool GraphicsContext::getShadow(FloatSize& offset, float& blur, Color& color) const
+bool GraphicsContext::getShadow(FloatSize& offset, float& blur, Color& color, ColorSpace& colorSpace) const
 {
     offset = m_state.shadowOffset;
     blur = m_state.shadowBlur;
     color = m_state.shadowColor;
+    colorSpace = m_state.shadowColorSpace;
 
     return color.isValid() && color.alpha() && (blur || offset.width() || offset.height());
 }
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 745f7ea..6a5cfcc 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -162,6 +162,7 @@ namespace WebCore {
             , fillRule(RULE_NONZERO)
             , strokeColorSpace(ColorSpaceDeviceRGB)
             , fillColorSpace(ColorSpaceDeviceRGB)
+            , shadowColorSpace(ColorSpaceDeviceRGB)
             , compositeOperator(CompositeSourceOver)
             , shouldAntialias(true)
             , shouldSmoothFonts(true)
@@ -195,6 +196,7 @@ namespace WebCore {
 
         ColorSpace strokeColorSpace;
         ColorSpace fillColorSpace;
+        ColorSpace shadowColorSpace;
 
         CompositeOperator compositeOperator;
 
@@ -344,7 +346,7 @@ namespace WebCore {
         void endTransparencyLayer();
 
         void setShadow(const FloatSize&, float blur, const Color&, ColorSpace);
-        bool getShadow(FloatSize&, float&, Color&) const;
+        bool getShadow(FloatSize&, float&, Color&, ColorSpace&) const;
         void clearShadow();
 
         void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Color&);
diff --git a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
index 0a6ff78..1a00833 100644
--- a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
@@ -277,7 +277,8 @@ bool TransparencyAwareGlyphPainter::drawGlyphs(int numGlyphs,
     FloatSize shadowOffset;
     float shadowBlur;
     Color shadowColor;
-    if (m_graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor)) {
+    ColorSpace shadowColorSpace;
+    if (m_graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace)) {
         // If there is a shadow and this code is reached, windowsCanHandleDrawTextShadow()
         // will have already returned true during the ctor initiatization of m_useGDI
         ASSERT(shadowColor.alpha() == 255);
@@ -489,7 +490,8 @@ void Font::drawComplexText(GraphicsContext* graphicsContext,
     FloatSize shadowOffset;
     float shadowBlur;
     Color shadowColor;
-    if (graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor) && windowsCanHandleDrawTextShadow(graphicsContext)) {
+    ColorSpace shadowColorSpace;
+    if (graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace) && windowsCanHandleDrawTextShadow(graphicsContext)) {
         COLORREF textColor = skia::SkColorToCOLORREF(SkColorSetARGB(255, shadowColor.red(), shadowColor.green(), shadowColor.blue()));
         COLORREF savedTextColor = GetTextColor(hdc);
         SetTextColor(hdc, textColor);
diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm
index 403fbe0..2169490 100644
--- a/WebCore/platform/graphics/mac/FontMac.mm
+++ b/WebCore/platform/graphics/mac/FontMac.mm
@@ -169,8 +169,9 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
     FloatSize shadowOffset;
     float shadowBlur;
     Color shadowColor;
+    ColorSpace shadowColorSpace;
     ColorSpace fillColorSpace = context->fillColorSpace();
-    context->getShadow(shadowOffset, shadowBlur, shadowColor);
+    context->getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
 
     bool hasSimpleShadow = context->textDrawingMode() == TextModeFill && shadowColor.isValid() && !shadowBlur && !platformData.isColorBitmapFont();
     if (hasSimpleShadow) {
@@ -178,7 +179,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
         context->clearShadow();
         Color fillColor = context->fillColor();
         Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
-        context->setFillColor(shadowFillColor, fillColorSpace);
+        context->setFillColor(shadowFillColor, shadowColorSpace);
         CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width(), point.y() + shadowOffset.height());
         showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
         if (font->syntheticBoldOffset()) {
@@ -196,7 +197,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
     }
 
     if (hasSimpleShadow)
-        context->setShadow(shadowOffset, shadowBlur, shadowColor, fillColorSpace);
+        context->setShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
 
     if (changeFontSmoothing)
         CGContextSetShouldSmoothFonts(cgContext, originalShouldUseFontSmoothing);
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.cpp b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
index 62a4d96..5046c50 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.cpp
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
@@ -225,8 +225,9 @@ bool windowsCanHandleDrawTextShadow(GraphicsContext *context)
     FloatSize shadowOffset;
     float shadowBlur;
     Color shadowColor;
+    ColorSpace shadowColorSpace;
 
-    bool hasShadow = context->getShadow(shadowOffset, shadowBlur, shadowColor);
+    bool hasShadow = context->getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
     return (hasShadow && (shadowBlur == 0) && (shadowColor.alpha() == 255) && (context->fillColor().alpha() == 255));
 }
 
diff --git a/WebCore/platform/graphics/win/FontCGWin.cpp b/WebCore/platform/graphics/win/FontCGWin.cpp
index a27872b..2194ef7 100644
--- a/WebCore/platform/graphics/win/FontCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontCGWin.cpp
@@ -143,7 +143,9 @@ static void drawGDIGlyphs(GraphicsContext* graphicsContext, const SimpleFontData
             FloatSize offset;
             float blur;
             Color color;
-            graphicsContext->getShadow(offset, blur, color);
+            ColorSpace shadowColorSpace;
+
+            graphicsContext->getShadow(offset, blur, color, shadowColorSpace);
             drawIntoBitmap = offset.width() || offset.height() || blur;
         }
     }
@@ -352,7 +354,8 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
     FloatSize shadowOffset;
     float shadowBlur;
     Color shadowColor;
-    graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor);
+    ColorSpace shadowColorSpace;
+    graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
 
     bool hasSimpleShadow = graphicsContext->textDrawingMode() == TextModeFill && shadowColor.isValid() && !shadowBlur;
     if (hasSimpleShadow) {
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
index b01fff5..1ea1a64 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
@@ -1206,8 +1206,9 @@ void GraphicsContext::fillRoundedRect(const IntRect& fillRect, const IntSize& to
     FloatSize shadowOffset;
     float shadowBlur = 0;
     Color shadowColor;
+    ColorSpace shadowColorSpace;
         
-    getShadow(shadowOffset, shadowBlur, shadowColor);
+    getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
     
     IntRect dstRect = fillRect;
     
@@ -1623,8 +1624,9 @@ void GraphicsContext::drawText(const SimpleFontData* fontData, const GlyphBuffer
     FloatSize shadowOffset;
     float shadowBlur = 0;
     Color shadowColor;
+    ColorSpace shadowColorSpace;
     bool hasShadow = textDrawingMode() == TextModeFill
-        && getShadow(shadowOffset, shadowBlur, shadowColor)
+        && getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace)
         && shadowColor.alpha();
     COLORREF shadowRGBColor;
     FloatPoint trShadowPoint;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list