[poppler] poppler/poppler: CairoOutputDev.cc, 1.10, 1.11 CairoOutputDevImage.cc, 1.4, 1.5 CairoOutputDevX.cc, 1.1.1.1, 1.2

Kristian Hogsberg krh at freedesktop.org
Thu May 12 14:26:27 PDT 2005


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

Modified Files:
	CairoOutputDev.cc CairoOutputDevImage.cc CairoOutputDevX.cc 
Log Message:
2005-05-12  Kristian Høgsberg  <krh at redhat.com>

        * poppler/CairoOutputDev.cc:
        * poppler/CairoOutputDevX.cc:
        * poppler/CairoOutputDevImage.cc:
        * test/gtk-cairo-test.cc: Update to latest cairo changes, patch
        from Jens Taprogge (#3281)



Index: CairoOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/CairoOutputDev.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- CairoOutputDev.cc	4 May 2005 20:08:41 -0000	1.10
+++ CairoOutputDev.cc	12 May 2005 21:26:25 -0000	1.11
@@ -77,7 +77,7 @@
   createCairo (state);
   
   cairo_reset_clip (cairo);
-  cairo_set_rgb_color (cairo, 0, 0, 0);
+  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);
@@ -283,7 +283,7 @@
 
 void CairoOutputDev::stroke(GfxState *state) {
   doPath (state, state->getPath(), gFalse);
-  cairo_set_rgb_color (cairo,
+  cairo_set_source_rgb (cairo,
 		       stroke_color.r, stroke_color.g, stroke_color.b);
   LOG(printf ("stroke\n"));
   cairo_stroke (cairo);
@@ -292,7 +292,7 @@
 void CairoOutputDev::fill(GfxState *state) {
   doPath (state, state->getPath(), gFalse);
   cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING);
-  cairo_set_rgb_color (cairo,
+  cairo_set_source_rgb (cairo,
 		       fill_color.r, fill_color.g, fill_color.b);
   LOG(printf ("fill\n"));
   cairo_fill (cairo);
@@ -301,7 +301,7 @@
 void CairoOutputDev::eoFill(GfxState *state) {
   doPath (state, state->getPath(), gFalse);
   cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_EVEN_ODD);
-  cairo_set_rgb_color (cairo,
+  cairo_set_source_rgb (cairo,
 		       fill_color.r, fill_color.g, fill_color.b);
   LOG(printf ("fill-eo\n"));
   cairo_fill (cairo);
@@ -410,7 +410,7 @@
   // fill
   if (!(render & 1)) {
     LOG (printf ("fill string\n"));
-    cairo_set_rgb_color (cairo,
+    cairo_set_source_rgb (cairo,
 			 fill_color.r, fill_color.g, fill_color.b);
     cairo_show_glyphs (cairo, glyphs, count);
   }
@@ -418,7 +418,7 @@
   // stroke
   if ((render & 3) == 1 || (render & 3) == 2) {
     LOG (printf ("stroke string\n"));
-    cairo_set_rgb_color (cairo,
+    cairo_set_source_rgb (cairo,
 			 stroke_color.r, stroke_color.g, stroke_color.b);
     cairo_glyph_path (cairo, glyphs, count);
     cairo_stroke (cairo);
@@ -497,7 +497,7 @@
     }
   }
 
-  image = cairo_surface_create_for_image (buffer, CAIRO_FORMAT_A8,
+  image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_A8,
 					  width, height, row_stride);
   if (image == NULL)
     return;
@@ -517,7 +517,7 @@
   cairo_matrix_invert (&matrix);
   cairo_pattern_set_matrix (pattern, &matrix);
 
-  cairo_surface_set_filter (image, CAIRO_FILTER_BEST);
+  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BEST);
   /* FIXME: Doesn't the image mask support any colorspace? */
   cairo_set_source_rgb (cairo, fill_color.r, fill_color.g, fill_color.b);
   cairo_mask (cairo, pattern);
@@ -594,8 +594,8 @@
     }
   }
 
-  image = cairo_surface_create_for_image (buffer, CAIRO_FORMAT_ARGB32,
-					  width, height, width * 4);
+  image = cairo_image_surface_create_for_data (buffer, CAIRO_FORMAT_ARGB32,
+					       width, height, width * 4);
   if (image == NULL)
     return;
   pattern = cairo_pattern_create_for_surface (image);
@@ -615,7 +615,7 @@
   cairo_matrix_invert (&matrix);
   cairo_pattern_set_matrix (pattern, &matrix);
 
-  cairo_surface_set_filter (image, CAIRO_FILTER_BEST);
+  cairo_pattern_set_filter (pattern, CAIRO_FILTER_BEST);
   cairo_set_source (cairo, pattern);
   cairo_paint (cairo);
 

Index: CairoOutputDevImage.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/CairoOutputDevImage.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CairoOutputDevImage.cc	2 May 2005 05:39:11 -0000	1.4
+++ CairoOutputDevImage.cc	12 May 2005 21:26:25 -0000	1.5
@@ -40,6 +40,7 @@
 void
 CairoOutputDevImage::createCairo(GfxState *state) {
   int w, h;
+  cairo_surface_t* surface;
 
   w = state ? (int)(state->getPageWidth() + 0.5) : 1;
   h = state ? (int)(state->getPageHeight() + 0.5) : 1;
@@ -55,11 +56,11 @@
 
   memset (pixels, 0xff, pixels_w * pixels_h * 4);
 
-  cairo = cairo_create ();
-  cairo_set_target_image (cairo, (unsigned char *)pixels, CAIRO_FORMAT_ARGB32,
-			  pixels_w, pixels_h,
-			  pixels_w*4);
-  
+  surface = cairo_image_surface_create_for_data(pixels, CAIRO_FORMAT_ARGB32,
+	  					pixels_w, pixels_h, 
+						pixels_w*4);
+  cairo = cairo_create (surface);
+  cairo_surface_destroy (surface);
 }
 
 

Index: CairoOutputDevX.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/CairoOutputDevX.cc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- CairoOutputDevX.cc	3 Mar 2005 19:46:01 -0000	1.1.1.1
+++ CairoOutputDevX.cc	12 May 2005 21:26:25 -0000	1.2
@@ -84,6 +84,7 @@
   int w, h;
   XGCValues gcv;
   GC gc;
+  cairo_surface_t *surface;
 
   w = state ? (int)(state->getPageWidth() + 0.5) : 1;
   h = state ? (int)(state->getPageHeight() + 0.5) : 1;
@@ -107,8 +108,10 @@
   gc = XCreateGC(display, pixmap, GCForeground, &gcv);
   XFillRectangle(display, pixmap, gc, 0, 0, w, h);
 
-  cairo = cairo_create ();
-  cairo_set_target_drawable (cairo, display, pixmap);
+  surface = cairo_xlib_surface_create_for_pixmap_with_visual(display, pixmap,
+						             DefaultVisual(display, DefaultScreen(display)));
+  cairo = cairo_create (surface);
+  cairo_surface_destroy (surface);
 
   XFreeGC(display, gc);
 }



More information about the poppler mailing list