From 7cc98c191a5362926daae7b31e36f8ae709d9b60 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Thu, 26 Jun 2008 15:32:30 +0000 Subject: add CairoRenderContext::renderPathVector (bzr r6074) --- src/extension/internal/cairo-render-context.cpp | 13 +++++++++++++ src/extension/internal/cairo-render-context.h | 2 ++ 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 3ec94af63..b19e4b316 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include <2geom/pathvector.h> #include @@ -1244,6 +1246,17 @@ CairoRenderContext::_setStrokeStyle(SPStyle const *style, NRRect const *pbox) cairo_set_miter_limit(_cr, MAX(1, style->stroke_miterlimit.value)); } +bool +CairoRenderContext::renderPathVector(Geom::PathVector const & pathv, SPStyle const *style, NRRect const *pbox) +{ + NArtBpath * bpath = BPath_from_2GeomPath (pathv); + const_NRBPath *bp; + bp->path = bpath; + bool retvalue = renderPath(bp, style, pbox); + g_free(bpath); + return retvalue; +} + bool CairoRenderContext::renderPath(const_NRBPath const *bpath, SPStyle const *style, NRRect const *pbox) { diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h index 642c6d90e..68a615234 100644 --- a/src/extension/internal/cairo-render-context.h +++ b/src/extension/internal/cairo-render-context.h @@ -23,6 +23,7 @@ #include "libnr/nr-path.h" #include +#include <2geom/forward.h> #include "style.h" @@ -136,6 +137,7 @@ public: void addClippingRect(double x, double y, double width, double height); /* Rendering methods */ + bool renderPathVector(Geom::PathVector const & pathv, SPStyle const *style, NRRect const *pbox); bool renderPath(const_NRBPath const *bpath, SPStyle const *style, NRRect const *pbox); bool renderImage(unsigned char *px, unsigned int w, unsigned int h, unsigned int rs, NR::Matrix const *image_transform, SPStyle const *style); -- cgit v1.2.3