[cairo-commit] 16 commits - src/cairoint.h src/cairo-paginated-surface.c src/cairo-pdf-surface.c src/cairo-ps-surface.c src/cairo-surface.c src/cairo-xlib-surface.c test/buffer-diff.c test/cairo-test.c test/caps-joins-alpha-svg-argb32-ref.png test/caps-joins-alpha-svg-ref.png test/caps-joins-alpha-svg-rgb24-ref.png test/caps-joins-ps-argb32-ref.png test/caps-sub-paths-ps-argb32-ref.png test/clip-fill-rule-ps-argb32-ref.png test/clip-nesting-ps-argb32-ref.png test/clip-operator.c test/clip-twice-ps-argb32-ref.png test/composite-integer-translate-over-svg-argb32-ref.png test/composite-integer-translate-over-svg-ref.png test/composite-integer-translate-over-svg-rgb24-ref.png test/dash-caps-joins-ps-argb32-ref.png test/dash-offset-negative-ps-argb32-ref.png test/dash-scale-ps-argb32-ref.png test/dash-zero-length-ps-argb32-ref.png test/degenerate-path-ps-argb32-ref.png test/fill-and-stroke-alpha-svg-argb32-ref.png test/fill-and-stroke-alpha-svg-ref.png test/fill-and-stroke-alpha-svg-rgb24-ref.png test/fill-and-stroke-ps-argb32-ref.png test/fill-rule-ps-argb32-ref.png test/font-matrix-translation.c test/font-matrix-translation-ps-argb32-ref.png test/font-matrix-translation-svg-ref.png test/ft-font-create-for-ft-face.c test/ft-text-antialias-none.c test/ft-text-antialias-none-ps-argb32-ref.png test/ft-text-vertical-layout.c test/ft-text-vertical-layout-pdf-argb32-ref.png test/ft-text-vertical-layout-ps-argb32-ref.png test/ft-text-vertical-layout-ref.png test/ft-text-vertical-layout-svg-argb32-ref.png test/ft-text-vertical-layout-svg-ref.png test/ft-text-vertical-layout-svg-rgb24-ref.png test/glyph-cache-pressure.c test/glyph-cache-pressure-pdf-argb32-ref.png test/glyph-cache-pressure-ps-argb32-ref.png test/glyph-cache-pressure-svg-argb32-ref.png test/glyph-cache-pressure-svg-ref.png test/glyph-cache-pressure-svg-rgb24-ref.png test/leaky-polygon-ps-argb32-ref.png test/linear-gradient-svg-argb32-ref.png test/linear-gradient-svg-ref.png test/linear-gradient-svg-rgb24-ref.png test/line-width-ps-argb32-ref.png test/line-width-scale-ps-argb32-ref.png test/new-sub-path-ps-argb32-ref.png test/operator-clear.c test/operator-source.c test/paint-source-alpha-svg-argb32-ref.png test/paint-source-alpha-svg-ref.png test/paint-source-alpha-svg-rgb24-ref.png test/paint-with-alpha-svg-argb32-ref.png test/paint-with-alpha-svg-ref.png test/paint-with-alpha-svg-rgb24-ref.png test/path-data-ps-argb32-ref.png test/pixman-rotate-svg-argb32-ref.png test/pixman-rotate-svg-rgb24-ref.png test/rectangle-rounding-error-ps-argb32-ref.png test/select-font-face.c test/select-font-face-pdf-argb32-ref.png test/select-font-face-ps-argb32-ref.png test/select-font-face-ref.png test/select-font-face-svg-argb32-ref.png test/select-font-face-svg-ref.png test/select-font-face-svg-rgb24-ref.png test/show-glyphs-many.c test/show-text-current-point.c test/show-text-current-point-pdf-argb32-ref.png test/show-text-current-point-ps-argb32-ref.png test/show-text-current-point-svg-argb32-ref.png test/show-text-current-point-svg-ref.png test/show-text-current-point-svg-rgb24-ref.png test/text-antialias-gray.c test/text-antialias-gray-pdf-argb32-ref.png test/text-antialias-gray-ps-argb32-ref.png test/text-antialias-gray-svg-argb32-ref.png test/text-antialias-gray-svg-rgb24-ref.png test/text-antialias-none.c test/text-antialias-none-pdf-argb32-ref.png test/text-antialias-none-ps-argb32-ref.png test/text-antialias-none-svg-argb32-ref.png test/text-antialias-none-svg-rgb24-ref.png test/text-antialias-subpixel.c test/text-antialias-subpixel-pdf-argb32-ref.png test/text-antialias-subpixel-ps-argb32-ref.png test/text-antialias-subpixel-svg-argb32-ref.png test/text-antialias-subpixel-svg-rgb24-ref.png test/text-pattern.c test/text-pattern-pdf-argb32-ref.png test/text-pattern-ps-argb32-ref.png test/text-pattern-svg-argb32-ref.png test/text-rotate.c test/transforms-ps-argb32-ref.png test/unantialiased-shapes-ps-argb32-ref.png test/unantialiased-shapes-svg-argb32-ref.png test/unantialiased-shapes-svg-rgb24-ref.png test/unbounded-operator.c

Carl Worth cworth at kemper.freedesktop.org
Tue Aug 8 00:20:13 PDT 2006


 dev/null                                                |binary
 src/cairo-paginated-surface.c                           |   37 ++-
 src/cairo-pdf-surface.c                                 |   15 -
 src/cairo-ps-surface.c                                  |   15 -
 src/cairo-surface.c                                     |   71 ++++++-
 src/cairo-xlib-surface.c                                |    5 
 src/cairoint.h                                          |   12 +
 test/buffer-diff.c                                      |   41 +++-
 test/cairo-test.c                                       |  151 ++++++++++------
 test/caps-joins-alpha-svg-rgb24-ref.png                 |    0 
 test/caps-joins-ps-argb32-ref.png                       |binary
 test/caps-sub-paths-ps-argb32-ref.png                   |binary
 test/clip-fill-rule-ps-argb32-ref.png                   |binary
 test/clip-nesting-ps-argb32-ref.png                     |binary
 test/clip-operator.c                                    |    9 
 test/clip-twice-ps-argb32-ref.png                       |binary
 test/composite-integer-translate-over-svg-rgb24-ref.png |    0 
 test/dash-caps-joins-ps-argb32-ref.png                  |binary
 test/dash-offset-negative-ps-argb32-ref.png             |binary
 test/dash-scale-ps-argb32-ref.png                       |binary
 test/dash-zero-length-ps-argb32-ref.png                 |binary
 test/degenerate-path-ps-argb32-ref.png                  |binary
 test/fill-and-stroke-alpha-svg-rgb24-ref.png            |    0 
 test/fill-and-stroke-ps-argb32-ref.png                  |binary
 test/fill-rule-ps-argb32-ref.png                        |binary
 test/font-matrix-translation-ps-argb32-ref.png          |binary
 test/font-matrix-translation-svg-ref.png                |binary
 test/font-matrix-translation.c                          |    9 
 test/ft-font-create-for-ft-face.c                       |    2 
 test/ft-text-antialias-none-ps-argb32-ref.png           |binary
 test/ft-text-antialias-none.c                           |    3 
 test/ft-text-vertical-layout-pdf-argb32-ref.png         |binary
 test/ft-text-vertical-layout-ps-argb32-ref.png          |binary
 test/ft-text-vertical-layout-ref.png                    |binary
 test/ft-text-vertical-layout-svg-argb32-ref.png         |    0 
 test/ft-text-vertical-layout-svg-ref.png                |binary
 test/ft-text-vertical-layout-svg-rgb24-ref.png          |    0 
 test/ft-text-vertical-layout.c                          |    7 
 test/glyph-cache-pressure-pdf-argb32-ref.png            |    0 
 test/glyph-cache-pressure-ps-argb32-ref.png             |binary
 test/glyph-cache-pressure-svg-argb32-ref.png            |    0 
 test/glyph-cache-pressure.c                             |   10 -
 test/leaky-polygon-ps-argb32-ref.png                    |binary
 test/line-width-ps-argb32-ref.png                       |binary
 test/line-width-scale-ps-argb32-ref.png                 |binary
 test/linear-gradient-svg-rgb24-ref.png                  |    0 
 test/new-sub-path-ps-argb32-ref.png                     |binary
 test/operator-clear.c                                   |    9 
 test/operator-source.c                                  |    9 
 test/paint-source-alpha-svg-rgb24-ref.png               |    0 
 test/paint-with-alpha-svg-rgb24-ref.png                 |    0 
 test/path-data-ps-argb32-ref.png                        |binary
 test/pixman-rotate-svg-argb32-ref.png                   |binary
 test/pixman-rotate-svg-rgb24-ref.png                    |binary
 test/rectangle-rounding-error-ps-argb32-ref.png         |    0 
 test/select-font-face-pdf-argb32-ref.png                |    0 
 test/select-font-face-ps-argb32-ref.png                 |binary
 test/select-font-face-ref.png                           |binary
 test/select-font-face-svg-argb32-ref.png                |    0 
 test/select-font-face-svg-ref.png                       |binary
 test/select-font-face-svg-rgb24-ref.png                 |    0 
 test/select-font-face.c                                 |   11 -
 test/show-glyphs-many.c                                 |    9 
 test/show-text-current-point-pdf-argb32-ref.png         |    0 
 test/show-text-current-point-ps-argb32-ref.png          |binary
 test/show-text-current-point-svg-argb32-ref.png         |    0 
 test/show-text-current-point.c                          |   10 -
 test/text-antialias-gray-pdf-argb32-ref.png             |    0 
 test/text-antialias-gray-ps-argb32-ref.png              |    0 
 test/text-antialias-gray-svg-argb32-ref.png             |    0 
 test/text-antialias-gray-svg-rgb24-ref.png              |    0 
 test/text-antialias-gray.c                              |    5 
 test/text-antialias-none-pdf-argb32-ref.png             |    0 
 test/text-antialias-none-ps-argb32-ref.png              |    0 
 test/text-antialias-none-svg-argb32-ref.png             |    0 
 test/text-antialias-none-svg-rgb24-ref.png              |    0 
 test/text-antialias-none.c                              |    5 
 test/text-antialias-subpixel-pdf-argb32-ref.png         |    0 
 test/text-antialias-subpixel-ps-argb32-ref.png          |    0 
 test/text-antialias-subpixel-svg-argb32-ref.png         |    0 
 test/text-antialias-subpixel-svg-rgb24-ref.png          |    0 
 test/text-antialias-subpixel.c                          |    8 
 test/text-pattern-pdf-argb32-ref.png                    |    0 
 test/text-pattern-ps-argb32-ref.png                     |    0 
 test/text-pattern-svg-argb32-ref.png                    |binary
 test/text-pattern.c                                     |    9 
 test/text-rotate.c                                      |    3 
 test/transforms-ps-argb32-ref.png                       |binary
 test/unantialiased-shapes-ps-argb32-ref.png             |    0 
 test/unantialiased-shapes-svg-argb32-ref.png            |    0 
 test/unantialiased-shapes-svg-rgb24-ref.png             |    0 
 test/unbounded-operator.c                               |    9 
 92 files changed, 250 insertions(+), 224 deletions(-)

New commits:
diff-tree 401f0ce3c444e263f03055174791e993e6270c39 (from parents)
Merge: 77fd0efa9a055c13e685f4c6b01597ae67a36fb7 02b54ca6200b3e5a914b293dd4a0d56f432a5a9b
Author: Carl Worth <cworth at cworth.org>
Date:   Tue Aug 8 00:19:51 2006 -0700

    Merge branch 'surface-font-options' into cairo

diff-tree 02b54ca6200b3e5a914b293dd4a0d56f432a5a9b (from 9136c217703d1d6aab1742f522aa0279517fb36a)
Author: Carl Worth <cworth at cworth.org>
Date:   Wed Aug 2 11:18:14 2006 -0400

    Improve docs for cairo_surface_create_similar()

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index cad5a33..8e24773 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -276,11 +276,12 @@ _cairo_surface_create_similar_scratch (c
  * @height: height of the new surface (in device-space units)
  *
  * Create a new surface that is as compatible as possible with an
- * existing surface. The new surface will use the same backend as
- * @other unless that is not possible for some reason. However, the
- * created surface will have same fallback resolution and font options
- * as the existing surface.  The type of the returned surface may be
- * examined with cairo_surface_get_type().
+ * existing surface. For example the new surface will have the same
+ * fallback resolution and font options as @other. Generally, the new
+ * surface will also use the same backend as @other, unless that is
+ * not possible for some reason. The type of the returned surface may
+ * be examined with cairo_surface_get_type().
+ *
  * Initially the surface contents are all 0 (transparent if contents
  * have transparency, black otherwise.)
  *
diff-tree 9136c217703d1d6aab1742f522aa0279517fb36a (from 127704c225d4b9f2a4c72749f59a8dfcaecfddc6)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 1 20:40:54 2006 -0400

    Update reference images, mostly PDF and SVG
    Also replace some SVG ref images for rgb24 and argb32 with a single
    one where the two have been similar.

diff --git a/test/caps-joins-alpha-svg-argb32-ref.png b/test/caps-joins-alpha-svg-argb32-ref.png
deleted file mode 100644
index 2468936..0000000
Binary files a/test/caps-joins-alpha-svg-argb32-ref.png and /dev/null differ
diff --git a/test/caps-joins-alpha-svg-ref.png b/test/caps-joins-alpha-svg-ref.png
new file mode 100644
index 0000000..2468936
Binary files /dev/null and b/test/caps-joins-alpha-svg-ref.png differ
diff --git a/test/caps-joins-alpha-svg-rgb24-ref.png b/test/caps-joins-alpha-svg-rgb24-ref.png
deleted file mode 100644
index 2468936..0000000
Binary files a/test/caps-joins-alpha-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/composite-integer-translate-over-svg-argb32-ref.png b/test/composite-integer-translate-over-svg-argb32-ref.png
deleted file mode 100644
index 2a0212e..0000000
Binary files a/test/composite-integer-translate-over-svg-argb32-ref.png and /dev/null differ
diff --git a/test/composite-integer-translate-over-svg-ref.png b/test/composite-integer-translate-over-svg-ref.png
new file mode 100644
index 0000000..2a0212e
Binary files /dev/null and b/test/composite-integer-translate-over-svg-ref.png differ
diff --git a/test/composite-integer-translate-over-svg-rgb24-ref.png b/test/composite-integer-translate-over-svg-rgb24-ref.png
deleted file mode 100644
index 2a0212e..0000000
Binary files a/test/composite-integer-translate-over-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/fill-and-stroke-alpha-svg-argb32-ref.png b/test/fill-and-stroke-alpha-svg-argb32-ref.png
deleted file mode 100644
index 812c897..0000000
Binary files a/test/fill-and-stroke-alpha-svg-argb32-ref.png and /dev/null differ
diff --git a/test/fill-and-stroke-alpha-svg-ref.png b/test/fill-and-stroke-alpha-svg-ref.png
new file mode 100644
index 0000000..812c897
Binary files /dev/null and b/test/fill-and-stroke-alpha-svg-ref.png differ
diff --git a/test/fill-and-stroke-alpha-svg-rgb24-ref.png b/test/fill-and-stroke-alpha-svg-rgb24-ref.png
deleted file mode 100644
index 812c897..0000000
Binary files a/test/fill-and-stroke-alpha-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/font-matrix-translation-svg-ref.png b/test/font-matrix-translation-svg-ref.png
new file mode 100644
index 0000000..92ad17b
Binary files /dev/null and b/test/font-matrix-translation-svg-ref.png differ
diff --git a/test/ft-text-vertical-layout-pdf-argb32-ref.png b/test/ft-text-vertical-layout-pdf-argb32-ref.png
index dcc3d8b..19f26b6 100644
Binary files a/test/ft-text-vertical-layout-pdf-argb32-ref.png and b/test/ft-text-vertical-layout-pdf-argb32-ref.png differ
diff --git a/test/ft-text-vertical-layout-ref.png b/test/ft-text-vertical-layout-ref.png
index f05f3c6..7ec34ef 100644
Binary files a/test/ft-text-vertical-layout-ref.png and b/test/ft-text-vertical-layout-ref.png differ
diff --git a/test/ft-text-vertical-layout-svg-argb32-ref.png b/test/ft-text-vertical-layout-svg-argb32-ref.png
deleted file mode 100644
index bf4db9b..0000000
Binary files a/test/ft-text-vertical-layout-svg-argb32-ref.png and /dev/null differ
diff --git a/test/ft-text-vertical-layout-svg-ref.png b/test/ft-text-vertical-layout-svg-ref.png
new file mode 100644
index 0000000..9bdba32
Binary files /dev/null and b/test/ft-text-vertical-layout-svg-ref.png differ
diff --git a/test/ft-text-vertical-layout-svg-rgb24-ref.png b/test/ft-text-vertical-layout-svg-rgb24-ref.png
deleted file mode 100644
index 91bfc1d..0000000
Binary files a/test/ft-text-vertical-layout-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/glyph-cache-pressure-pdf-argb32-ref.png b/test/glyph-cache-pressure-pdf-argb32-ref.png
deleted file mode 100644
index 8b9031c..0000000
Binary files a/test/glyph-cache-pressure-pdf-argb32-ref.png and /dev/null differ
diff --git a/test/glyph-cache-pressure-svg-argb32-ref.png b/test/glyph-cache-pressure-svg-argb32-ref.png
deleted file mode 100644
index 0a49bc4..0000000
Binary files a/test/glyph-cache-pressure-svg-argb32-ref.png and /dev/null differ
diff --git a/test/glyph-cache-pressure-svg-ref.png b/test/glyph-cache-pressure-svg-ref.png
new file mode 100644
index 0000000..6f40d60
Binary files /dev/null and b/test/glyph-cache-pressure-svg-ref.png differ
diff --git a/test/glyph-cache-pressure-svg-rgb24-ref.png b/test/glyph-cache-pressure-svg-rgb24-ref.png
deleted file mode 100644
index 6f40d60..0000000
Binary files a/test/glyph-cache-pressure-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/linear-gradient-svg-argb32-ref.png b/test/linear-gradient-svg-argb32-ref.png
deleted file mode 100644
index 4ed4bfa..0000000
Binary files a/test/linear-gradient-svg-argb32-ref.png and /dev/null differ
diff --git a/test/linear-gradient-svg-ref.png b/test/linear-gradient-svg-ref.png
new file mode 100644
index 0000000..4ed4bfa
Binary files /dev/null and b/test/linear-gradient-svg-ref.png differ
diff --git a/test/linear-gradient-svg-rgb24-ref.png b/test/linear-gradient-svg-rgb24-ref.png
deleted file mode 100644
index 4ed4bfa..0000000
Binary files a/test/linear-gradient-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/paint-source-alpha-svg-argb32-ref.png b/test/paint-source-alpha-svg-argb32-ref.png
deleted file mode 100644
index 3b3a990..0000000
Binary files a/test/paint-source-alpha-svg-argb32-ref.png and /dev/null differ
diff --git a/test/paint-source-alpha-svg-ref.png b/test/paint-source-alpha-svg-ref.png
new file mode 100644
index 0000000..3b3a990
Binary files /dev/null and b/test/paint-source-alpha-svg-ref.png differ
diff --git a/test/paint-source-alpha-svg-rgb24-ref.png b/test/paint-source-alpha-svg-rgb24-ref.png
deleted file mode 100644
index 3b3a990..0000000
Binary files a/test/paint-source-alpha-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/paint-with-alpha-svg-argb32-ref.png b/test/paint-with-alpha-svg-argb32-ref.png
deleted file mode 100644
index 97a2100..0000000
Binary files a/test/paint-with-alpha-svg-argb32-ref.png and /dev/null differ
diff --git a/test/paint-with-alpha-svg-ref.png b/test/paint-with-alpha-svg-ref.png
new file mode 100644
index 0000000..97a2100
Binary files /dev/null and b/test/paint-with-alpha-svg-ref.png differ
diff --git a/test/paint-with-alpha-svg-rgb24-ref.png b/test/paint-with-alpha-svg-rgb24-ref.png
deleted file mode 100644
index 97a2100..0000000
Binary files a/test/paint-with-alpha-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/pixman-rotate-svg-argb32-ref.png b/test/pixman-rotate-svg-argb32-ref.png
new file mode 100644
index 0000000..08d750b
Binary files /dev/null and b/test/pixman-rotate-svg-argb32-ref.png differ
diff --git a/test/pixman-rotate-svg-rgb24-ref.png b/test/pixman-rotate-svg-rgb24-ref.png
new file mode 100644
index 0000000..349fd5c
Binary files /dev/null and b/test/pixman-rotate-svg-rgb24-ref.png differ
diff --git a/test/rectangle-rounding-error-ps-argb32-ref.png b/test/rectangle-rounding-error-ps-argb32-ref.png
deleted file mode 100644
index 2753f6d..0000000
Binary files a/test/rectangle-rounding-error-ps-argb32-ref.png and /dev/null differ
diff --git a/test/select-font-face-pdf-argb32-ref.png b/test/select-font-face-pdf-argb32-ref.png
deleted file mode 100644
index 540b994..0000000
Binary files a/test/select-font-face-pdf-argb32-ref.png and /dev/null differ
diff --git a/test/select-font-face-ps-argb32-ref.png b/test/select-font-face-ps-argb32-ref.png
index 66980c9..d8d84a5 100644
Binary files a/test/select-font-face-ps-argb32-ref.png and b/test/select-font-face-ps-argb32-ref.png differ
diff --git a/test/select-font-face-ref.png b/test/select-font-face-ref.png
index 8c3c153..b3d2322 100644
Binary files a/test/select-font-face-ref.png and b/test/select-font-face-ref.png differ
diff --git a/test/select-font-face-svg-argb32-ref.png b/test/select-font-face-svg-argb32-ref.png
deleted file mode 100644
index 50b8f49..0000000
Binary files a/test/select-font-face-svg-argb32-ref.png and /dev/null differ
diff --git a/test/select-font-face-svg-ref.png b/test/select-font-face-svg-ref.png
new file mode 100644
index 0000000..e2e93b5
Binary files /dev/null and b/test/select-font-face-svg-ref.png differ
diff --git a/test/select-font-face-svg-rgb24-ref.png b/test/select-font-face-svg-rgb24-ref.png
deleted file mode 100644
index 50b8f49..0000000
Binary files a/test/select-font-face-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/show-text-current-point-pdf-argb32-ref.png b/test/show-text-current-point-pdf-argb32-ref.png
deleted file mode 100644
index 61b0dfa..0000000
Binary files a/test/show-text-current-point-pdf-argb32-ref.png and /dev/null differ
diff --git a/test/show-text-current-point-svg-argb32-ref.png b/test/show-text-current-point-svg-argb32-ref.png
deleted file mode 100644
index 717ad7e..0000000
Binary files a/test/show-text-current-point-svg-argb32-ref.png and /dev/null differ
diff --git a/test/show-text-current-point-svg-ref.png b/test/show-text-current-point-svg-ref.png
new file mode 100644
index 0000000..2c4bcd7
Binary files /dev/null and b/test/show-text-current-point-svg-ref.png differ
diff --git a/test/show-text-current-point-svg-rgb24-ref.png b/test/show-text-current-point-svg-rgb24-ref.png
deleted file mode 100644
index 2c4bcd7..0000000
Binary files a/test/show-text-current-point-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/text-antialias-gray-pdf-argb32-ref.png b/test/text-antialias-gray-pdf-argb32-ref.png
deleted file mode 100644
index adf74a8..0000000
Binary files a/test/text-antialias-gray-pdf-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-gray-ps-argb32-ref.png b/test/text-antialias-gray-ps-argb32-ref.png
deleted file mode 100644
index 9087b7a..0000000
Binary files a/test/text-antialias-gray-ps-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-gray-svg-argb32-ref.png b/test/text-antialias-gray-svg-argb32-ref.png
deleted file mode 100644
index aa64fbb..0000000
Binary files a/test/text-antialias-gray-svg-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-gray-svg-rgb24-ref.png b/test/text-antialias-gray-svg-rgb24-ref.png
deleted file mode 100644
index 20f0d58..0000000
Binary files a/test/text-antialias-gray-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/text-antialias-none-pdf-argb32-ref.png b/test/text-antialias-none-pdf-argb32-ref.png
deleted file mode 100644
index adf74a8..0000000
Binary files a/test/text-antialias-none-pdf-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-none-ps-argb32-ref.png b/test/text-antialias-none-ps-argb32-ref.png
deleted file mode 100644
index 9087b7a..0000000
Binary files a/test/text-antialias-none-ps-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-none-svg-argb32-ref.png b/test/text-antialias-none-svg-argb32-ref.png
deleted file mode 100644
index aa64fbb..0000000
Binary files a/test/text-antialias-none-svg-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-none-svg-rgb24-ref.png b/test/text-antialias-none-svg-rgb24-ref.png
deleted file mode 100644
index 20f0d58..0000000
Binary files a/test/text-antialias-none-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/text-antialias-subpixel-pdf-argb32-ref.png b/test/text-antialias-subpixel-pdf-argb32-ref.png
deleted file mode 100644
index adf74a8..0000000
Binary files a/test/text-antialias-subpixel-pdf-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-subpixel-ps-argb32-ref.png b/test/text-antialias-subpixel-ps-argb32-ref.png
deleted file mode 100644
index 9087b7a..0000000
Binary files a/test/text-antialias-subpixel-ps-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-subpixel-svg-argb32-ref.png b/test/text-antialias-subpixel-svg-argb32-ref.png
deleted file mode 100644
index aa64fbb..0000000
Binary files a/test/text-antialias-subpixel-svg-argb32-ref.png and /dev/null differ
diff --git a/test/text-antialias-subpixel-svg-rgb24-ref.png b/test/text-antialias-subpixel-svg-rgb24-ref.png
deleted file mode 100644
index 20f0d58..0000000
Binary files a/test/text-antialias-subpixel-svg-rgb24-ref.png and /dev/null differ
diff --git a/test/text-pattern-pdf-argb32-ref.png b/test/text-pattern-pdf-argb32-ref.png
deleted file mode 100644
index 17afd64..0000000
Binary files a/test/text-pattern-pdf-argb32-ref.png and /dev/null differ
diff --git a/test/text-pattern-ps-argb32-ref.png b/test/text-pattern-ps-argb32-ref.png
deleted file mode 100644
index 1bc8dd4..0000000
Binary files a/test/text-pattern-ps-argb32-ref.png and /dev/null differ
diff --git a/test/text-pattern-svg-argb32-ref.png b/test/text-pattern-svg-argb32-ref.png
index 79dc52d..73e3edf 100644
Binary files a/test/text-pattern-svg-argb32-ref.png and b/test/text-pattern-svg-argb32-ref.png differ
diff --git a/test/unantialiased-shapes-ps-argb32-ref.png b/test/unantialiased-shapes-ps-argb32-ref.png
deleted file mode 100644
index dc64e36..0000000
Binary files a/test/unantialiased-shapes-ps-argb32-ref.png and /dev/null differ
diff --git a/test/unantialiased-shapes-svg-argb32-ref.png b/test/unantialiased-shapes-svg-argb32-ref.png
deleted file mode 100644
index da29773..0000000
Binary files a/test/unantialiased-shapes-svg-argb32-ref.png and /dev/null differ
diff --git a/test/unantialiased-shapes-svg-rgb24-ref.png b/test/unantialiased-shapes-svg-rgb24-ref.png
deleted file mode 100644
index da29773..0000000
Binary files a/test/unantialiased-shapes-svg-rgb24-ref.png and /dev/null differ
diff-tree 127704c225d4b9f2a4c72749f59a8dfcaecfddc6 (from fc715ffd80f5ec9ac57e3b110dd20298029a6350)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 1 20:39:56 2006 -0400

    Look for per-target reference image too

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 7ebbfdc..dee30a9 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -193,7 +193,7 @@ static void
 xunlink (const char *pathname)
 {
     if (unlink (pathname) < 0 && errno != ENOENT) {
-	cairo_test_log ("  Error: Cannot remove %s: %s\n",
+	cairo_test_log ("Error: Cannot remove %s: %s\n",
 			pathname, strerror (errno));
 	exit (1);
     }
@@ -1470,6 +1470,63 @@ cleanup_svg (void *closure)
 }
 #endif /* CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE */
 
+const char *
+cairo_ref_name_for_test_target_format (const char *test_name,
+				       const char *target_name,
+				       const char *format)
+{
+    char *ref_name = NULL;
+
+    /* First look for a target/format-specific reference image. */
+    xasprintf (&ref_name, "%s/%s-%s-%s%s", srcdir,
+	       test_name,
+	       target_name,
+	       format,
+	       CAIRO_TEST_REF_SUFFIX);
+    if (access (ref_name, F_OK) != 0)
+	free (ref_name);
+    else
+	goto done;
+
+    /* Next, look for taget-specifc reference image. */
+    xasprintf (&ref_name, "%s/%s-%s%s", srcdir,
+	       test_name,
+	       target_name,
+	       CAIRO_TEST_REF_SUFFIX);
+    if (access (ref_name, F_OK) != 0)
+	free (ref_name);
+    else
+	goto done;
+
+    /* Next, look for format-specifc reference image. */
+    xasprintf (&ref_name, "%s/%s-%s%s", srcdir,
+	       test_name,
+	       format,
+	       CAIRO_TEST_REF_SUFFIX);
+    if (access (ref_name, F_OK) != 0)
+	free (ref_name);
+    else
+	goto done;
+
+    /* Finally, look for the standard reference image. */
+    xasprintf (&ref_name, "%s/%s%s", srcdir,
+	       test_name,
+	       CAIRO_TEST_REF_SUFFIX);
+    if (access (ref_name, F_OK) != 0)
+	free (ref_name);
+    else
+	goto done;
+
+    xasprintf (&ref_name, "/dev/null");
+    cairo_test_log ("Error: Cannot find reference image for %s/%s-%s-%s%s\n",srcdir,
+		    test_name,
+		    target_name,
+		    CAIRO_TEST_REF_SUFFIX);
+
+done:
+    return ref_name;
+}
+
 static cairo_test_status_t
 cairo_test_for_target (cairo_test_t *test,
 		       cairo_test_target_t	 *target,
@@ -1479,42 +1536,29 @@ cairo_test_for_target (cairo_test_t *tes
     cairo_surface_t *surface;
     cairo_t *cr;
     char *png_name, *ref_name, *diff_name, *offset_str;
-    char *format;
     cairo_test_status_t ret;
     cairo_content_t expected_content;
     cairo_font_options_t *font_options;
+    const char *format;
 
     /* Get the strings ready that we'll need. */
     format = _cairo_test_content_name (target->content);
-
     if (dev_offset)
 	xasprintf (&offset_str, "-%d", dev_offset);
     else
 	offset_str = strdup("");
 
-    xasprintf (&png_name, "%s-%s-%s%s%s", test->name,
-	       target->name, format, offset_str, CAIRO_TEST_PNG_SUFFIX);
-
-    /* First look for a target/format-specific reference image. */
-    xasprintf (&ref_name, "%s/%s-%s-%s%s", srcdir, test->name,
-	       target->name, format, CAIRO_TEST_REF_SUFFIX);
-    if (access (ref_name, F_OK) != 0) {
-	free (ref_name);
-
-	/* Next, look for format-specifc reference image. */
-	xasprintf (&ref_name, "%s/%s-%s%s", srcdir, test->name,
-		   format,CAIRO_TEST_REF_SUFFIX);
-
-	if (access (ref_name, F_OK) != 0) {
-	    free (ref_name);
-
-	    /* Finally, look for the standard reference image. */
-	    xasprintf (&ref_name, "%s/%s%s", srcdir, test->name,
-		       CAIRO_TEST_REF_SUFFIX);
-	}
-    }
-    xasprintf (&diff_name, "%s-%s-%s%s%s", test->name,
-	       target->name, format, offset_str, CAIRO_TEST_DIFF_SUFFIX);
+    xasprintf (&png_name, "%s-%s-%s%s%s",
+	       test->name,
+	       target->name,
+	       format,
+	       offset_str, CAIRO_TEST_PNG_SUFFIX);
+    ref_name = cairo_ref_name_for_test_target_format (test->name, target->name, format);
+    xasprintf (&diff_name, "%s-%s-%s%s%s",
+	       test->name,
+	       target->name,
+	       format,
+	       offset_str, CAIRO_TEST_DIFF_SUFFIX);
 
     /* Run the actual drawing code. */
     if (test->width && test->height) {
diff-tree fc715ffd80f5ec9ac57e3b110dd20298029a6350 (from 3e24f516a2f5435306ee8491e7955177b960a797)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 1 18:21:27 2006 -0400

    New PS ref images, matching the recent png16m->pngalpha driver change

diff --git a/test/caps-joins-ps-argb32-ref.png b/test/caps-joins-ps-argb32-ref.png
index d674295..c126d34 100644
Binary files a/test/caps-joins-ps-argb32-ref.png and b/test/caps-joins-ps-argb32-ref.png differ
diff --git a/test/caps-sub-paths-ps-argb32-ref.png b/test/caps-sub-paths-ps-argb32-ref.png
index a7bc1ac..a53aad8 100644
Binary files a/test/caps-sub-paths-ps-argb32-ref.png and b/test/caps-sub-paths-ps-argb32-ref.png differ
diff --git a/test/clip-fill-rule-ps-argb32-ref.png b/test/clip-fill-rule-ps-argb32-ref.png
index 6d97e04..f06a1a2 100644
Binary files a/test/clip-fill-rule-ps-argb32-ref.png and b/test/clip-fill-rule-ps-argb32-ref.png differ
diff --git a/test/clip-nesting-ps-argb32-ref.png b/test/clip-nesting-ps-argb32-ref.png
index 1bd43d7..41f7160 100644
Binary files a/test/clip-nesting-ps-argb32-ref.png and b/test/clip-nesting-ps-argb32-ref.png differ
diff --git a/test/clip-twice-ps-argb32-ref.png b/test/clip-twice-ps-argb32-ref.png
index 9ec76b4..0cb6186 100644
Binary files a/test/clip-twice-ps-argb32-ref.png and b/test/clip-twice-ps-argb32-ref.png differ
diff --git a/test/dash-caps-joins-ps-argb32-ref.png b/test/dash-caps-joins-ps-argb32-ref.png
index 629b97b..68d2c6d 100644
Binary files a/test/dash-caps-joins-ps-argb32-ref.png and b/test/dash-caps-joins-ps-argb32-ref.png differ
diff --git a/test/dash-offset-negative-ps-argb32-ref.png b/test/dash-offset-negative-ps-argb32-ref.png
index 518e1c9..f1d56fe 100644
Binary files a/test/dash-offset-negative-ps-argb32-ref.png and b/test/dash-offset-negative-ps-argb32-ref.png differ
diff --git a/test/dash-scale-ps-argb32-ref.png b/test/dash-scale-ps-argb32-ref.png
index 0320a8b..efe8b11 100644
Binary files a/test/dash-scale-ps-argb32-ref.png and b/test/dash-scale-ps-argb32-ref.png differ
diff --git a/test/dash-zero-length-ps-argb32-ref.png b/test/dash-zero-length-ps-argb32-ref.png
index 897f25f..6c334e1 100644
Binary files a/test/dash-zero-length-ps-argb32-ref.png and b/test/dash-zero-length-ps-argb32-ref.png differ
diff --git a/test/degenerate-path-ps-argb32-ref.png b/test/degenerate-path-ps-argb32-ref.png
index f16f0f6..4b3d8e3 100644
Binary files a/test/degenerate-path-ps-argb32-ref.png and b/test/degenerate-path-ps-argb32-ref.png differ
diff --git a/test/fill-and-stroke-ps-argb32-ref.png b/test/fill-and-stroke-ps-argb32-ref.png
index 0df3205..850f0cb 100644
Binary files a/test/fill-and-stroke-ps-argb32-ref.png and b/test/fill-and-stroke-ps-argb32-ref.png differ
diff --git a/test/fill-rule-ps-argb32-ref.png b/test/fill-rule-ps-argb32-ref.png
index b5487e6..971b560 100644
Binary files a/test/fill-rule-ps-argb32-ref.png and b/test/fill-rule-ps-argb32-ref.png differ
diff --git a/test/font-matrix-translation-ps-argb32-ref.png b/test/font-matrix-translation-ps-argb32-ref.png
new file mode 100644
index 0000000..9f6a252
Binary files /dev/null and b/test/font-matrix-translation-ps-argb32-ref.png differ
diff --git a/test/ft-text-antialias-none-ps-argb32-ref.png b/test/ft-text-antialias-none-ps-argb32-ref.png
index ea33b0e..4f7ee83 100644
Binary files a/test/ft-text-antialias-none-ps-argb32-ref.png and b/test/ft-text-antialias-none-ps-argb32-ref.png differ
diff --git a/test/ft-text-vertical-layout-ps-argb32-ref.png b/test/ft-text-vertical-layout-ps-argb32-ref.png
index b832e23..9213bac 100644
Binary files a/test/ft-text-vertical-layout-ps-argb32-ref.png and b/test/ft-text-vertical-layout-ps-argb32-ref.png differ
diff --git a/test/glyph-cache-pressure-ps-argb32-ref.png b/test/glyph-cache-pressure-ps-argb32-ref.png
index cc02ff6..e51bca7 100644
Binary files a/test/glyph-cache-pressure-ps-argb32-ref.png and b/test/glyph-cache-pressure-ps-argb32-ref.png differ
diff --git a/test/leaky-polygon-ps-argb32-ref.png b/test/leaky-polygon-ps-argb32-ref.png
index 23af504..a8ba771 100644
Binary files a/test/leaky-polygon-ps-argb32-ref.png and b/test/leaky-polygon-ps-argb32-ref.png differ
diff --git a/test/line-width-ps-argb32-ref.png b/test/line-width-ps-argb32-ref.png
index ef6abb7..4c64e6c 100644
Binary files a/test/line-width-ps-argb32-ref.png and b/test/line-width-ps-argb32-ref.png differ
diff --git a/test/line-width-scale-ps-argb32-ref.png b/test/line-width-scale-ps-argb32-ref.png
index 2f01fc7..4b43302 100644
Binary files a/test/line-width-scale-ps-argb32-ref.png and b/test/line-width-scale-ps-argb32-ref.png differ
diff --git a/test/new-sub-path-ps-argb32-ref.png b/test/new-sub-path-ps-argb32-ref.png
index 23b7e75..76c50fb 100644
Binary files a/test/new-sub-path-ps-argb32-ref.png and b/test/new-sub-path-ps-argb32-ref.png differ
diff --git a/test/path-data-ps-argb32-ref.png b/test/path-data-ps-argb32-ref.png
index b724a0f..647fafb 100644
Binary files a/test/path-data-ps-argb32-ref.png and b/test/path-data-ps-argb32-ref.png differ
diff --git a/test/select-font-face-ps-argb32-ref.png b/test/select-font-face-ps-argb32-ref.png
index fdb3ad2..66980c9 100644
Binary files a/test/select-font-face-ps-argb32-ref.png and b/test/select-font-face-ps-argb32-ref.png differ
diff --git a/test/show-text-current-point-ps-argb32-ref.png b/test/show-text-current-point-ps-argb32-ref.png
index 3213d7f..e3f7e7f 100644
Binary files a/test/show-text-current-point-ps-argb32-ref.png and b/test/show-text-current-point-ps-argb32-ref.png differ
diff --git a/test/transforms-ps-argb32-ref.png b/test/transforms-ps-argb32-ref.png
index 4858364..5d5cfa9 100644
Binary files a/test/transforms-ps-argb32-ref.png and b/test/transforms-ps-argb32-ref.png differ
diff-tree 3e24f516a2f5435306ee8491e7955177b960a797 (from 3d95919fab2e47dea9e7b266849db7a4c05eb9a7)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 1 16:13:29 2006 -0400

    Change the text string "cd" to "AB" in test to match the other string
    that is drawn.  The reason, one is draw using show_text, the other
    using text_path.  The difference is more emphasized when rendering the
    same string.

diff --git a/test/ft-text-vertical-layout-ref.png b/test/ft-text-vertical-layout-ref.png
index a7a0590..f05f3c6 100644
Binary files a/test/ft-text-vertical-layout-ref.png and b/test/ft-text-vertical-layout-ref.png differ
diff --git a/test/ft-text-vertical-layout.c b/test/ft-text-vertical-layout.c
index 334fe60..f8958ea 100644
--- a/test/ft-text-vertical-layout.c
+++ b/test/ft-text-vertical-layout.c
@@ -99,7 +99,7 @@ draw (cairo_t *cr, int width, int height
 {
     cairo_text_extents_t extents;
     cairo_scaled_font_t * scaled_font;
-    static char black[] = "AB", blue[] = "cd";
+    static char black[] = "AB", blue[] = "AB";
 
     /* We draw in the default black, so paint white first. */
     cairo_save (cr);
diff-tree 3d95919fab2e47dea9e7b266849db7a4c05eb9a7 (from 5a23fd70a0af5c2b0cb990b89ebc5ed7a01aae82)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 1 15:27:11 2006 -0400

    Switch from ghostscript's png16m driver to pngalpha for PS->PNG again.
    We have switched back and forth quite a few times.  This time I'm switching
    because with pngalpha we get gray antialiased text and graphics while with
    png16m all we get is no antialiasing.  This is definitely a bug in the png16m
    driver, but I won't wait until it gets fixed upstream.
    
    Previously Carl Worth switched to pngalpha and reverted it immediately in
    commit c4fc7b06b53c811ddc20def91aaccd756c28a924.  I've now fixed image-diff to
    work with the output of pngalpha, so we can switch.  It requires lots of
    reference image updates, but still doesn't help with reducing the number of
    PS-specific reference images we need.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index df4283d..7ebbfdc 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1237,7 +1237,7 @@ ps_surface_write_to_png (cairo_surface_t
     }
 
     cairo_surface_finish (surface);
-    sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -sOutputFile=%s %s",
+    sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=%s %s",
 	     ptc->width, ptc->height, filename, ptc->filename);
     if (system (command) == 0)
 	return CAIRO_STATUS_SUCCESS;
diff-tree 5a23fd70a0af5c2b0cb990b89ebc5ed7a01aae82 (from d85f30e789c74cc8f1d83ba609d8b02886686440)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 1 15:20:39 2006 -0400

    Change the way diff images highlight differences.
    Previously it was using the equation 128+diff/3, which results in
    lots of gray and de-emphasized difference.  Now it's using
    MIN(255,diff*4) which more emphasizes the real difference.

diff --git a/test/buffer-diff.c b/test/buffer-diff.c
index ed50cb6..0244ecd 100644
--- a/test/buffer-diff.c
+++ b/test/buffer-diff.c
@@ -92,9 +92,12 @@ buffer_diff_core (unsigned char *_buf_a,
 		for (channel = 0; channel < 4; channel++) {
 		    unsigned char value_a = (row_a[x] >> (channel*8));
 		    unsigned char value_b = (row_b[x] >> (channel*8));
-		    double diff;
+		    unsigned char diff;
 		    diff = value_a - value_b;
-		    diff_pixel |= (unsigned char)(128 + diff / 3.0) << (channel*8);
+		    diff *= 4; /* emphasize */
+		    if (diff > 255)
+		      diff = 255;
+		    diff_pixel |= diff << (channel*8);
 		}
 
 		pixels_changed++;
diff-tree d85f30e789c74cc8f1d83ba609d8b02886686440 (from 556a4d8405a4f53e465425ccc1f6506e51b29344)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 1 15:18:19 2006 -0400

    Make image_diff_flattened flatten the first image too.
    This is useful to use the ghostscript pngalpha driver for example.

diff --git a/test/buffer-diff.c b/test/buffer-diff.c
index ff4935e..ed50cb6 100644
--- a/test/buffer-diff.c
+++ b/test/buffer-diff.c
@@ -226,8 +226,7 @@ image_diff (const char *filename_a,
  *    (should use cairo_image_surface_create_from_png, should save
  *    loaded buffers for re-use).
  *
- * 2) Vlad has an outstanding patch against buffer-diff.c and I think
- *    this will be kinder to his merge pain.
+ * 2) There is a second reason no more.
  */
 int
 image_diff_flattened (const char *filename_a,
@@ -242,7 +241,8 @@ image_diff_flattened (const char *filena
     unsigned int width_a, height_a, stride_a;
     unsigned int width_b, height_b, stride_b;
     unsigned char *buf_a, *buf_b, *buf_diff;
-    unsigned char *b_flat;
+    unsigned char *a_flat, *b_flat;
+    cairo_surface_t *buf_a_surface, *a_flat_surface;
     cairo_surface_t *buf_b_surface, *b_flat_surface;
     cairo_t *cr;
     read_png_status_t status;
@@ -275,33 +275,50 @@ image_diff_flattened (const char *filena
 	return -1;
     }
 
+    buf_a_surface =  cairo_image_surface_create_for_data (buf_a,
+							  CAIRO_FORMAT_ARGB32,
+							  width_a + ax, height_a + ay,
+							  stride_a);
     buf_b_surface =  cairo_image_surface_create_for_data (buf_b,
 							  CAIRO_FORMAT_ARGB32,
-							  width_b + bx, height_b + bx,
+							  width_b + bx, height_b + by,
 							  stride_b);
 
     buf_diff = xcalloc (stride_a * height_a, 1);
 
-    b_flat = xcalloc (stride_a * height_a, 1);
+    a_flat = xcalloc (stride_a * height_a, 1);
+    b_flat = xcalloc (stride_b * height_b, 1);
 
+    a_flat_surface = cairo_image_surface_create_for_data (a_flat,
+							  CAIRO_FORMAT_ARGB32,
+							  width_a, height_a,
+							  stride_a);
+    cairo_surface_set_device_offset (a_flat_surface, -ax, -ay);
     b_flat_surface = cairo_image_surface_create_for_data (b_flat,
 							  CAIRO_FORMAT_ARGB32,
 							  width_b, height_b,
 							  stride_b);
     cairo_surface_set_device_offset (b_flat_surface, -bx, -by);
 
-    cr = cairo_create (b_flat_surface);
+    cr = cairo_create (a_flat_surface);
+    cairo_set_source_rgb (cr, 1, 1, 1);
+    cairo_paint (cr);
+    cairo_set_source_surface (cr, buf_a_surface, 0, 0);
+    cairo_paint (cr);
+    cairo_destroy (cr);
+    cairo_surface_destroy (a_flat_surface);
+    cairo_surface_destroy (buf_a_surface);
 
+    cr = cairo_create (b_flat_surface);
     cairo_set_source_rgb (cr, 1, 1, 1);
     cairo_paint (cr);
     cairo_set_source_surface (cr, buf_b_surface, 0, 0);
     cairo_paint (cr);
-
     cairo_destroy (cr);
     cairo_surface_destroy (b_flat_surface);
     cairo_surface_destroy (buf_b_surface);
 
-    pixels_changed = buffer_diff (buf_a + (ay * stride_a) + ax * 4,
+    pixels_changed = buffer_diff (a_flat,
                                   b_flat,
                                   buf_diff,
 				  width_a, height_a,
@@ -317,6 +334,7 @@ image_diff_flattened (const char *filena
 
     free (buf_a);
     free (buf_b);
+    free (a_flat);
     free (b_flat);
     free (buf_diff);
 
diff-tree 556a4d8405a4f53e465425ccc1f6506e51b29344 (from 2fa709d6af58713f7b362748a728a6f8c983d2ec)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 1 15:16:10 2006 -0400

    Add vector_ignored_tests that is tests ignored for ps/pdf/svg
    that includes all tests depending on CAIRO_ANTIALIAS_NONE and
    CAIRO_ANTIALIAS_SUBPIXEL.
    This removes separate pdf_ignored_tests and svg_ignored_tests
    arrays that were out of synch and otherwise the same.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 0bda560..df4283d 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -65,6 +65,19 @@ typedef enum cairo_internal_surface_type
     CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED
 } cairo_internal_surface_type_t;
 
+static const char *vector_ignored_tests[] = {
+    /* We can't match the results of tests that depend on
+     * CAIRO_ANTIALIAS_NONE/SUBPIXEL for vector backends
+     * (nor do we care). */
+    "ft-text-antialias-none",
+    "rectangle-rounding-error",
+    "text-antialias-gray",
+    "text-antialias-none",
+    "text-antialias-subpixel",
+    "unantialiased-shapes",
+    NULL
+};
+
 #ifdef _MSC_VER
 #define vsnprintf _vsnprintf
 #define access _access
@@ -1156,6 +1169,11 @@ create_ps_surface (cairo_test_t		 *test,
     int height = test->height;
     ps_target_closure_t	*ptc;
     cairo_surface_t *surface;
+    int i;
+
+    for (i = 0; vector_ignored_tests[i] != NULL; i++)
+	if (strcmp (test->name, vector_ignored_tests[i]) == 0)
+	    return NULL;
 
     /* Sanitize back to a real cairo_content_t value. */
     if (content == CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED)
@@ -1240,15 +1258,6 @@ cleanup_ps (void *closure)
 #if CAIRO_HAS_PDF_SURFACE && CAIRO_CAN_TEST_PDF_SURFACE
 #include "cairo-pdf.h"
 
-static const char *pdf_ignored_tests[] = {
-    /* We can't match the results of tests that depend on
-     * CAIRO_ANTIALIAS_NONE, (nor do we care). */
-    "ft-text-antialias-none",
-    "rectangle-rounding-error",
-    "unantialiased-shapes",
-    NULL
-};
-
 cairo_user_data_key_t pdf_closure_key;
 
 typedef struct _pdf_target_closure
@@ -1270,8 +1279,8 @@ create_pdf_surface (cairo_test_t	 *test,
     cairo_surface_t *surface;
     int i;
 
-    for (i = 0; pdf_ignored_tests[i] != NULL; i++)
-	if (strcmp (test->name, pdf_ignored_tests[i]) == 0)
+    for (i = 0; vector_ignored_tests[i] != NULL; i++)
+	if (strcmp (test->name, vector_ignored_tests[i]) == 0)
 	    return NULL;
 
     /* Sanitize back to a real cairo_content_t value. */
@@ -1359,14 +1368,6 @@ cleanup_pdf (void *closure)
 #if CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE
 #include "cairo-svg.h"
 
-static const char *svg_ignored_tests[] = {
-    /* rectangle-rounding-error uses CAIRO_ANTIALIAS_NONE,
-     * which is not supported */
-    "ft-text-antialias-none",
-    "rectangle-rounding-error",
-    NULL
-};
-
 cairo_user_data_key_t	svg_closure_key;
 
 typedef struct _svg_target_closure
@@ -1387,8 +1388,8 @@ create_svg_surface (cairo_test_t	 *test,
     svg_target_closure_t *ptc;
     cairo_surface_t *surface;
 
-    for (i = 0; svg_ignored_tests[i] != NULL; i++)
-	if (strcmp (test->name, svg_ignored_tests[i]) == 0)
+    for (i = 0; vector_ignored_tests[i] != NULL; i++)
+	if (strcmp (test->name, vector_ignored_tests[i]) == 0)
 	    return NULL;
 
     *closure = ptc = xmalloc (sizeof (svg_target_closure_t));
diff-tree 2fa709d6af58713f7b362748a728a6f8c983d2ec (from 9fcb3c32c1f16fe6ab913e27eb54d18b7d9a06b0)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jul 31 15:17:15 2006 -0400

    Set font options in the test context and make tests not do that
    This should help with not requiring many backend-specific reference
    images, and some should be removed now.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index ea580be..0bda560 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1481,6 +1481,7 @@ cairo_test_for_target (cairo_test_t *tes
     char *format;
     cairo_test_status_t ret;
     cairo_content_t expected_content;
+    cairo_font_options_t *font_options;
 
     /* Get the strings ready that we'll need. */
     format = _cairo_test_content_name (target->content);
@@ -1567,6 +1568,15 @@ cairo_test_for_target (cairo_test_t *tes
     cairo_paint (cr);
     cairo_restore (cr);
 
+    /* Set all components of font_options to avoid backend differences
+     * and reduce number of needed reference images. */
+    font_options = cairo_font_options_create ();
+    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
+    cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_ON);
+    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
+    cairo_set_font_options (cr, font_options);
+    cairo_font_options_destroy (font_options);
+
     status = (test->draw) (cr, test->width, test->height);
 
     /* Then, check all the different ways it could fail. */
diff --git a/test/clip-operator.c b/test/clip-operator.c
index 52cbba6..4d262f8 100644
--- a/test/clip-operator.c
+++ b/test/clip-operator.c
@@ -144,7 +144,6 @@ draw (cairo_t *cr, int width, int height
 {
     int j, x, y;
     cairo_operator_t op;
-    cairo_font_options_t *font_options;
     cairo_pattern_t *pattern;
 
     cairo_select_font_face (cr, "Bitstream Vera Sans",
@@ -152,14 +151,6 @@ draw (cairo_t *cr, int width, int height
 			    CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size (cr, 0.9 * HEIGHT);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     for (j = 0; j < ARRAY_SIZE (draw_funcs); j++) {
 	for (op = CAIRO_OPERATOR_CLEAR; op < N_OPERATORS; op++) {
 	    x = op * (WIDTH + PAD) + PAD;
diff --git a/test/font-matrix-translation.c b/test/font-matrix-translation.c
index dbdeb87..067cbb5 100644
--- a/test/font-matrix-translation.c
+++ b/test/font-matrix-translation.c
@@ -64,7 +64,6 @@ box_text (cairo_t *cr, const char *utf8,
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_font_options_t *font_options;
     cairo_text_extents_t extents;
     cairo_matrix_t matrix;
 
@@ -76,14 +75,6 @@ draw (cairo_t *cr, int width, int height
 			    CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size (cr, TEXT_SIZE);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     cairo_translate (cr, PAD, PAD);
     cairo_set_line_width (cr, 1.0);
 
diff --git a/test/ft-font-create-for-ft-face.c b/test/ft-font-create-for-ft-face.c
index 64a3224..066b175 100644
--- a/test/ft-font-create-for-ft-face.c
+++ b/test/ft-font-create-for-ft-face.c
@@ -80,6 +80,8 @@ draw (cairo_t *cr, int width, int height
 
     font_options = cairo_font_options_create ();
 
+    cairo_get_font_options (cr, font_options);
+
     scaled_font = cairo_scaled_font_create (font_face,
 					    &font_matrix,
 					    &ctm,
diff --git a/test/ft-text-antialias-none.c b/test/ft-text-antialias-none.c
index 55a6fa3..e4a34e9 100644
--- a/test/ft-text-antialias-none.c
+++ b/test/ft-text-antialias-none.c
@@ -55,8 +55,7 @@ create_scaled_font (cairo_t * cr)
 
     font_options = cairo_font_options_create ();
 
-    /* disable hinting */
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
+    cairo_get_font_options (cr, font_options);
 
     pattern = FcPatternCreate ();
 
diff --git a/test/ft-text-vertical-layout.c b/test/ft-text-vertical-layout.c
index d7638ee..334fe60 100644
--- a/test/ft-text-vertical-layout.c
+++ b/test/ft-text-vertical-layout.c
@@ -55,10 +55,7 @@ create_scaled_font (cairo_t * cr)
 
     font_options = cairo_font_options_create ();
 
-    /* disable hinting */
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    /* enable antialias and override screen settings */
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
+    cairo_get_font_options (cr, font_options);
 
     pattern = FcPatternCreate ();
 
diff --git a/test/glyph-cache-pressure.c b/test/glyph-cache-pressure.c
index 5b5e6c4..ba90fa3 100644
--- a/test/glyph-cache-pressure.c
+++ b/test/glyph-cache-pressure.c
@@ -61,8 +61,6 @@ cairo_test_t test = {
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_font_options_t *font_options;
-
     /* We draw in the default black, so paint white first. */
     cairo_save (cr);
     cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
@@ -76,14 +74,6 @@ draw (cairo_t *cr, int width, int height
 			    CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size (cr, TEXT_SIZE);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     cairo_set_source_rgb (cr, 0, 0, 0); /* black */
 
     cairo_move_to (cr, 1, TEXT_SIZE);
diff --git a/test/operator-clear.c b/test/operator-clear.c
index 575ce1d..ea9fcf8 100644
--- a/test/operator-clear.c
+++ b/test/operator-clear.c
@@ -159,21 +159,12 @@ static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
     int i, j, x, y;
-    cairo_font_options_t *font_options;
     cairo_pattern_t *pattern;
 
     cairo_select_font_face (cr, "Bitstream Vera Sans",
 			    CAIRO_FONT_SLANT_NORMAL,
 			    CAIRO_FONT_WEIGHT_NORMAL);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     for (j = 0; j < ARRAY_SIZE (draw_funcs); j++) {
 	for (i = 0; i < ARRAY_SIZE (pattern_funcs); i++) {
 	    x = i * (WIDTH + PAD) + PAD;
diff --git a/test/operator-source.c b/test/operator-source.c
index 6784622..4bea793 100644
--- a/test/operator-source.c
+++ b/test/operator-source.c
@@ -198,21 +198,12 @@ static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
     int i, j, x, y;
-    cairo_font_options_t *font_options;
     cairo_pattern_t *pattern;
 
     cairo_select_font_face (cr, "Bitstream Vera Sans",
 			    CAIRO_FONT_SLANT_NORMAL,
 			    CAIRO_FONT_WEIGHT_NORMAL);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     for (j = 0; j < ARRAY_SIZE (draw_funcs); j++) {
 	for (i = 0; i < ARRAY_SIZE (pattern_funcs); i++) {
 	    x = i * (WIDTH + PAD) + PAD;
diff --git a/test/select-font-face.c b/test/select-font-face.c
index 30daf25..57120ca 100644
--- a/test/select-font-face.c
+++ b/test/select-font-face.c
@@ -39,23 +39,12 @@ cairo_test_t test = {
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_font_options_t *font_options;
-
     /* We draw in the default black, so paint white first. */
     cairo_save (cr);
     cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
     cairo_paint (cr);
     cairo_restore (cr);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_OFF);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     cairo_set_source_rgb (cr, 0, 0, 0); /* black */
 
     cairo_select_font_face (cr, "Bitstream Vera Serif",
diff --git a/test/show-glyphs-many.c b/test/show-glyphs-many.c
index f9137e6..9931a25 100644
--- a/test/show-glyphs-many.c
+++ b/test/show-glyphs-many.c
@@ -91,7 +91,6 @@ static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
     cairo_glyph_t glyphs[NUM_GLYPHS];
-    cairo_font_options_t *font_options;
     int i;
 
     /* Initialize our giant array of glyphs. */
@@ -110,14 +109,6 @@ draw (cairo_t *cr, int width, int height
 			    CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size (cr, TEXT_SIZE);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     cairo_show_glyphs (cr, glyphs, NUM_GLYPHS);
 
     return CAIRO_TEST_SUCCESS;
diff --git a/test/show-text-current-point.c b/test/show-text-current-point.c
index ebd3644..5ff3675 100644
--- a/test/show-text-current-point.c
+++ b/test/show-text-current-point.c
@@ -39,8 +39,6 @@ cairo_test_t test = {
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_font_options_t *font_options;
-
     /* We draw in the default black, so paint white first. */
     cairo_save (cr);
     cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
@@ -52,14 +50,6 @@ draw (cairo_t *cr, int width, int height
 			    CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size (cr, TEXT_SIZE);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     cairo_set_source_rgb (cr, 0, 0, 0); /* black */
 
     cairo_move_to (cr, 0, TEXT_SIZE);
diff --git a/test/text-antialias-gray.c b/test/text-antialias-gray.c
index 0c9f30d..8090d8e 100644
--- a/test/text-antialias-gray.c
+++ b/test/text-antialias-gray.c
@@ -57,12 +57,9 @@ draw (cairo_t *cr, int width, int height
     cairo_set_font_size (cr, TEXT_SIZE);
 
     font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
+    cairo_get_font_options (cr, font_options);
     cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
     cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
 
     cairo_set_source_rgb (cr, 0, 0, 0); /* black */
     cairo_text_extents (cr, black, &extents);
diff --git a/test/text-antialias-none.c b/test/text-antialias-none.c
index 32f7a0e..f9c86a9 100644
--- a/test/text-antialias-none.c
+++ b/test/text-antialias-none.c
@@ -57,12 +57,9 @@ draw (cairo_t *cr, int width, int height
     cairo_set_font_size (cr, TEXT_SIZE);
 
     font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
+    cairo_get_font_options (cr, font_options);
     cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_NONE);
-
     cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
 
     cairo_set_source_rgb (cr, 0, 0, 0); /* black */
     cairo_text_extents (cr, black, &extents);
diff --git a/test/text-antialias-subpixel.c b/test/text-antialias-subpixel.c
index aba9890..af0112a 100644
--- a/test/text-antialias-subpixel.c
+++ b/test/text-antialias-subpixel.c
@@ -53,16 +53,12 @@ draw (cairo_t *cr, int width, int height
 			    CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size (cr, TEXT_SIZE);
 
-    /* Sub-pixel antialiasing with unhinted glyphs can be pretty ugly
-     * (bad color fringing). The reason we turn off hints here is to
-     * try to get repeatable glyph shapes on multiple systems, not for
-     * any aesthetic reason. */
     font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
+    cairo_get_font_options (cr, font_options);
     cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_SUBPIXEL);
     cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_RGB);
     cairo_set_font_options (cr, font_options);
+
     cairo_font_options_destroy (font_options);
 
     cairo_set_source_rgb (cr, 0, 0, 0); /* black */
diff --git a/test/text-pattern.c b/test/text-pattern.c
index 40a2a45..02feb22 100644
--- a/test/text-pattern.c
+++ b/test/text-pattern.c
@@ -40,17 +40,8 @@ cairo_test_t test = {
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-  cairo_font_options_t *font_options;
   cairo_pattern_t *pat;
 
-  font_options = cairo_font_options_create ();
-
-  cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-  cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-  cairo_set_font_options (cr, font_options);
-  cairo_font_options_destroy (font_options);
-
   cairo_select_font_face (cr, "Bitstream Vera Sans",
 			  CAIRO_FONT_SLANT_NORMAL,
 			  CAIRO_FONT_WEIGHT_NORMAL);
diff --git a/test/text-rotate.c b/test/text-rotate.c
index abc6baa..50d907b 100644
--- a/test/text-rotate.c
+++ b/test/text-rotate.c
@@ -110,9 +110,8 @@ draw (cairo_t *cr, int width, int height
 
     font_options = cairo_font_options_create ();
 
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
+    cairo_get_font_options (cr, font_options);
     cairo_font_options_set_hint_metrics (font_options, CAIRO_HINT_METRICS_OFF);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
 
     cairo_set_font_options (cr, font_options);
     cairo_font_options_destroy (font_options);
diff --git a/test/unbounded-operator.c b/test/unbounded-operator.c
index 70dab83..d3a6f35 100644
--- a/test/unbounded-operator.c
+++ b/test/unbounded-operator.c
@@ -145,21 +145,12 @@ static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
     int i, j, x, y;
-    cairo_font_options_t *font_options;
     cairo_pattern_t *pattern;
 
     cairo_select_font_face (cr, "Bitstream Vera Sans",
 			    CAIRO_FONT_SLANT_NORMAL,
 			    CAIRO_FONT_WEIGHT_NORMAL);
 
-    font_options = cairo_font_options_create ();
-
-    cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE);
-    cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY);
-
-    cairo_set_font_options (cr, font_options);
-    cairo_font_options_destroy (font_options);
-
     for (j = 0; j < ARRAY_SIZE (draw_funcs); j++) {
 	for (i = 0; i < ARRAY_SIZE (operators); i++) {
 	    x = i * (WIDTH + PAD) + PAD;
diff-tree 9fcb3c32c1f16fe6ab913e27eb54d18b7d9a06b0 (from a61ac1aeedca3a032b9d53715afb5d52c06efec0)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jul 31 14:50:50 2006 -0400

    Set fallback resolution in create_similar.  Update docs to reflect that.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index ceceab5..cad5a33 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -261,6 +261,10 @@ _cairo_surface_create_similar_scratch (c
     cairo_surface_get_font_options (other, &options);
     _cairo_surface_set_font_options (surface, &options);
 
+    cairo_surface_set_fallback_resolution (surface,
+					   other->x_fallback_resolution,
+					   other->y_fallback_resolution);
+
     return surface;
 }
 
@@ -273,8 +277,10 @@ _cairo_surface_create_similar_scratch (c
  *
  * Create a new surface that is as compatible as possible with an
  * existing surface. The new surface will use the same backend as
- * @other unless that is not possible for some reason. The type of the
- * returned surface may be examined with cairo_surface_get_type().
+ * @other unless that is not possible for some reason. However, the
+ * created surface will have same fallback resolution and font options
+ * as the existing surface.  The type of the returned surface may be
+ * examined with cairo_surface_get_type().
  * Initially the surface contents are all 0 (transparent if contents
  * have transparency, black otherwise.)
  *
diff-tree a61ac1aeedca3a032b9d53715afb5d52c06efec0 (from b3341b4eda274036a74eea3187d47ef257688828)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jul 31 14:47:10 2006 -0400

    Set font_options on image surfaces we create.
    This may not be really necessary as we only create image surfaces as
    temporary surfaces and their font options should not be sampled normally.

diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 4938b38..79b3956 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -163,6 +163,25 @@ _cairo_paginated_surface_finish (void *a
     return CAIRO_STATUS_SUCCESS;
 }
 
+static cairo_surface_t *
+_cairo_paginated_surface_create_image_surface (void	       *abstract_surface,
+					       int		width,
+					       int		height)
+{
+    cairo_paginated_surface_t *surface = abstract_surface;
+    cairo_surface_t *image;
+    cairo_font_options_t options;
+
+    image = _cairo_image_surface_create_with_content (surface->content,
+						      width,
+						      height);
+
+    cairo_surface_get_font_options (surface, &options);
+    _cairo_surface_set_font_options (image, &options);
+
+    return image;
+}
+
 static cairo_status_t
 _cairo_paginated_surface_acquire_source_image (void	       *abstract_surface,
 					       cairo_image_surface_t **image_out,
@@ -174,9 +193,9 @@ _cairo_paginated_surface_acquire_source_
 
     _cairo_surface_get_extents (surface->target, &extents);
 
-    image = _cairo_image_surface_create_with_content (surface->content,
-						      extents.width,
-						      extents.height);
+    image = _cairo_paginated_surface_create_image_surface (surface,
+							   extents.width,
+							   extents.height);
 
     _cairo_meta_surface_replay (surface->meta, image);
 
@@ -221,9 +240,9 @@ _paint_page (cairo_paginated_surface_t *
 	double y_scale = surface->base.y_fallback_resolution / 72.0;
 	cairo_matrix_t matrix;
 
-	image = _cairo_image_surface_create_with_content (surface->content,
-							  surface->width * x_scale,
-							  surface->height * y_scale);
+	image = _cairo_paginated_surface_create_image_surface (surface,
+							       surface->width  * x_scale,
+							       surface->height * y_scale);
 	_cairo_surface_set_device_scale (image, x_scale, y_scale);
 
 	_cairo_meta_surface_replay (surface->meta, image);
@@ -460,9 +479,9 @@ _cairo_paginated_surface_snapshot (void 
 
     _cairo_surface_get_extents (other->target, &extents);
 
-    surface = _cairo_image_surface_create_with_content (other->content,
-							extents.width,
-							extents.height);
+    surface = _cairo_paginated_surface_create_image_surface (other,
+							     extents.width,
+							     extents.height);
 
     _cairo_meta_surface_replay (other->meta, surface);
 
diff-tree b3341b4eda274036a74eea3187d47ef257688828 (from bdb4e1edadb78a2118ff70b28163f8bd4317f1ec)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jul 31 14:45:54 2006 -0400

    Let backends return NULL in create_similar to take the fallback path.
    Make xlib backend use it.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 914e2c7..ceceab5 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -244,7 +244,7 @@ _cairo_surface_create_similar_scratch (c
 				       int		width,
 				       int		height)
 {
-    cairo_surface_t *surface;
+    cairo_surface_t *surface = NULL;
     cairo_font_options_t options;
 
     cairo_format_t format = _cairo_format_from_content (content);
@@ -254,7 +254,8 @@ _cairo_surface_create_similar_scratch (c
 
     if (other->backend->create_similar)
 	surface = other->backend->create_similar (other, content, width, height);
-    else
+
+    if (!surface)
 	surface = cairo_image_surface_create (format, width, height);
 
     cairo_surface_get_font_options (other, &options);
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 58ad459..3d0d71d 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -219,10 +219,11 @@ _cairo_xlib_surface_create_similar_with_
 
     /* As a good first approximation, if the display doesn't have even
      * the most elementary RENDER operation, then we're better off
-     * using image surfaces for all temporary operations
+     * using image surfaces for all temporary operations, so return NULL
+     * and let the fallback code happen.
      */
     if (!CAIRO_SURFACE_RENDER_HAS_COMPOSITE(src)) {
-	return cairo_image_surface_create (format, width, height);
+	return NULL;
     }
 
     pix = XCreatePixmap (dpy, RootWindowOfScreen (src->screen),
diff-tree bdb4e1edadb78a2118ff70b28163f8bd4317f1ec (from a8a0082c53d060e07c10c6efda9bb808e354fd59)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jul 31 14:44:42 2006 -0400

    Implement per-surface font options.
    New internal function _cairo_surface_set_font_options is used to set them.
    cairo_surface_create_similar propagates the font options of the other
    surface into the newly created surface.  Fixes bugs with font options in
    fallback images and bug 4106.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index fb25e07..914e2c7 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -234,6 +234,8 @@ _cairo_surface_init (cairo_surface_t			*
     surface->current_clip_serial = 0;
 
     surface->is_snapshot = FALSE;
+
+    surface->has_font_options = FALSE;
 }
 
 cairo_surface_t *
@@ -242,15 +244,23 @@ _cairo_surface_create_similar_scratch (c
 				       int		width,
 				       int		height)
 {
+    cairo_surface_t *surface;
+    cairo_font_options_t options;
+
     cairo_format_t format = _cairo_format_from_content (content);
 
     if (other->status)
 	return (cairo_surface_t*) &_cairo_surface_nil;
 
     if (other->backend->create_similar)
-	return other->backend->create_similar (other, content, width, height);
+	surface = other->backend->create_similar (other, content, width, height);
     else
-	return cairo_image_surface_create (format, width, height);
+	surface = cairo_image_surface_create (format, width, height);
+
+    cairo_surface_get_font_options (other, &options);
+    _cairo_surface_set_font_options (surface, &options);
+
+    return surface;
 }
 
 /**
@@ -503,6 +513,33 @@ cairo_surface_set_user_data (cairo_surfa
 }
 
 /**
+ * _cairo_surface_set_font_options:
+ * @surface: a #cairo_surface_t
+ * @options: a #cairo_font_options_t object that contains the
+ *   options to use for this surface instead of backend's default
+ *   font options.
+ *
+ * Sets the default font rendering options for the surface.
+ * This is useful to correctly propagate default font options when
+ * falling back to an image surface in a backend implementation.
+ * This affects the options returned in cairo_surface_get_font_options().
+ *
+ * If @options is %NULL the surface options are reset to those of
+ * the backend default.
+ **/
+void
+_cairo_surface_set_font_options (cairo_surface_t       *surface,
+				 cairo_font_options_t  *options)
+{
+    if (options) {
+	surface->has_font_options = TRUE;
+	_cairo_font_options_init_copy (&surface->font_options, options);
+    } else {
+	surface->has_font_options = FALSE;
+    }
+}
+
+/**
  * cairo_surface_get_font_options:
  * @surface: a #cairo_surface_t
  * @options: a #cairo_font_options_t object into which to store
@@ -518,11 +555,17 @@ void
 cairo_surface_get_font_options (cairo_surface_t       *surface,
 				cairo_font_options_t  *options)
 {
-    if (!surface->finished && surface->backend->get_font_options) {
-	surface->backend->get_font_options (surface, options);
-    } else {
-	_cairo_font_options_init_default (options);
+    if (!surface->has_font_options) {
+	surface->has_font_options = TRUE;
+
+	if (!surface->finished && surface->backend->get_font_options) {
+	    surface->backend->get_font_options (surface, &surface->font_options);
+	} else {
+	    _cairo_font_options_init_default (&surface->font_options);
+	}
     }
+
+    _cairo_font_options_init_copy (options, &surface->font_options);
 }
 
 /**
diff --git a/src/cairoint.h b/src/cairoint.h
index 4eb0c3c..7cf955d 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -893,6 +893,14 @@ struct _cairo_surface {
 
     /* A "snapshot" surface is immutable. See _cairo_surface_snapshot. */
     cairo_bool_t is_snapshot;
+
+    /*
+     * Surface font options, falling back to backend's default options,
+     * and set using _cairo_surface_set_font_options(), and propagated by
+     * cairo_surface_create_similar().
+     */
+    cairo_bool_t has_font_options;
+    cairo_font_options_t font_options;
 };
 
 struct _cairo_image_surface {
@@ -1670,6 +1678,10 @@ _cairo_surface_init (cairo_surface_t			*
 		     const cairo_surface_backend_t	*backend,
 		     cairo_content_t			 content);
 
+void
+_cairo_surface_set_font_options (cairo_surface_t       *surface,
+				 cairo_font_options_t  *options);
+
 cairo_private cairo_clip_mode_t
 _cairo_surface_get_clip_mode (cairo_surface_t *surface);
 
diff-tree a8a0082c53d060e07c10c6efda9bb808e354fd59 (from 88675958efbe57c7cc5135d6fb73e99f42d848d8)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jul 31 14:41:27 2006 -0400

    Remove dummy create_similar in PS/PDF and let fallback do the same
    which is simply creating an image surface.

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index aaf71c7..9646c21 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -453,19 +453,6 @@ _cairo_pdf_surface_clear (cairo_pdf_surf
     _cairo_array_truncate (&surface->streams, 0);
 }
 
-static cairo_surface_t *
-_cairo_pdf_surface_create_similar (void		       *abstract_src,
-				   cairo_content_t	content,
-				   int			width,
-				   int			height)
-{
-    cairo_format_t format = _cairo_format_from_content (content);
-
-    /* Just return an image for now, until PDF surface can be used
-     * as source. */
-    return cairo_image_surface_create (format, width, height);
-}
-
 static cairo_pdf_resource_t
 _cairo_pdf_surface_open_stream (cairo_pdf_surface_t	*surface,
 				const char		*fmt,
@@ -2638,7 +2625,7 @@ _cairo_pdf_surface_set_paginated_mode (v
 
 static const cairo_surface_backend_t cairo_pdf_surface_backend = {
     CAIRO_SURFACE_TYPE_PDF,
-    _cairo_pdf_surface_create_similar,
+    NULL, /* create_similar */
     _cairo_pdf_surface_finish,
     NULL, /* acquire_source_image */
     NULL, /* release_source_image */
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 3856aa2..6802b5b 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -1126,19 +1126,6 @@ cairo_ps_surface_dsc_begin_page_setup (c
     }
 }
 
-static cairo_surface_t *
-_cairo_ps_surface_create_similar (void		       *abstract_src,
-				   cairo_content_t	content,
-				   int			width,
-				   int			height)
-{
-    cairo_format_t format = _cairo_format_from_content (content);
-
-    /* Just return an image for now, until PS surface can be used
-     * as source. */
-    return cairo_image_surface_create (format, width, height);
-}
-
 static cairo_status_t
 _cairo_ps_surface_finish (void *abstract_surface)
 {
@@ -2113,7 +2100,7 @@ _cairo_ps_surface_set_paginated_mode (vo
 
 static const cairo_surface_backend_t cairo_ps_surface_backend = {
     CAIRO_SURFACE_TYPE_PS,
-    _cairo_ps_surface_create_similar,
+    NULL, /* create_similar */
     _cairo_ps_surface_finish,
     NULL, /* acquire_source_image */
     NULL, /* release_source_image */


More information about the cairo-commit mailing list