[cairo-commit] 3 commits - src/cairo-fixed-private.h src/cairo-image-surface.c src/cairo-wideint.c src/drm test/a1-traps-sample.ref.png test/unantialiased-shapes.ref.png
Benjamin Otte
company at kemper.freedesktop.org
Thu Apr 29 13:35:59 PDT 2010
src/cairo-fixed-private.h | 6 ++++++
src/cairo-image-surface.c | 11 ++++++-----
src/cairo-wideint.c | 2 +-
src/drm/cairo-drm-i965-shader.c | 2 +-
test/a1-traps-sample.ref.png |binary
test/unantialiased-shapes.ref.png |binary
6 files changed, 14 insertions(+), 7 deletions(-)
New commits:
commit e3f990d84131f7bd1e64e54d02bac780b1e9f85e
Author: Benjamin Otte <otte at redhat.com>
Date: Thu Apr 29 22:34:35 2010 +0200
test: Update reference images for last checkin
Both tests now pas on all backends I tested: test, image, xlib and
recording
diff --git a/test/a1-traps-sample.ref.png b/test/a1-traps-sample.ref.png
index b4e81eb..384ba4a 100644
Binary files a/test/a1-traps-sample.ref.png and b/test/a1-traps-sample.ref.png differ
diff --git a/test/unantialiased-shapes.ref.png b/test/unantialiased-shapes.ref.png
index c909d38..0e20fb8 100644
Binary files a/test/unantialiased-shapes.ref.png and b/test/unantialiased-shapes.ref.png differ
commit 6d36f06751377459e35afe1ac26c59d33b16c730
Author: Benjamin Otte <otte at redhat.com>
Date: Thu Apr 29 22:12:02 2010 +0200
image: Round down when rendering antialiased boxes
Matches Pixman's output when going via pixman_rasterize_trapezoid()
diff --git a/src/cairo-fixed-private.h b/src/cairo-fixed-private.h
index 75ecc06..b308794 100644
--- a/src/cairo-fixed-private.h
+++ b/src/cairo-fixed-private.h
@@ -166,6 +166,12 @@ _cairo_fixed_integer_round (cairo_fixed_t f)
}
static inline int
+_cairo_fixed_integer_round_down (cairo_fixed_t f)
+{
+ return (f + CAIRO_FIXED_FRAC_MASK/2) >> CAIRO_FIXED_FRAC_BITS;
+}
+
+static inline int
_cairo_fixed_fractional_part (cairo_fixed_t f)
{
return f & CAIRO_FIXED_FRAC_MASK;
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index a6953fb..b2b69d3 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -2864,10 +2864,11 @@ _composite_boxes (cairo_image_surface_t *dst,
cairo_box_t *box = chunk->base;
for (i = 0; i < chunk->count; i++) {
- int x1 = _cairo_fixed_integer_round (box[i].p1.x);
- int y1 = _cairo_fixed_integer_round (box[i].p1.y);
- int x2 = _cairo_fixed_integer_round (box[i].p2.x);
- int y2 = _cairo_fixed_integer_round (box[i].p2.y);
+ /* round down here to match Pixman's behavior when using traps. */
+ int x1 = _cairo_fixed_integer_round_down (box[i].p1.x);
+ int y1 = _cairo_fixed_integer_round_down (box[i].p1.y);
+ int x2 = _cairo_fixed_integer_round_down (box[i].p2.x);
+ int y2 = _cairo_fixed_integer_round_down (box[i].p2.y);
if (x2 == x1 || y2 == y1)
continue;
commit 95179a5de91b5c6f99dbccc3b6c950df58d4f2a7
Author: Benjamin Otte <otte at redhat.com>
Date: Thu Apr 29 20:45:23 2010 +0200
Remove excessive semicolons
s/;;/;/ basically
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index e66dae3..a6953fb 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -3111,7 +3111,7 @@ _clip_and_composite_trapezoids (cairo_image_surface_t *dst,
/* Otherwise render the trapezoids to a mask and composite in the usual
* fashion.
*/
- info.traps = traps->traps;;
+ info.traps = traps->traps;
info.num_traps = traps->num_traps;
info.antialias = antialias;
return _clip_and_composite (dst, op, src,
diff --git a/src/cairo-wideint.c b/src/cairo-wideint.c
index d009f56..78dedcd 100644
--- a/src/cairo-wideint.c
+++ b/src/cairo-wideint.c
@@ -802,7 +802,7 @@ _cairo_int_96by64_32x64_divrem (cairo_int128_t num, cairo_int64_t den)
uqr = _cairo_uint_96by64_32x64_divrem (num, nonneg_den);
if (_cairo_uint64_eq (uqr.rem, nonneg_den)) {
/* bail on overflow. */
- qr.quo = _cairo_uint32s_to_uint64 (0x7FFFFFFF, -1U);;
+ qr.quo = _cairo_uint32s_to_uint64 (0x7FFFFFFF, -1U);
qr.rem = den;
return qr;
}
diff --git a/src/drm/cairo-drm-i965-shader.c b/src/drm/cairo-drm-i965-shader.c
index 1046f79..d76726c 100644
--- a/src/drm/cairo-drm-i965-shader.c
+++ b/src/drm/cairo-drm-i965-shader.c
@@ -2120,7 +2120,7 @@ i965_stream_add_pending_relocation (i965_stream_t *stream,
stream->pending_relocations[n].offset = target_offset;
stream->pending_relocations[n].read_domains = read_domains;
- stream->pending_relocations[n].write_domain = write_domain;;
+ stream->pending_relocations[n].write_domain = write_domain;
stream->pending_relocations[n].delta = delta;
}
More information about the cairo-commit
mailing list