[cairo-commit] rendertest/src args.c, 1.3, 1.4 glitz.c, 1.4,
1.5 glitz_agl.c, 1.5, 1.6 glitz_common.h, 1.3, 1.4 glitz_glx.c,
1.5, 1.6 pixman.c, 1.1, 1.2 rendertest.c, 1.8,
1.9 rendertest.h, 1.3, 1.4 xcb.c, 1.5, 1.6
David Reveman
commit at pdx.freedesktop.org
Wed Nov 3 15:51:06 PST 2004
Committed by: davidr
Update of /cvs/cairo/rendertest/src
In directory gabe:/tmp/cvs-serv14411/src
Modified Files:
args.c glitz.c glitz_agl.c glitz_common.h glitz_glx.c pixman.c
rendertest.c rendertest.h xcb.c
Log Message:
Tracking changes to glitz
Index: args.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/args.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- args.c 3 Sep 2004 14:29:26 -0000 1.3
+++ args.c 3 Nov 2004 23:51:04 -0000 1.4
@@ -133,8 +133,6 @@
return RENDER_OPERATOR_XOR;
else if (strcasecmp (op, "ADD") == 0)
return RENDER_OPERATOR_ADD;
- else if (strcasecmp (op, "SATURATE") == 0)
- return RENDER_OPERATOR_SATURATE;
else
return RENDER_OPERATOR_OVER;
}
Index: glitz.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- glitz.c 6 Sep 2004 22:28:24 -0000 1.4
+++ glitz.c 3 Nov 2004 23:51:04 -0000 1.5
@@ -78,8 +78,6 @@
return GLITZ_OPERATOR_XOR;
case RENDER_OPERATOR_ADD:
return GLITZ_OPERATOR_ADD;
- case RENDER_OPERATOR_SATURATE:
- return GLITZ_OPERATOR_SATURATE;
default:
return GLITZ_OPERATOR_OVER;
}
@@ -144,16 +142,12 @@
int height)
{
render_surface_t *similar;
- glitz_format_name_t format_name;
+ glitz_drawable_t *drawable;
glitz_format_t *format;
- format_name = _glitz_format (render_format);
-
- format =
- glitz_surface_find_similar_standard_format ((glitz_surface_t *)
- other->surface,
- format_name);
-
+ drawable = glitz_surface_get_drawable ((glitz_surface_t *) other->surface);
+ format = glitz_find_standard_format (drawable,
+ _glitz_format (render_format));
if (format == NULL)
return NULL;
@@ -167,8 +161,7 @@
similar->flags = 0;
similar->surface = (glitz_surface_t *)
- glitz_surface_create_similar ((glitz_surface_t *) other->surface,
- format, width, height);
+ glitz_surface_create (drawable, format, width, height);
if (similar->surface == NULL) {
free (similar);
return NULL;
@@ -272,6 +265,9 @@
glitz_buffer_t *buffer;
glitz_pixel_format_t pf;
+ glitz_drawable_t *drawable;
+
+ drawable = glitz_surface_get_drawable ((glitz_surface_t *) dst->surface);
pf.scanline_order = GLITZ_PIXEL_SCANLINE_ORDER_TOP_DOWN;
pf.xoffset = 0;
@@ -310,7 +306,7 @@
pf.bytes_per_line = (((dst->width * pf.masks.bpp) / 8) + 3) & -4;
- buffer = glitz_pixel_buffer_create (dst->surface,
+ buffer = glitz_pixel_buffer_create (drawable,
data,
pf.bytes_per_line * dst->height,
GLITZ_BUFFER_HINT_STREAM_DRAW);
@@ -332,8 +328,16 @@
void
_glitz_render_show (render_surface_t *surface)
{
- glitz_surface_swap_buffers ((glitz_surface_t *) surface->surface);
- glitz_surface_finish ((glitz_surface_t *) surface->surface);
+ glitz_drawable_format_t *format;
+ glitz_drawable_t *drawable;
+
+ drawable = glitz_surface_get_drawable ((glitz_surface_t *) surface->surface);
+ format = glitz_drawable_get_format (drawable);
+
+ if (format->doublebuffer)
+ glitz_drawable_swap_buffers (drawable);
+
+ glitz_drawable_finish (drawable);
}
render_status_t
@@ -408,6 +412,7 @@
if (n_rects > 0) {
glitz_float_t *data;
glitz_buffer_t *buffer;
+ glitz_drawable_t *drawable;
glitz_geometry_format_t gf;
gf.mode = GLITZ_GEOMETRY_MODE_DIRECT;
@@ -417,8 +422,11 @@
gf.first = 0;
gf.count = n_rects * 4;
+ drawable =
+ glitz_surface_get_drawable ((glitz_surface_t *) surface->surface);
+
buffer =
- glitz_geometry_buffer_create ((glitz_surface_t *) surface->surface, NULL,
+ glitz_geometry_buffer_create (drawable, NULL,
n_rects * 8 * sizeof (glitz_float_t),
GLITZ_BUFFER_HINT_STATIC_DRAW);
if (!buffer)
@@ -438,7 +446,7 @@
glitz_buffer_unmap (buffer);
glitz_set_geometry ((glitz_surface_t *) surface->surface,
- x_offset, y_offset,
+ x_offset << 16, y_offset << 16,
&gf, buffer);
glitz_buffer_destroy (buffer);
@@ -459,6 +467,7 @@
if (n_traps > 0) {
glitz_float_t *data;
glitz_buffer_t *buffer;
+ glitz_drawable_t *drawable;
glitz_geometry_format_t gf;
if (GLITZ_SURFACE_INDIRECT (surface))
@@ -480,8 +489,11 @@
gf.first = 0;
gf.count = n_traps * 4;
+ drawable =
+ glitz_surface_get_drawable ((glitz_surface_t *) surface->surface);
+
buffer =
- glitz_geometry_buffer_create ((glitz_surface_t *) surface->surface, NULL,
+ glitz_geometry_buffer_create (drawable, NULL,
n_traps * 8 * sizeof (glitz_float_t),
GLITZ_BUFFER_HINT_STATIC_DRAW);
if (!buffer)
@@ -501,7 +513,7 @@
glitz_buffer_unmap (buffer);
glitz_set_geometry ((glitz_surface_t *) surface->surface,
- x_offset, y_offset,
+ x_offset << 16, y_offset << 16,
&gf, buffer);
glitz_buffer_destroy (buffer);
@@ -511,3 +523,36 @@
return RENDER_STATUS_SUCCESS;
}
+
+glitz_surface_t *
+_glitz_create_and_attach_surface_to_drawable (glitz_drawable_t *drawable,
+ int width,
+ int height)
+{
+ glitz_drawable_format_t *dformat;
+ glitz_format_t *format;
+ glitz_surface_t *surface;
+ glitz_drawable_buffer_t buffer;
+
+ format = glitz_find_standard_format (drawable, GLITZ_STANDARD_ARGB32);
+ if (!format) {
+ fprintf (stderr, "Error: couldn't find ARGB surface format\n");
+ return NULL;
+ }
+
+ surface = glitz_surface_create (drawable, format, width, height);
+ if (!surface) {
+ fprintf (stderr, "Error: couldn't create glitz surface\n");
+ return NULL;
+ }
+
+ dformat = glitz_drawable_get_format (drawable);
+ if (dformat->doublebuffer)
+ buffer = GLITZ_DRAWABLE_BUFFER_BACK_COLOR;
+ else
+ buffer = GLITZ_DRAWABLE_BUFFER_FRONT_COLOR;
+
+ glitz_surface_attach (surface, drawable, buffer, 0, 0);
+
+ return surface;
+}
Index: glitz_agl.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz_agl.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- glitz_agl.c 6 Sep 2004 22:54:44 -0000 1.5
+++ glitz_agl.c 3 Nov 2004 23:51:04 -0000 1.6
@@ -101,9 +101,10 @@
{
int status, x, y;
render_surface_t surface;
- glitz_format_t templ;
+ glitz_drawable_format_t templ;
unsigned long mask;
- glitz_format_t *format;
+ glitz_drawable_format_t *dformat;
+ glitz_drawable_t *drawable;
render_arg_state_t state;
agl_options_t options;
WindowRef win;
@@ -162,19 +163,11 @@
SelectWindow (win);
- templ.draw.onscreen = 1;
- mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
+ templ.types.window = 1;
+ mask = GLITZ_FORMAT_WINDOW_MASK;
- if (options.samples > 1) {
- templ.multisample.supported = 1;
- templ.multisample.samples = options.samples;
- mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
- } else {
- templ.multisample.supported = 0;
- templ.multisample.samples = 0;
- }
-
- mask |= GLITZ_FORMAT_MULTISAMPLE_MASK;
+ templ.samples = options.samples;
+ mask |= GLITZ_FORMAT_SAMPLES_MASK;
if (options.db)
templ.doublebuffer = 1;
@@ -182,25 +175,35 @@
templ.doublebuffer = 0;
mask |= GLITZ_FORMAT_DOUBLEBUFFER_MASK;
-
- format = glitz_agl_find_format (mask, &templ, 0);
- if (!format) {
- fprintf (stderr, "Error: couldn't find onscreen format\n");
+
+ dformat = glitz_agl_find_drawable_format (mask, &templ, 0);
+ if (!dformat) {
+ fprintf (stderr, "Error: couldn't find window format\n");
return 1;
}
- surface.surface = glitz_agl_surface_create_for_window (format, win,
- surface.width,
- surface.height);
- if (!surface.surface) {
- fprintf (stderr, "Error: couldn't create glitz surface for window\n");
+ drawable =
+ glitz_agl_create_drawable_for_window (dformat, win,
+ surface.width, surface.height);
+ if (!drawable) {
+ fprintf (stderr, "Error: couldn't create glitz drawable for window\n");
return 1;
}
+ surface.surface =
+ _glitz_create_and_attach_surface_to_drawable (drawable,
+ surface.width,
+ surface.height);
+ if (!surface.surface)
+ return 1;
+
ShowWindow (win);
status = render_run (&surface, &state.settings);
+ glitz_surface_destroy ((glitz_surface_t *) surface.surface);
+ glitz_drawable_destroy (drawable);
+
glitz_agl_fini ();
return status;
Index: glitz_common.h
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz_common.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- glitz_common.h 3 Sep 2004 14:29:26 -0000 1.3
+++ glitz_common.h 3 Nov 2004 23:51:04 -0000 1.4
@@ -110,3 +110,8 @@
int y_offset,
render_trapezoid_t *traps,
int n_traps);
+
+glitz_surface_t *
+_glitz_create_and_attach_surface_to_drawable (glitz_drawable_t *drawable,
+ int width,
+ int height);
Index: glitz_glx.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz_glx.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- glitz_glx.c 6 Sep 2004 22:54:44 -0000 1.5
+++ glitz_glx.c 3 Nov 2004 23:51:04 -0000 1.6
@@ -118,9 +118,10 @@
XSetWindowAttributes xswa;
Window win;
XVisualInfo *vinfo;
- glitz_format_t templ;
+ glitz_drawable_format_t templ;
unsigned long mask;
- glitz_format_t *format;
+ glitz_drawable_format_t *dformat;
+ glitz_drawable_t *drawable;
render_arg_state_t state;
glx_options_t options;
XEvent event;
@@ -178,19 +179,11 @@
screen = DefaultScreen (display);
- templ.draw.onscreen = 1;
- mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
+ templ.types.window = 1;
+ mask = GLITZ_FORMAT_WINDOW_MASK;
- if (options.samples > 1) {
- templ.multisample.supported = 1;
- templ.multisample.samples = options.samples;
- mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
- } else {
- templ.multisample.supported = 0;
- templ.multisample.samples = 0;
- }
-
- mask |= GLITZ_FORMAT_MULTISAMPLE_MASK;
+ templ.samples = options.samples;
+ mask |= GLITZ_FORMAT_SAMPLES_MASK;
if (options.db)
templ.doublebuffer = 1;
@@ -199,13 +192,13 @@
mask |= GLITZ_FORMAT_DOUBLEBUFFER_MASK;
- format = glitz_glx_find_format (display, screen, mask, &templ, 0);
- if (!format) {
- fprintf (stderr, "Error: couldn't find onscreen format\n");
+ dformat = glitz_glx_find_drawable_format (display, screen, mask, &templ, 0);
+ if (!dformat) {
+ fprintf (stderr, "Error: couldn't find window format\n");
return 1;
}
- vinfo = glitz_glx_get_visual_info_from_format (display, screen, format);
+ vinfo = glitz_glx_get_visual_info_from_format (display, screen, dformat);
if (!vinfo) {
fprintf (stderr, "Error: no visual info from format\n");
return 1;
@@ -220,15 +213,21 @@
vinfo->visual, CWColormap, &xswa);
XFree (vinfo);
-
- surface.surface =
- glitz_glx_surface_create_for_window (display, screen, format, win,
- surface.width,
- surface.height);
- if (!surface.surface) {
- fprintf (stderr, "Error: couldn't create glitz surface for window\n");
+
+ drawable =
+ glitz_glx_create_drawable_for_window (display, screen, dformat, win,
+ surface.width, surface.height);
+ if (!drawable) {
+ fprintf (stderr, "Error: couldn't create glitz drawable for window\n");
return 1;
}
+
+ surface.surface =
+ _glitz_create_and_attach_surface_to_drawable (drawable,
+ surface.width,
+ surface.height);
+ if (!surface.surface)
+ return 1;
XSelectInput (display, win, ExposureMask);
XMapWindow (display, win);
@@ -243,6 +242,7 @@
status = render_run (&surface, &state.settings);
glitz_surface_destroy ((glitz_surface_t *) surface.surface);
+ glitz_drawable_destroy (drawable);
glitz_glx_fini ();
Index: pixman.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/pixman.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pixman.c 12 Sep 2004 03:05:47 -0000 1.1
+++ pixman.c 3 Nov 2004 23:51:04 -0000 1.2
@@ -72,8 +72,6 @@
return PIXMAN_OPERATOR_XOR;
case RENDER_OPERATOR_ADD:
return PIXMAN_OPERATOR_ADD;
- case RENDER_OPERATOR_SATURATE:
- return PIXMAN_OPERATOR_SATURATE;
default:
return PIXMAN_OPERATOR_OVER;
}
Index: rendertest.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/rendertest.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- rendertest.c 13 Sep 2004 17:55:24 -0000 1.8
+++ rendertest.c 3 Nov 2004 23:51:04 -0000 1.9
@@ -134,8 +134,6 @@
return "XOR";
case RENDER_OPERATOR_ADD:
return "ADD";
- case RENDER_OPERATOR_SATURATE:
- return "SATURATE";
default:
return "OVER";
}
Index: rendertest.h
===================================================================
RCS file: /cvs/cairo/rendertest/src/rendertest.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- rendertest.h 3 Sep 2004 14:29:26 -0000 1.3
+++ rendertest.h 3 Nov 2004 23:51:04 -0000 1.4
@@ -76,8 +76,7 @@
RENDER_OPERATOR_ATOP,
RENDER_OPERATOR_ATOP_REVERSE,
RENDER_OPERATOR_XOR,
- RENDER_OPERATOR_ADD,
- RENDER_OPERATOR_SATURATE
+ RENDER_OPERATOR_ADD
} render_operator_t;
typedef enum {
Index: xcb.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/xcb.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xcb.c 1 Oct 2004 00:24:42 -0000 1.5
+++ xcb.c 3 Nov 2004 23:51:04 -0000 1.6
@@ -88,8 +88,6 @@
return XCBRenderPictOpXor;
case RENDER_OPERATOR_ADD:
return XCBRenderPictOpAdd;
- case RENDER_OPERATOR_SATURATE:
- return XCBRenderPictOpSaturate;
default:
return XCBRenderPictOpOver;
}
More information about the cairo-commit
mailing list