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

bfulgham at webkit.org bfulgham at webkit.org
Thu Dec 3 13:37:49 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit fa900d30497a28d41960efcaaacb0780a5fcecc3
Author: bfulgham at webkit.org <bfulgham at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 16 21:01:26 2009 +0000

    Enable support for webkit-box-shadow in Cairo builds.
    https://bugs.webkit.org/show_bug.cgi?id=26102.
    
    Reviewed by Oliver Hunt.
    
    Covered by existing fast/box-shadow tests.
    
    * platform/graphics/cairo/GraphicsContextCairo.cpp:  Add
      support for fillRect shadows.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3a8d8a3..f78387c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-15  Brent Fulgham  <bfulgham at webkit.org>
+
+        Reviewed by Oliver Hunt.
+
+        Enable support for webkit-box-shadow in Cairo builds.
+        https://bugs.webkit.org/show_bug.cgi?id=26102.
+
+        Covered by existing fast/box-shadow tests.
+
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:  Add
+          support for fillRect shadows.
+
 2009-11-16  Alexey Proskuryakov  <ap at apple.com>
 
         Windows build fix.
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 70be066..a4dd450 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -565,11 +565,37 @@ void GraphicsContext::fillRect(const FloatRect& rect)
     fillPath();
 }
 
+static void drawBorderlessRectShadow(GraphicsContext* context, const FloatRect& rect, const Color& rectColor)
+{
+#if ENABLE(FILTERS)
+    IntSize shadowSize;
+    int shadowBlur;
+    Color shadowColor;
+
+    if (!context->getShadow(shadowSize, shadowBlur, shadowColor))
+        return;
+
+    //calculate filter values
+    IntSize shadowBufferSize;
+    FloatRect shadowRect;
+    float kernelSize = 0.0;
+    GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, kernelSize, rect, shadowSize, shadowBlur);
+
+    //draw shadow into a new ImageBuffer
+    OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize);
+    GraphicsContext* shadowContext = shadowBuffer->context();
+    shadowContext->fillRect(FloatRect(FloatPoint(kernelSize, kernelSize), rect.size()), rectColor, DeviceColorSpace);
+
+    context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, kernelSize);
+#endif
+}
+
 void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace)
 {
     if (paintingDisabled())
         return;
 
+    drawBorderlessRectShadow(this, rect, color);
     if (color.alpha())
         fillRectSourceOver(m_data->cr, rect, color);
 }
@@ -1113,7 +1139,7 @@ void GraphicsContext::clipOut(const IntRect& r)
     cairo_t* cr = m_data->cr;
     double x1, y1, x2, y2;
     cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
-    cairo_rectangle(cr, x1, x2, x2 - x1, y2 - y1);
+    cairo_rectangle(cr, x1, y1, x2 - x1, y2 - y1);
     cairo_rectangle(cr, r.x(), r.y(), r.width(), r.height());
     cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
     cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
@@ -1141,6 +1167,7 @@ void GraphicsContext::fillRoundedRect(const IntRect& r, const IntSize& topLeft,
     beginPath();
     addPath(Path::createRoundedRectangle(r, topLeft, topRight, bottomLeft, bottomRight));
     setColor(cr, color);
+    drawPathShadow(this, m_common, true, false);
     cairo_fill(cr);
     cairo_restore(cr);
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list