summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/cairo/PathCairo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/cairo/PathCairo.cpp')
-rw-r--r--WebCore/platform/graphics/cairo/PathCairo.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index e4c9f72..3f8d588 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -76,15 +76,15 @@ void Path::clear()
bool Path::isEmpty() const
{
- // FIXME: if/when the patch to get current pt return status is applied
- // double dx,dy;
- // return cairo_get_current_point(cr, &dx, &dy);
-
cairo_t* cr = platformPath()->m_cr;
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,5,10)
+ return !cairo_has_current_point(cr);
+#else
cairo_path_t* p = cairo_copy_path(cr);
bool hasData = p->num_data;
cairo_path_destroy(p);
return !hasData;
+#endif
}
void Path::translate(const FloatSize& p)
@@ -180,7 +180,11 @@ FloatRect Path::boundingRect() const
{
cairo_t* cr = platformPath()->m_cr;
double x0, x1, y0, y1;
- cairo_fill_extents(cr, &x0, &y0, &x1, &y1);
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 6, 0)
+ cairo_path_extents(cr, &x0, &y0, &x1, &y1);
+#else
+ cairo_stroke_extents(cr, &x0, &y0, &x1, &y1);
+#endif
return FloatRect(x0, y0, x1 - x0, y1 - y0);
}
@@ -239,6 +243,7 @@ void Path::transform(const AffineTransform& trans)
{
cairo_t* m_cr = platformPath()->m_cr;
cairo_matrix_t c_matrix = cairo_matrix_t(trans);
+ cairo_matrix_invert(&c_matrix);
cairo_transform(m_cr, &c_matrix);
}