[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:36:09 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit b1481c0105396ea2465588e0f73b01e9937891f1
Author: bfulgham at webkit.org <bfulgham at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 13 19:21:24 2009 +0000
[CAIRO] shadow support for Canvas and SVG.
[https://bugs.webkit.org/show_bug.cgi?id=30960]
Reviewed by Alexey Proskuryakov.
Incorporate Benjamin Otte's recommendations to avoid
a buffer overrun, and small performance improvement.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::copyContextProperties): Correctly size output
storage for cairo_get_dash to avoid buffer overrun.
(WebCore::drawPathShadow): Prefer cairo_fill_extents
to slower cairo_stroke_extents when not drawing shadows.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 84bd9e0..548ad42 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-11-13 Brent Fulgham <bfulgham at webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ [CAIRO] shadow support for Canvas and SVG.
+ [https://bugs.webkit.org/show_bug.cgi?id=30960]
+
+ Incorporate Benjamin Otte's recommendations to avoid
+ a buffer overrun, and small performance improvement.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::copyContextProperties): Correctly size output
+ storage for cairo_get_dash to avoid buffer overrun.
+ (WebCore::drawPathShadow): Prefer cairo_fill_extents
+ to slower cairo_stroke_extents when not drawing shadows.
+
2009-11-13 Dumitru Daniliuc <dumi at chromium.org>
Reviewed by Dimitri Glazkov.
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 11e7e6e..d280412 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -138,9 +138,13 @@ static inline void fillRectSourceOver(cairo_t* cr, const FloatRect& rect, const
static inline void copyContextProperties(cairo_t* srcCr, cairo_t* dstCr)
{
cairo_set_antialias(dstCr, cairo_get_antialias(srcCr));
- double dashes, offset;
- cairo_get_dash(srcCr, &dashes, &offset);
- cairo_set_dash(dstCr, &dashes, cairo_get_dash_count(srcCr), offset);
+
+ size_t dashCount = cairo_get_dash_count(srcCr);
+ Vector<double> dashes(dashCount);
+
+ double offset;
+ cairo_get_dash(srcCr, dashes.data(), &offset);
+ cairo_set_dash(dstCr, dashes.data(), dashCount, offset);
cairo_set_line_cap(dstCr, cairo_get_line_cap(srcCr));
cairo_set_line_join(dstCr, cairo_get_line_join(srcCr));
cairo_set_line_width(dstCr, cairo_get_line_width(srcCr));
@@ -176,7 +180,10 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva
cairo_t* cr = context->platformContext();
cairo_path_t* path = cairo_copy_path(cr);
double x0, x1, y0, y1;
- cairo_stroke_extents(cr, &x0, &y0, &x1, &y1);
+ if (strokeShadow)
+ cairo_stroke_extents(cr, &x0, &y0, &x1, &y1);
+ else
+ cairo_fill_extents(cr, &x0, &y0, &x1, &y1);
FloatRect rect(x0, y0, x1 - x0, y1 - y0);
IntSize shadowBufferSize;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list