[cairo-commit] cairo/test .cvsignore, 1.35, 1.36 Makefile.am, 1.62, 1.63 composite-integer-translate-over-repeat.c, NONE, 1.1 composite-integer-translate-over.c, NONE, 1.1 composite-integer-translate-source.c, NONE, 1.1 composite-integer-translate-over-ref.png, NONE, 1.1 composite-integer-translate-over-repeat-ref.png, NONE, 1.1 composite-integer-translate-source-ref.png, NONE, 1.1

Vladimir Vukicevic commit at pdx.freedesktop.org
Fri Jul 15 13:45:22 PDT 2005


Committed by: vladimir

Update of /cvs/cairo/cairo/test
In directory gabe:/tmp/cvs-serv30887/test

Modified Files:
	.cvsignore Makefile.am 
Added Files:
	composite-integer-translate-over-repeat.c 
	composite-integer-translate-over.c 
	composite-integer-translate-source.c 
	composite-integer-translate-over-ref.png 
	composite-integer-translate-over-repeat-ref.png 
	composite-integer-translate-source-ref.png 
Log Message:
2005-07-15  Vladimir Vukicevic  <vladimir at pobox.com>

	* src/cairo-xlib-surface.c: (_cairo_xlib_surface_composite,
	_recategorize_composite_repeat): Use XCopyArea when
	possible, for optimization and bug workaround.

	* test/composite-integer-translate-{source,over,over-repeat}.c:
	Exercise XCopyArea, XRenderComposite, and XSetTile/XFillRectangle
	paths for _cairo_xlib_surface_composite



Index: .cvsignore
===================================================================
RCS file: /cvs/cairo/cairo/test/.cvsignore,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- .cvsignore	14 Jul 2005 18:17:12 -0000	1.35
+++ .cvsignore	15 Jul 2005 20:45:19 -0000	1.36
@@ -4,6 +4,9 @@
 Makefile.in
 clip-nesting
 clip-twice
+composite-integer-translate-source
+composite-integer-translate-over
+composite-integer-translate-over-repeat
 coverage
 create-from-png
 fill-and-stroke

Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/cairo/test/Makefile.am,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- Makefile.am	15 Jul 2005 17:39:59 -0000	1.62
+++ Makefile.am	15 Jul 2005 20:45:19 -0000	1.63
@@ -2,6 +2,9 @@
 TESTS = 			\
 clip-nesting			\
 clip-twice			\
+composite-integer-translate-source \
+composite-integer-translate-over \
+composite-integer-translate-over-repeat \
 create-from-png			\
 fill-and-stroke			\
 fill-rule			\
@@ -52,6 +55,9 @@
 EXTRA_DIST =				\
 clip-nesting-ref.png			\
 clip-twice-ref.png			\
+composite-integer-translate-source-ref.png		\
+composite-integer-translate-over-ref.png		\
+composite-integer-translate-over-repeat-ref.png		\
 create-from-png-ref.png			\
 fill-and-stroke-ref.png			\
 fill-rule-ref.png			\
@@ -133,6 +139,9 @@
 # from autogen.sh. My, but this is painful...
 clip_nesting_LDADD = $(LDADDS)
 clip_twice_LDADD = $(LDADDS)
+composite_integer_translate_source_LDADD = $(LDADDS)
+composite_integer_translate_over_LDADD = $(LDADDS)
+composite_integer_translate_over_repeat_LDADD = $(LDADDS)
 create_from_png_LDADD = $(LDADDS)
 fill_and_stroke_LDADD = $(LDADDS)
 fill_rule_LDADD = $(LDADDS)
@@ -181,4 +190,4 @@
 	pdf-clip.pdf
 
 check-valgrind:
-	TESTS_ENVIRONMENT="libtool --mode=execute valgrind --tool=memcheck --leak-check=yes --show-reachable=yes" $(MAKE) check
\ No newline at end of file
+	TESTS_ENVIRONMENT="libtool --mode=execute valgrind --tool=memcheck --leak-check=yes --show-reachable=yes" $(MAKE) check

--- NEW FILE: composite-integer-translate-over-repeat.c ---
#include <math.h>
#include "cairo-test.h"
#include <stdio.h>

#define SIZE 100
#define SIZE2 20
#define OFFSET 10

cairo_test_t test = {
    "composite-integer-translate-over-repeat",
    "Test simple compositing: integer-translation 32->32 OVER, with repeat",
    SIZE, SIZE
};

static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
    cairo_surface_t *image;
    cairo_pattern_t *pat;
    cairo_t *cr2;

    image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, SIZE2, SIZE2);

    cr2 = cairo_create (image);
    cairo_set_source_rgba (cr2, 1, 0, 0, 1);
    cairo_rectangle (cr2, 0, 0, SIZE2/2, SIZE2/2);
    cairo_fill (cr2);
    cairo_set_source_rgba (cr2, 0, 1, 0, 1);
    cairo_rectangle (cr2, SIZE2/2, 0, SIZE2/2, SIZE2/2);
    cairo_fill (cr2);
    cairo_set_source_rgba (cr2, 0, 0, 1, 1);
    cairo_rectangle (cr2, 0, SIZE2/2, SIZE2/2, SIZE2/2);
    cairo_fill (cr2);
    cairo_set_source_rgba (cr2, 1, 1, 0, 1);
    cairo_rectangle (cr2, SIZE2/2, SIZE2/2, SIZE2/2, SIZE2/2);
    cairo_fill (cr2);
    cairo_destroy (cr2);

    pat = cairo_pattern_create_for_surface (image);
    cairo_pattern_set_extend (pat, CAIRO_EXTEND_REPEAT);

    cairo_set_source_rgba (cr, 0, 0, 0, 1);
    cairo_rectangle (cr, 0, 0, SIZE, SIZE);
    cairo_fill (cr);

    cairo_translate (cr, OFFSET, OFFSET);
    cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
    cairo_set_source (cr, pat);
    cairo_rectangle (cr, 0, 0, SIZE - OFFSET, SIZE - OFFSET);
    cairo_fill (cr);

    cairo_surface_destroy (image);

    return CAIRO_TEST_SUCCESS;
}

int
main (void)
{
    return cairo_test (&test, draw);
}

--- NEW FILE: composite-integer-translate-over.c ---
#include <math.h>
#include "cairo-test.h"
#include <stdio.h>

#define SIZE 100
#define OFFSET 5.5
#define SCALE 1.5
const char	png_filename[]	= "romedalen.png";

cairo_test_t test = {
    "composite-integer-translate-over",
    "Test simple compositing: integer-translation 32->32 OVER",
    SIZE, SIZE
};

static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
    cairo_surface_t *image;

    image = cairo_image_surface_create_from_png (png_filename);

    cairo_set_source_rgba (cr, 0, 0, 0, 1);
    cairo_rectangle (cr, 0, 0, SIZE, SIZE);
    cairo_fill (cr);

    cairo_translate (cr, OFFSET, OFFSET);
    cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
    cairo_set_source_surface (cr, image, 0, 0);
    cairo_rectangle (cr, 0, 0, (SIZE-OFFSET), (SIZE-OFFSET));
    cairo_fill (cr);

    cairo_surface_destroy (image);

    return CAIRO_TEST_SUCCESS;
}

int
main (void)
{
    return cairo_test (&test, draw);
}

--- NEW FILE: composite-integer-translate-source.c ---
#include <math.h>
#include "cairo-test.h"
#include <stdio.h>

#define SIZE 100
#define OFFSET 10

const char	png_filename[]	= "romedalen.png";

cairo_test_t test = {
    "composite-integer-translate-source",
    "Test simple compositing: integer-translation 32->32 SOURCE",
    SIZE, SIZE
};

static cairo_test_status_t
draw (cairo_t *cr, int width, int height)
{
    cairo_surface_t *image;

    image = cairo_image_surface_create_from_png (png_filename);

    cairo_set_source_rgba (cr, 0, 0, 0, 1);
    cairo_rectangle (cr, 0, 0, SIZE, SIZE);
    cairo_fill (cr);

    cairo_translate (cr, OFFSET, OFFSET);
    cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
    cairo_set_source_surface (cr, image, 0, 0);
    cairo_rectangle (cr, 0, 0, SIZE - OFFSET, SIZE - OFFSET);
    cairo_fill (cr);

    cairo_surface_destroy (image);

    return CAIRO_TEST_SUCCESS;
}

int
main (void)
{
    return cairo_test (&test, draw);
}

--- NEW FILE: composite-integer-translate-over-ref.png ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: composite-integer-translate-over-repeat-ref.png ---
(This appears to be a binary file; contents omitted.)

--- NEW FILE: composite-integer-translate-source-ref.png ---
(This appears to be a binary file; contents omitted.)




More information about the cairo-commit mailing list