[cairo-commit] 2 commits - src/cairo.h src/cairo-ps-surface.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Fri Dec 9 06:13:34 PST 2011


 src/cairo-ps-surface.c |   10 +++-------
 src/cairo.h            |    6 +++---
 2 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit be288ce016e4f56fac298bae603a5e5fa5f26df5
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat Dec 10 00:40:54 2011 +1030

    doc: fix typos

diff --git a/src/cairo.h b/src/cairo.h
index 2b575c9..d5f5861 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -2493,7 +2493,7 @@ cairo_recording_surface_get_extents (cairo_surface_t *surface,
  * area. For convenience the surface should probably be of image type,
  * created with cairo_surface_create_similar_image() for the target (which
  * enables the number of copies to be reduced during transfer to the
- * device). Anothjr option, might be to return a similar surface to the
+ * device). Another option, might be to return a similar surface to the
  * target for explicit handling by the application of a set of cached sources
  * on the device. The region of sample data provided should be defined using
  * cairo_surface_set_device_offset() to specify the top-left corner of the
@@ -2532,7 +2532,7 @@ typedef void
  * @pattern: the pattern being rendered from
  * @callback_data: the user data supplied during creation
  *
- * #cairo_raster_source_release_func_t is the type of function which is
+ * #cairo_raster_source_snapshot_func_t is the type of function which is
  * called when the pixel data needs to be preserved for later use
  * during printing. This pattern will be accessed again later, and it
  * is expected to provide the pixel data that was current at the time
@@ -2564,7 +2564,7 @@ typedef cairo_status_t
  * @pattern: the pattern being rendered from
  * @callback_data: the user data supplied during creation
  *
- * #cairo_raster_source_copy_func_t is the type of function which is
+ * #cairo_raster_source_finish_func_t is the type of function which is
  * called when the pattern (or a copy thereof) is no longer required.
  *
  * Since: 1.12
commit c7ea92907a7eaaf62136755d0b6c60da913d1057
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Dec 9 23:52:00 2011 +1030

    ps: simplify the EPS save and restore
    
    userdict is not permitted in EPS files. Since the PS surface does not
    leave extra operators or dictionaries on the stack the EPS prolog and
    trailer can be reduced to:
    
    save
    50 dict begin
    
    ....
    
    end
    restore
    
    The save/restore pair is required to remove fonts and restore the
    graphics state. As "restore" does not restore the dictionary stack,
    using a new current dictionary for the EPS file allows the cairo dict
    entries to be cleaned up at the end the EPS.
    
    Bug 43634

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index f206adc..9dfd9d0 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -268,10 +268,8 @@ _cairo_ps_surface_emit_header (cairo_ps_surface_t *surface)
 
     if (surface->eps) {
 	_cairo_output_stream_printf (surface->final_stream,
-				     "/cairo_eps_state save def\n"
-				     "/dict_count countdictstack def\n"
-				     "/op_count count 1 sub def\n"
-				     "userdict begin\n");
+				     "save\n"
+				     "50 dict begin\n");
     } else {
 	_cairo_output_stream_printf (surface->final_stream,
 				     "/languagelevel where\n"
@@ -807,9 +805,7 @@ _cairo_ps_surface_emit_footer (cairo_ps_surface_t *surface)
 
     if (surface->eps) {
 	_cairo_output_stream_printf (surface->final_stream,
-				     "count op_count sub {pop} repeat\n"
-				     "countdictstack dict_count sub {end} repeat\n"
-				     "cairo_eps_state restore\n");
+				     "end restore\n");
     }
 
     _cairo_output_stream_printf (surface->final_stream,


More information about the cairo-commit mailing list