[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

krit at webkit.org krit at webkit.org
Wed Apr 7 23:54:32 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit edba8d1d206b598afd0b1ddbf8098f5467cc6c9d
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 23 22:36:42 2009 +0000

    2009-11-23  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Oliver Hunt.
    
            [Cairo] support blurred test-shadow
            [https://bugs.webkit.org/show_bug.cgi?id=31797]
    
            Support for blurred text-shadows on Cairo. This patch
            reuses the code of blurred box-shadows, introduced in
            bug 26102. For a full textshadow support, a filters enabled
            build is needed.
    
            * platform/graphics/cairo/FontCairo.cpp:
            (WebCore::Font::drawGlyphs):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51322 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 16f7296..812e36b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-23  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Oliver Hunt.
+
+        [Cairo] support blurred test-shadow
+        [https://bugs.webkit.org/show_bug.cgi?id=31797]
+
+        Support for blurred text-shadows on Cairo. This patch
+        reuses the code of blurred box-shadows, introduced in
+        bug 26102. For a full textshadow support, a filters enabled
+        build is needed.
+
+        * platform/graphics/cairo/FontCairo.cpp:
+        (WebCore::Font::drawGlyphs):
+
 2009-11-23  Jens Alfke  <snej at chromium.org>
 
         Reviewed by Geoffrey Garen.
diff --git a/WebCore/platform/graphics/cairo/FontCairo.cpp b/WebCore/platform/graphics/cairo/FontCairo.cpp
index f6bdcd2..3bfa8f3 100644
--- a/WebCore/platform/graphics/cairo/FontCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontCairo.cpp
@@ -32,6 +32,7 @@
 #include "GlyphBuffer.h"
 #include "Gradient.h"
 #include "GraphicsContext.h"
+#include "ImageBuffer.h"
 #include "Pattern.h"
 #include "SimpleFontData.h"
 #include "TransformationMatrix.h"
@@ -85,6 +86,34 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
         shadowFillColor.getRGBA(red, green, blue, alpha);
         cairo_set_source_rgba(cr, red, green, blue, alpha);
 
+#if ENABLE(FILTERS)
+        cairo_text_extents_t extents;
+        cairo_scaled_font_glyph_extents(font->platformData().scaledFont(), glyphs, numGlyphs, &extents);
+
+        FloatRect rect(FloatPoint(), FloatSize(extents.width, extents.height));
+        IntSize shadowBufferSize;
+        FloatRect shadowRect;
+        float kernelSize = 0.f;
+        GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, kernelSize, rect, shadowSize, shadowBlur);
+
+        // Draw shadow into a new ImageBuffer
+        OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize);
+        GraphicsContext* shadowContext = shadowBuffer->context();
+        cairo_t* shadowCr = shadowContext->platformContext();
+
+        cairo_translate(shadowCr, kernelSize, extents.height + kernelSize);
+
+        cairo_set_scaled_font(shadowCr, font->platformData().scaledFont());
+        cairo_show_glyphs(shadowCr, glyphs, numGlyphs);
+        if (font->syntheticBoldOffset()) {
+            cairo_save(shadowCr);
+            cairo_translate(shadowCr, font->syntheticBoldOffset(), 0);
+            cairo_show_glyphs(shadowCr, glyphs, numGlyphs);
+            cairo_restore(shadowCr);
+        }
+        cairo_translate(cr, 0.0, -extents.height);
+        context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, kernelSize);
+#else
         cairo_translate(cr, shadowSize.width(), shadowSize.height());
         cairo_show_glyphs(cr, glyphs, numGlyphs);
         if (font->syntheticBoldOffset()) {
@@ -93,6 +122,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
             cairo_show_glyphs(cr, glyphs, numGlyphs);
             cairo_restore(cr);
         }
+#endif
 
         cairo_restore(cr);
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list