[poppler] poppler/poppler: CairoOutputDev.cc, 1.15, 1.16 CairoOutputDev.h, 1.5, 1.6 CairoOutputDevImage.cc, 1.5, NONE CairoOutputDevImage.h, 1.2, NONE CairoOutputDevX.cc, 1.4, NONE CairoOutputDevX.h, 1.1.1.1, NONE Makefile.am, 1.7, 1.8

Kristian Hogsberg krh at freedesktop.org
Mon Jun 27 20:44:14 PDT 2005


Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv19147/poppler

Modified Files:
	CairoOutputDev.cc CairoOutputDev.h Makefile.am 
Removed Files:
	CairoOutputDevImage.cc CairoOutputDevImage.h 
	CairoOutputDevX.cc CairoOutputDevX.h 
Log Message:
2005-06-27  Kristian Høgsberg  <krh at redhat.com>

        * poppler/CairoOutputDev.cc:
        * poppler/CairoOutputDev.h: Change CairoOutputDev to render to a
        given surface and let the user create that surface.

        * glib/poppler-document.cc:
        * glib/poppler-page.cc:
        * glib/poppler-private.h: Create the cairo image surface here
        instead and pass it to the CairoOutputDev for rendering.

        * poppler/CairoOutputDevImage.cc:
        * poppler/CairoOutputDevImage.h:
        * poppler/CairoOutputDevX.cc:
        * poppler/CairoOutputDevX.h:
        * poppler/Makefile.am: Remove specialized cairo output devices.



Index: CairoOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/CairoOutputDev.cc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- CairoOutputDev.cc	27 Jun 2005 01:04:33 -0000	1.15
+++ CairoOutputDev.cc	28 Jun 2005 03:44:12 -0000	1.16
@@ -48,20 +48,27 @@
 // CairoOutputDev
 //------------------------------------------------------------------------
 
-CairoOutputDev::CairoOutputDev(void) {
+CairoOutputDev::CairoOutputDev() {
   xref = NULL;
 
   FT_Init_FreeType(&ft_lib);
   fontEngine = NULL;
+  surface = NULL;
 }
 
 CairoOutputDev::~CairoOutputDev() {
   if (fontEngine) {
     delete fontEngine;
   }
-  cairo_destroy (cairo);
   FT_Done_FreeType(ft_lib);
+  cairo_surface_destroy (surface);
+}
 
+void CairoOutputDev::setSurface(cairo_surface_t *surface)
+{
+  cairo_surface_destroy (this->surface);
+  cairo_surface_reference (surface);
+  this->surface = surface;
 }
 
 void CairoOutputDev::startDoc(XRef *xrefA) {
@@ -73,20 +80,11 @@
 }
 
 void CairoOutputDev::startPage(int pageNum, GfxState *state) {
-  cairo_destroy (cairo);
-  createCairo (state);
-  
-  cairo_reset_clip (cairo);
-  cairo_set_source_rgb (cairo, 0, 0, 0);
-  cairo_set_operator (cairo, CAIRO_OPERATOR_OVER);
-  cairo_set_line_cap (cairo, CAIRO_LINE_CAP_BUTT);
-  cairo_set_line_join (cairo, CAIRO_LINE_JOIN_MITER);
-  cairo_set_dash (cairo, NULL, 0, 0.0);
-  cairo_set_miter_limit (cairo, 10);
-  //  cairo_set_tolerance (cairo, 1);
+  cairo = cairo_create (surface);
 }
 
 void CairoOutputDev::endPage() {
+  cairo_destroy (cairo);
 }
 
 void CairoOutputDev::drawLink(Link *link, Catalog *catalog) {

Index: CairoOutputDev.h
===================================================================
RCS file: /cvs/poppler/poppler/poppler/CairoOutputDev.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- CairoOutputDev.h	27 Jun 2005 01:04:33 -0000	1.5
+++ CairoOutputDev.h	28 Jun 2005 03:44:12 -0000	1.6
@@ -36,7 +36,7 @@
 public:
 
   // Constructor.
-  CairoOutputDev(void);
+  CairoOutputDev();
 
   // Destructor.
   virtual ~CairoOutputDev();
@@ -130,8 +130,9 @@
  
   GBool isReverseVideo() { return gFalse; }
   
+  void setSurface (cairo_surface_t *surface);
+
 protected:
-  virtual void createCairo(GfxState *state) = 0;
   void doPath(GfxState *state, GfxPath *path, GBool snapToGrid);
   
   GfxRGB fill_color;
@@ -144,10 +145,9 @@
 
   FT_Library ft_lib;
   CairoFontEngine *fontEngine;
-  unsigned char *pixels;
-  int pixels_w, pixels_h;
   cairo_t *cairo;
   GBool needFontUpdate;		// set when the font needs to be updated
+  cairo_surface_t *surface;
   cairo_glyph_t *glyphs;
   int glyphCount;
 };

--- CairoOutputDevImage.cc DELETED ---

--- CairoOutputDevImage.h DELETED ---

--- CairoOutputDevX.cc DELETED ---

--- CairoOutputDevX.h DELETED ---

Index: Makefile.am
===================================================================
RCS file: /cvs/poppler/poppler/poppler/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Makefile.am	13 Jun 2005 16:09:34 -0000	1.7
+++ Makefile.am	28 Jun 2005 03:44:12 -0000	1.8
@@ -20,15 +20,11 @@
 
 cairo_sources =					\
 	CairoFontEngine.cc			\
-	CairoOutputDev.cc			\
-	CairoOutputDevImage.cc			\
-	CairoOutputDevX.cc
+	CairoOutputDev.cc
 
 cairo_headers =					\
 	CairoFontEngine.h			\
-	CairoOutputDev.h			\
-	CairoOutputDevImage.h			\
-	CairoOutputDevX.h
+	CairoOutputDev.h
 
 cairo_includes =				\
 	$(CAIRO_CFLAGS)



More information about the poppler mailing list