[cairo-commit] 3 commits - doc/public src/cairo.c src/cairo-clip.c src/cairo-font-face.c src/cairo-font-options.c src/cairo.h src/cairo-image-surface.c src/cairo-pattern.c src/cairo-png.c src/cairo-ps-surface.c src/cairo-quartz-surface.c src/cairo-recording-surface.c src/cairo-surface.c src/cairo-win32-printing-surface.c src/cairo-win32-surface.c

Andrea Canciani ranma42 at kemper.freedesktop.org
Sun Jan 16 09:41:32 PST 2011


 doc/public/cairo-sections.txt      |    1 
 doc/public/language-bindings.xml   |    2 -
 src/cairo-clip.c                   |    2 -
 src/cairo-font-face.c              |    6 ++---
 src/cairo-font-options.c           |    2 -
 src/cairo-image-surface.c          |    5 ++++
 src/cairo-pattern.c                |    6 +++--
 src/cairo-png.c                    |    8 +++++++
 src/cairo-ps-surface.c             |   39 ++++++++++++++++++-------------------
 src/cairo-quartz-surface.c         |    7 ++++++
 src/cairo-recording-surface.c      |   10 ++++-----
 src/cairo-surface.c                |    2 -
 src/cairo-win32-printing-surface.c |    2 -
 src/cairo-win32-surface.c          |    6 +++++
 src/cairo.c                        |   27 ++++++++++++++-----------
 src/cairo.h                        |   33 +++++++++++++++++--------------
 16 files changed, 97 insertions(+), 61 deletions(-)

New commits:
commit a35180714798ace2299aad531e2eacfa7968f16e
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Tue Dec 28 13:32:27 2010 +0100

    doc: Fix some broken references and gtk-doc warnings
    
    The gtk-doc comments contain some typos and are missing some escaping.

diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt
index bd25a8c..ec7c9f1 100644
--- a/doc/public/cairo-sections.txt
+++ b/doc/public/cairo-sections.txt
@@ -187,6 +187,7 @@ CAIRO_MIME_TYPE_JP2
 CAIRO_MIME_TYPE_JPEG
 CAIRO_MIME_TYPE_PNG
 CAIRO_MIME_TYPE_URI
+CAIRO_MIME_TYPE_UNIQUE_ID
 cairo_surface_t
 cairo_content_t
 cairo_surface_create_similar
diff --git a/doc/public/language-bindings.xml b/doc/public/language-bindings.xml
index c9a810c..3b879ad 100644
--- a/doc/public/language-bindings.xml
+++ b/doc/public/language-bindings.xml
@@ -395,7 +395,7 @@ public void writeToPNG (OutputStream stream) throws IOException;
     <remark>
       I'm not sure how to handle this for
       <link
-      linkend="cairo-pdf-surface-create-for-callback"><function>cairo_pdf_surface_create_for_callback()</function></link>.
+      linkend="cairo-pdf-surface-create-for-stream"><function>cairo_pdf_surface_create_for_stream()</function></link>.
       Other than keep a “exception to rethrow” thread-specific
       variable
       that is checked after <emphasis>every</emphasis> call to a Cairo
diff --git a/src/cairo-clip.c b/src/cairo-clip.c
index 6bf679b..f890c07 100644
--- a/src/cairo-clip.c
+++ b/src/cairo-clip.c
@@ -1557,7 +1557,7 @@ _cairo_clip_copy_rectangle_list (cairo_clip_t *clip, cairo_gstate_t *gstate)
 
 /**
  * cairo_rectangle_list_destroy:
- * @rectangle_list: a rectangle list, as obtained from cairo_copy_clip_rectangles()
+ * @rectangle_list: a rectangle list, as obtained from cairo_copy_clip_rectangle_list()
  *
  * Unconditionally frees @rectangle_list and all associated
  * references. After this call, the @rectangle_list pointer must not
diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c
index a66054e..e379b25 100644
--- a/src/cairo-font-face.c
+++ b/src/cairo-font-face.c
@@ -49,11 +49,11 @@
  *
  * #cairo_font_face_t represents a particular font at a particular weight,
  * slant, and other characteristic but no size, transformation, or size.
- * 
+ *
  * Font faces are created using <firstterm>font-backend</firstterm>-specific
  * constructors, typically of the form
- * cairo_<emphasis>backend</emphasis>_font_face_create(), or implicitly
- * using the <firstterm>toy</firstterm> text API by way of 
+ * <function>cairo_<emphasis>backend</emphasis>_font_face_create(<!-- -->)</function>,
+ * or implicitly using the <firstterm>toy</firstterm> text API by way of
  * cairo_select_font_face().  The resulting face can be accessed using
  * cairo_get_font_face().
  */
diff --git a/src/cairo-font-options.c b/src/cairo-font-options.c
index 5d59fb0..521d371 100644
--- a/src/cairo-font-options.c
+++ b/src/cairo-font-options.c
@@ -192,7 +192,7 @@ slim_hidden_def (cairo_font_options_status);
  * Merges non-default options from @other into @options, replacing
  * existing values. This operation can be thought of as somewhat
  * similar to compositing @other onto @options with the operation
- * of %CAIRO_OPERATION_OVER.
+ * of %CAIRO_OPERATOR_OVER.
  **/
 void
 cairo_font_options_merge (cairo_font_options_t       *options,
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index fa38f19..270ba1a 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -49,9 +49,11 @@
  * brush too.
  *
  * A cairo pattern is created by using one of the many constructors,
- * of the form cairo_pattern_create_<emphasis>type</emphasis>()
+ * of the form
+ * <function>cairo_pattern_create_<emphasis>type</emphasis>()</function>
  * or implicitly through
- * cairo_set_source_<emphasis>type</emphasis>() functions.
+ * <function>cairo_set_source_<emphasis>type</emphasis>()</function>
+ * functions.
  */
 
 #if HAS_FREED_POOL
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index beab433..12a9dcd 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -1356,12 +1356,12 @@ cairo_ps_surface_set_size (cairo_surface_t	*surface,
  * The comment is expected to conform to the PostScript Language
  * Document Structuring Conventions (DSC). Please see that manual for
  * details on the available comments and their meanings. In
- * particular, the %%IncludeFeature comment allows a
+ * particular, the \%\%IncludeFeature comment allows a
  * device-independent means of controlling printer device features. So
  * the PostScript Printer Description Files Specification will also be
  * a useful reference.
  *
- * The comment string must begin with a percent character (%) and the
+ * The comment string must begin with a percent character (\%) and the
  * total length of the string (including any initial percent
  * characters) must not exceed 255 characters. Violating either of
  * these conditions will place @surface into an error state. But
@@ -1379,40 +1379,41 @@ cairo_ps_surface_set_size (cairo_surface_t	*surface,
  *
  * For comments to appear in the header section, this function should
  * be called after the surface is created, but before a call to
- * cairo_ps_surface_begin_setup().
+ * cairo_ps_surface_dsc_begin_setup().
  *
  * For comments to appear in the Setup section, this function should
- * be called after a call to cairo_ps_surface_begin_setup() but before
- * a call to cairo_ps_surface_begin_page_setup().
+ * be called after a call to cairo_ps_surface_dsc_begin_setup() but
+ * before a call to cairo_ps_surface_dsc_begin_page_setup().
  *
  * For comments to appear in the PageSetup section, this function
- * should be called after a call to cairo_ps_surface_begin_page_setup().
+ * should be called after a call to
+ * cairo_ps_surface_dsc_begin_page_setup().
  *
- * Note that it is only necessary to call cairo_ps_surface_begin_page_setup()
- * for the first page of any surface. After a call to
- * cairo_show_page() or cairo_copy_page() comments are unambiguously
- * directed to the PageSetup section of the current page. But it
- * doesn't hurt to call this function at the beginning of every page
- * as that consistency may make the calling code simpler.
+ * Note that it is only necessary to call
+ * cairo_ps_surface_dsc_begin_page_setup() for the first page of any
+ * surface. After a call to cairo_show_page() or cairo_copy_page()
+ * comments are unambiguously directed to the PageSetup section of the
+ * current page. But it doesn't hurt to call this function at the
+ * beginning of every page as that consistency may make the calling
+ * code simpler.
  *
  * As a final note, cairo automatically generates several comments on
  * its own. As such, applications must not manually generate any of
  * the following comments:
  *
- * Header section: %!PS-Adobe-3.0, %%Creator, %%CreationDate, %%Pages,
- * %%BoundingBox, %%DocumentData, %%LanguageLevel, %%EndComments.
+ * Header section: \%!PS-Adobe-3.0, \%\%Creator, \%\%CreationDate, \%\%Pages,
+ * \%\%BoundingBox, \%\%DocumentData, \%\%LanguageLevel, \%\%EndComments.
  *
- * Setup section: %%BeginSetup, %%EndSetup
+ * Setup section: \%\%BeginSetup, \%\%EndSetup
  *
- * PageSetup section: %%BeginPageSetup, %%PageBoundingBox,
- * %%EndPageSetup.
+ * PageSetup section: \%\%BeginPageSetup, \%\%PageBoundingBox, \%\%EndPageSetup.
  *
- * Other sections: %%BeginProlog, %%EndProlog, %%Page, %%Trailer, %%EOF
+ * Other sections: \%\%BeginProlog, \%\%EndProlog, \%\%Page, \%\%Trailer, \%\%EOF
  *
  * Here is an example sequence showing how this function might be used:
  *
  * <informalexample><programlisting>
- * #cairo_surface_t *surface = cairo_ps_surface_create (filename, width, height);
+ * cairo_surface_t *surface = cairo_ps_surface_create (filename, width, height);
  * ...
  * cairo_ps_surface_dsc_comment (surface, "%%Title: My excellent document");
  * cairo_ps_surface_dsc_comment (surface, "%%Copyright: Copyright (C) 2006 Cairo Lover")
diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index f5f1014..ce8a95a 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -54,12 +54,12 @@
  * operations applied to the recording surface had instead been applied to the
  * target surface, you can use code like this:
  * <informalexample><programlisting>
- *      cairo_t *cr;
+ * cairo_t *cr;
  *
- *	cr = cairo_create (target);
- *	cairo_set_source_surface (cr, recording_surface, 0.0, 0.0);
- *	cairo_paint (cr);
- *	cairo_destroy (cr);
+ * cr = cairo_create (target);
+ * cairo_set_source_surface (cr, recording_surface, 0.0, 0.0);
+ * cairo_paint (cr);
+ * cairo_destroy (cr);
  * </programlisting></informalexample>
  *
  * A recording surface is logically unbounded, i.e. it has no implicit constraint
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 71b7e45..36eaa79 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -58,7 +58,7 @@
  *
  * A cairo surface is created by using <firstterm>backend</firstterm>-specific
  * constructors, typically of the form
- * cairo_<emphasis>backend</emphasis>_surface_create().
+ * <function>cairo_<emphasis>backend</emphasis>_surface_create(<!-- -->)</function>.
  *
  * Most surface types allow accessing the surface without using Cairo
  * functions. If you do this, keep in mind that it is mandatory that you call
diff --git a/src/cairo-win32-printing-surface.c b/src/cairo-win32-printing-surface.c
index af6f164..8023335 100644
--- a/src/cairo-win32-printing-surface.c
+++ b/src/cairo-win32-printing-surface.c
@@ -1784,7 +1784,7 @@ _cairo_win32_printing_surface_supports_fine_grained_fallbacks (void *abstract_su
  * possible to draw to the surface.
  *
  * The returned surface will be wrapped using the paginated surface to
- * provide correct complex rendering behaviour; show_page() and
+ * provide correct complex rendering behaviour; cairo_surface_show_page() and
  * associated methods must be used for correct output.
  *
  * Return value: the newly created surface
diff --git a/src/cairo.c b/src/cairo.c
index 3abcbb1..b87274a 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -345,7 +345,8 @@ _cairo_reset_static_data (void)
  * default values and with @target as a target surface. The target
  * surface should be constructed with a backend-specific function such
  * as cairo_image_surface_create() (or any other
- * cairo_<emphasis>backend</emphasis>_surface_create() variant).
+ * <function>cairo_<emphasis>backend</emphasis>_surface_create(<!-- -->)</function>
+ * variant).
  *
  * This function references @target, so you can immediately
  * call cairo_surface_destroy() on it if you don't need to
@@ -828,7 +829,7 @@ slim_hidden_def(cairo_pop_group);
  * operations:
  *
  * <informalexample><programlisting>
- * #cairo_pattern_t *group = cairo_pop_group (cr);
+ * cairo_pattern_t *group = cairo_pop_group (cr);
  * cairo_set_source (cr, group);
  * cairo_pattern_destroy (group);
  * </programlisting></informalexample>
@@ -1810,8 +1811,8 @@ slim_hidden_def (cairo_curve_to);
  * Adds a circular arc of the given @radius to the current path.  The
  * arc is centered at (@xc, @yc), begins at @angle1 and proceeds in
  * the direction of increasing angles to end at @angle2. If @angle2 is
- * less than @angle1 it will be progressively increased by 2*M_PI
- * until it is greater than @angle1.
+ * less than @angle1 it will be progressively increased by
+ * <literal>2*M_PI</literal> until it is greater than @angle1.
  *
  * If there is a current point, an initial line segment will be added
  * to the path to connect the current point to the beginning of the
@@ -1819,11 +1820,12 @@ slim_hidden_def (cairo_curve_to);
  * calling cairo_new_sub_path() before calling cairo_arc().
  *
  * Angles are measured in radians. An angle of 0.0 is in the direction
- * of the positive X axis (in user space). An angle of %M_PI/2.0 radians
- * (90 degrees) is in the direction of the positive Y axis (in
- * user space). Angles increase in the direction from the positive X
- * axis toward the positive Y axis. So with the default transformation
- * matrix, angles increase in a clockwise direction.
+ * of the positive X axis (in user space). An angle of
+ * <literal>M_PI/2.0</literal> radians (90 degrees) is in the
+ * direction of the positive Y axis (in user space). Angles increase
+ * in the direction from the positive X axis toward the positive Y
+ * axis. So with the default transformation matrix, angles increase in
+ * a clockwise direction.
  *
  * (To convert from degrees to radians, use <literal>degrees * (M_PI /
  * 180.)</literal>.)
@@ -1890,8 +1892,8 @@ cairo_arc (cairo_t *cr,
  * Adds a circular arc of the given @radius to the current path.  The
  * arc is centered at (@xc, @yc), begins at @angle1 and proceeds in
  * the direction of decreasing angles to end at @angle2. If @angle2 is
- * greater than @angle1 it will be progressively decreased by 2*M_PI
- * until it is less than @angle1.
+ * greater than @angle1 it will be progressively decreased by
+ * <literal>2*M_PI</literal> until it is less than @angle1.
  *
  * See cairo_arc() for more details. This function differs only in the
  * direction of the arc between the two angles.
@@ -3796,7 +3798,8 @@ slim_hidden_def (cairo_get_tolerance);
  * cairo_get_antialias:
  * @cr: a cairo context
  *
- * Gets the current shape antialiasing mode, as set by cairo_set_shape_antialias().
+ * Gets the current shape antialiasing mode, as set by
+ * cairo_set_antialias().
  *
  * Return value: the current shape antialiasing mode.
  **/
diff --git a/src/cairo.h b/src/cairo.h
index 2addb68..e087d89 100644
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -152,8 +152,8 @@ typedef struct _cairo_surface cairo_surface_t;
  * A #cairo_device_t represents the driver interface for drawing
  * operations to a #cairo_surface_t.  There are different subtypes of
  * #cairo_device_t for different drawing backends; for example,
- * cairo_xcb_device_create() creates a device that wraps the connection
- * to an X Windows System using the XCB library.
+ * cairo_egl_device_create() creates a device that wraps an EGL display and
+ * context.
  *
  * The type of a device can be queried with cairo_device_get_type().
  *
@@ -196,9 +196,10 @@ typedef struct _cairo_matrix {
  * cairo_pattern_create_rgb() creates a pattern for a solid
  * opaque color.
  *
- * Other than various cairo_pattern_create_<emphasis>type</emphasis>()
- * functions, some of the pattern types can be implicitly created
- * using various cairo_set_source_<emphasis>type</emphasis>() functions;
+ * Other than various
+ * <function>cairo_pattern_create_<emphasis>type</emphasis>()</function>
+ * functions, some of the pattern types can be implicitly created using various
+ * <function>cairo_set_source_<emphasis>type</emphasis>()</function> functions;
  * for example cairo_set_source_rgb().
  *
  * The type of a pattern can be queried with cairo_pattern_get_type().
@@ -1202,8 +1203,8 @@ typedef enum _cairo_hint_metrics {
  *
  * Individual features of a #cairo_font_options_t can be set or
  * accessed using functions named
- * cairo_font_options_set_<emphasis>feature_name</emphasis> and
- * cairo_font_options_get_<emphasis>feature_name</emphasis>, like
+ * <function>cairo_font_options_set_<emphasis>feature_name</emphasis>()</function> and
+ * <function>cairo_font_options_get_<emphasis>feature_name</emphasis>()</function>, like
  * cairo_font_options_set_antialias() and
  * cairo_font_options_get_antialias().
  *
@@ -1369,8 +1370,8 @@ cairo_font_face_status (cairo_font_face_t *font_face);
  *
  * The type of a font face is determined by the function used to
  * create it, which will generally be of the form
- * cairo_<emphasis>type</emphasis>_font_face_create(). The font face type can be queried
- * with cairo_font_face_get_type()
+ * <function>cairo_<emphasis>type</emphasis>_font_face_create(<!-- -->)</function>.
+ * The font face type can be queried with cairo_font_face_get_type()
  *
  * The various #cairo_font_face_t functions can be used with a font face
  * of any type.
@@ -1383,7 +1384,8 @@ cairo_font_face_status (cairo_font_face_t *font_face);
  * fonts of any type, but some font backends also provide
  * type-specific functions that must only be called with a scaled font
  * of the appropriate type. These functions have names that begin with
- * cairo_<emphasis>type</emphasis>_scaled_font() such as cairo_ft_scaled_font_lock_face().
+ * <function>cairo_<emphasis>type</emphasis>_scaled_font(<!-- -->)</function>
+ * such as cairo_ft_scaled_font_lock_face().
  *
  * The behavior of calling a type-specific function with a scaled font
  * of the wrong type is undefined.
@@ -1952,7 +1954,6 @@ cairo_device_reference (cairo_device_t *device);
  * @CAIRO_DEVICE_TYPE_XCB: The surface is of type xcb
  * @CAIRO_DEVICE_TYPE_XLIB: The surface is of type xlib
  * @CAIRO_DEVICE_TYPE_XML: The surface is of type XML
- *   cairo_surface_create_for_rectangle()
  *
  * #cairo_device_type_t is used to describe the type of a given
  * device. The devices types are also known as "backends" within cairo.
@@ -1963,7 +1964,8 @@ cairo_device_reference (cairo_device_t *device);
  * any type, but some backends also provide type-specific functions
  * that must only be called with a device of the appropriate
  * type. These functions have names that begin with
- * cairo_<emphasis>type</emphasis>_device<!-- --> such as cairo_xcb_device_debug_set_render_version().
+ * <literal>cairo_<emphasis>type</emphasis>_device</literal> such as
+ * cairo_xcb_device_debug_cap_xrender_version().
  *
  * The behavior of calling a type-specific function with a surface of
  * the wrong type is undefined.
@@ -2082,7 +2084,8 @@ cairo_surface_status (cairo_surface_t *surface);
  * backends" within cairo.
  *
  * The type of a surface is determined by the function used to create
- * it, which will generally be of the form cairo_<emphasis>type</emphasis>_surface_create(),
+ * it, which will generally be of the form
+ * <function>cairo_<emphasis>type</emphasis>_surface_create(<!-- -->)</function>,
  * (though see cairo_surface_create_similar() as well).
  *
  * The surface type can be queried with cairo_surface_get_type()
@@ -2091,7 +2094,7 @@ cairo_surface_status (cairo_surface_t *surface);
  * any type, but some backends also provide type-specific functions
  * that must only be called with a surface of the appropriate
  * type. These functions have names that begin with
- * cairo_<emphasis>type</emphasis>_surface<!-- --> such as cairo_image_surface_get_width().
+ * <literal>cairo_<emphasis>type</emphasis>_surface</literal> such as cairo_image_surface_get_width().
  *
  * The behavior of calling a type-specific function with a surface of
  * the wrong type is undefined.
@@ -2509,7 +2512,7 @@ cairo_pattern_get_extend (cairo_pattern_t *pattern);
  *
  * #cairo_filter_t is used to indicate what filtering should be
  * applied when reading pixel values from patterns. See
- * cairo_pattern_set_source() for indicating the desired filter to be
+ * cairo_pattern_set_filter() for indicating the desired filter to be
  * used with a particular pattern.
  */
 typedef enum _cairo_filter {
commit 32241cde01a2a095f04c0b110067d4c1571f9cbd
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Sun Jan 16 18:40:42 2011 +0100

    doc: Add links to flush() and mark_dirty() in direct access functions
    
    cairo_image_get_data() and other direct access functions are often
    misused by applications because they don't call cairo_surface_flush()
    and/or cairo_surface_mark_dirty() around the code which accesses the
    surface data directly.
    
    Although this information is already available in the description of
    the cairo_surface_t type, adding a reminder about it in the direct
    access functions should make it easier to use them correctly.

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 7820f57..6082215 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -524,6 +524,11 @@ slim_hidden_def (cairo_image_surface_create_for_data);
  * Get a pointer to the data of the image surface, for direct
  * inspection or modification.
  *
+ * A call to cairo_surface_flush() is required before accessing the
+ * pixel data to ensure that all pending drawing operations are
+ * finished. A call to cairo_surface_mark_dirty() is required after
+ * the data is modified.
+ *
  * Return value: a pointer to the image data of this surface or %NULL
  * if @surface is not an image surface, or if cairo_surface_finish()
  * has been called.
diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c
index c5fbe03..06dd128 100644
--- a/src/cairo-quartz-surface.c
+++ b/src/cairo-quartz-surface.c
@@ -2714,6 +2714,13 @@ cairo_quartz_surface_create (cairo_format_t format,
  * Returns the CGContextRef that the given Quartz surface is backed
  * by.
  *
+ * A call to cairo_surface_flush() is required before using the
+ * CGContextRef to ensure that all pending drawing operations are
+ * finished and to restore any temporary modification cairo has made
+ * to its state. A call to cairo_surface_mark_dirty() is required
+ * after the state or the content of the CGContextRef has been
+ * modified.
+ *
  * Return value: the CGContextRef for the given surface.
  *
  * Since: 1.4
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index c335d97..da8acca 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -1849,6 +1849,12 @@ _cairo_surface_is_win32 (cairo_surface_t *surface)
  * Returns the HDC associated with this surface, or %NULL if none.
  * Also returns %NULL if the surface is not a win32 surface.
  *
+ * A call to cairo_surface_flush() is required before using the HDC to
+ * ensure that all pending drawing operations are finished and to
+ * restore any temporary modification cairo has made to its state. A
+ * call to cairo_surface_mark_dirty() is required after the state or
+ * the content of the HDC has been modified.
+ *
  * Return value: HDC or %NULL if no HDC available.
  *
  * Since: 1.2
commit 01c66d34c387a2d2b9114a9fccc7491ad7ff1315
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Tue Dec 28 11:34:02 2010 +0100

    doc: Add a remark about toy status of the PNG API
    
    The PNG API is just a toy API whose main purpose is to make it easy to
    write minimal examples of cairo features or testcases for bugs. For
    these purposes there is no need to tune the output PNG file or to
    provide additional information in optional PNG chuncks, but real
    applications need to do that quite often. The documentation now points
    out what is the correct procedure to write image data to a file.

diff --git a/src/cairo-png.c b/src/cairo-png.c
index 41a33d7..f5c7cb5 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -53,6 +53,14 @@
  *
  * The PNG functions allow reading PNG images into image surfaces, and writing
  * any surface to a PNG file.
+ *
+ * It is a toy API. It only offers very simple support for reading and
+ * writing PNG files, which is sufficient for testing and
+ * demonstration purposes. Applications which need more control over
+ * the generated PNG file should access the pixel data directly, using
+ * cairo_image_surface_get_data() or a backend-specific access
+ * function, and process it with another library, e.g. gdk-pixbuf or
+ * libpng.
  */
 
 /**


More information about the cairo-commit mailing list