summaryrefslogtreecommitdiff
path: root/poppler
diff options
context:
space:
mode:
Diffstat (limited to 'poppler')
-rw-r--r--poppler/CairoOutputDev.cc23
-rw-r--r--poppler/CairoOutputDev.h6
2 files changed, 12 insertions, 17 deletions
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 7407978a..fdb8a233 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -52,12 +52,12 @@ CairoOutputDev::CairoOutputDev() {
FT_Init_FreeType(&ft_lib);
fontEngine = NULL;
glyphs = NULL;
- surface = NULL;
fill_pattern = NULL;
stroke_pattern = NULL;
stroke_opacity = 1.0;
fill_opacity = 1.0;
textClipPath = NULL;
+ cairo = NULL;
}
CairoOutputDev::~CairoOutputDev() {
@@ -65,16 +65,19 @@ CairoOutputDev::~CairoOutputDev() {
delete fontEngine;
}
FT_Done_FreeType(ft_lib);
- cairo_surface_destroy (surface);
+ cairo_destroy (cairo);
cairo_pattern_destroy (stroke_pattern);
cairo_pattern_destroy (fill_pattern);
}
-void CairoOutputDev::setSurface(cairo_surface_t *surface)
+void CairoOutputDev::setCairo(cairo_t *cairo)
{
- cairo_surface_destroy (this->surface);
- cairo_surface_reference (surface);
- this->surface = surface;
+ if (this->cairo != NULL)
+ cairo_destroy (this->cairo);
+ if (cairo != NULL)
+ this->cairo = cairo_reference (cairo);
+ else
+ this->cairo = NULL;
}
void CairoOutputDev::startDoc(XRef *xrefA) {
@@ -85,14 +88,6 @@ void CairoOutputDev::startDoc(XRef *xrefA) {
fontEngine = new CairoFontEngine(ft_lib);
}
-void CairoOutputDev::startPage(int pageNum, GfxState *state) {
- cairo = cairo_create (surface);
-}
-
-void CairoOutputDev::endPage() {
- cairo_destroy (cairo);
-}
-
void CairoOutputDev::drawLink(Link *link, Catalog *catalog) {
}
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index bbf0ce44..f2c7284a 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -57,10 +57,10 @@ public:
//----- initialization and control
// Start a page.
- virtual void startPage(int pageNum, GfxState *state);
+ virtual void startPage(int pageNum, GfxState *state) { }
// End a page.
- virtual void endPage();
+ virtual void endPage() { }
//----- link borders
virtual void drawLink(Link *link, Catalog *catalog);
@@ -136,7 +136,7 @@ public:
GBool isReverseVideo() { return gFalse; }
- void setSurface (cairo_surface_t *surface);
+ void setCairo (cairo_t *cr);
protected:
void doPath(GfxState *state, GfxPath *path);