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

Bryce Harrington bryce at kemper.freedesktop.org
Thu Mar 16 03:27:08 UTC 2017


 src/cairo-surface.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit cffa452f44eadebef8553502e3d6cc49829d38ce
Author: Debarshi Ray <debarshir at freedesktop.org>
Date:   Thu Dec 15 12:50:13 2016 +0100

    doc: Clarify when the device scale is inherited and when it isn't
    
    In short, cairo_surface_create_similar inherits it, while
    cairo_surface_create_similar_image doesn't. It wasn't obvious without
    reading the code or explicitly checking the device scale of the new
    surface.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99094
    
    Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index f56e0f8..fc5f876 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -466,10 +466,11 @@ _cairo_surface_copy_similar_properties (cairo_surface_t *surface,
  *
  * Create a new surface that is as compatible as possible with an
  * 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().
+ * device scale, 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.)
@@ -556,7 +557,9 @@ cairo_surface_create_similar (cairo_surface_t  *other,
  *
  * Create a new image surface that is as compatible as possible for uploading
  * to and the use in conjunction with an existing surface. However, this surface
- * can still be used like any normal image surface.
+ * can still be used like any normal image surface. Unlike
+ * cairo_surface_create_similar() the new image surface won't inherit
+ * the device scale from @other.
  *
  * Initially the surface contents are all 0 (transparent if contents
  * have transparency, black otherwise.)
commit 1192f97388ba428a623670107a96fc13cbf97ee9
Author: Debarshi Ray <debarshir at freedesktop.org>
Date:   Thu Dec 15 12:41:39 2016 +0100

    doc: Fix the units used by cairo_surface_create_similar_image
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99094
    
    Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 6d3ac19..f56e0f8 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -551,8 +551,8 @@ cairo_surface_create_similar (cairo_surface_t  *other,
  * cairo_surface_create_similar_image:
  * @other: an existing surface used to select the preference of the new surface
  * @format: the format for the new surface
- * @width: width of the new surface, (in device-space units)
- * @height: height of the new surface (in device-space units)
+ * @width: width of the new surface, (in pixels)
+ * @height: height of the new surface (in pixels)
  *
  * Create a new image surface that is as compatible as possible for uploading
  * to and the use in conjunction with an existing surface. However, this surface


More information about the cairo-commit mailing list