[cairo-commit] rendertest/src Makefile.am, 1.1.1.1, 1.2 args.c, 1.1.1.1, 1.2 glitz.c, 1.1.1.1, 1.2 glitz_agl.c, 1.1.1.1, 1.2 glitz_common.h, 1.1.1.1, 1.2 glitz_glx.c, 1.1.1.1, 1.2 images.h, 1.1.1.1, 1.2 rendertest.c, 1.1.1.1, 1.2 rendertest.h, 1.1.1.1, 1.2 xcb.c, 1.1.1.1, 1.2

David Reveman commit at pdx.freedesktop.org
Wed Aug 18 05:49:32 PDT 2004


Committed by: davidr

Update of /cvs/cairo/rendertest/src
In directory pdx:/tmp/cvs-serv6104/src

Modified Files:
	Makefile.am args.c glitz.c glitz_agl.c glitz_common.h 
	glitz_glx.c images.h rendertest.c rendertest.h xcb.c 
Log Message:
Added trapezoid and filter tests

Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/rendertest/src/Makefile.am,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Makefile.am	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- Makefile.am	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 4,8 ****
  	rendertest.c \
  	rendertest.h \
! 	images.h
  
  glitz_common_sources = \
--- 4,9 ----
  	rendertest.c \
  	rendertest.h \
! 	images.h \
! 	traps.h
  
  glitz_common_sources = \

Index: args.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/args.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** args.c	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- args.c	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 49,55 ****
    { "quiet",       'q', NULL,   0,
      "            do not explain what is being done" },
    { "sleep",       's', "SEC",  0,
      "         sleep this number of seconds between tests" },
!   { "test",        't', "TEST", 0, "         only run this test type" },
    { 0 }
  };
--- 49,58 ----
    { "quiet",       'q', NULL,   0,
      "            do not explain what is being done" },
+   { "repeat",      'r', "ITERATIONS", 0,
+     " repeat every test this many times" },
    { "sleep",       's', "SEC",  0,
      "         sleep this number of seconds between tests" },
!   { "tests",       't', "TESTSPAN", 0, "    only run these tests" },
!   { "time",        'm',  NULL,  0, "             print timing statistics" },
    { 0 }
  };
***************
*** 143,146 ****
--- 146,152 ----
      s->state->settings.interactive = 1;
      break;
+   case 'm':
+     s->state->settings.time = 1;
+     break;
    case 'n':
      s->state->settings.npot = 1;
***************
*** 152,161 ****
      s->state->settings.quiet = 1;
      break;
    case 's':
      s->state->settings.sleep = atoi (arg);
      break;
!   case 't':
!     s->state->settings.test = atoi (arg);
!     break;
    case 'v':
      printf ("rendertest - " VERSION "\n");
--- 158,187 ----
      s->state->settings.quiet = 1;
      break;
+   case 'r':
+     s->state->settings.repeat = atoi (arg);
+     if (s->state->settings.repeat < 1)
+       s->state->settings.repeat = 1;
+     break;
    case 's':
      s->state->settings.sleep = atoi (arg);
      break;
!   case 't': {
!     long int t;
!     char *next = NULL;
!     
!     t = strtol (arg, &next, 0);
!     if (t < 0)
!       s->state->settings.last_test = -t;
!     else {
!       s->state->settings.first_test = t;
! 
!       if (next && *next != '\0') {
!         t = strtol (next, NULL, 0);
!         if (t)
!           s->state->settings.last_test = -t;
!       } else
!         s->state->settings.last_test = s->state->settings.first_test;
!     }  
!   } break;
    case 'v':
      printf ("rendertest - " VERSION "\n");
***************
*** 233,238 ****
    state->settings.quiet = 0;
    state->settings.sleep = 5;
    state->settings.op = RENDER_OPERATOR_OVER;
!   state->settings.test = 0;
  
    for (i = 1; i < argc; i++) {
--- 259,267 ----
    state->settings.quiet = 0;
    state->settings.sleep = 5;
+   state->settings.repeat = 1;
    state->settings.op = RENDER_OPERATOR_OVER;
!   state->settings.first_test = 0;
!   state->settings.last_test = 65535;
!   state->settings.time = 0;
  
    for (i = 1; i < argc; i++) {

Index: glitz.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** glitz.c	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- glitz.c	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 112,118 ****
    case RENDER_FILL_REFLECT:
      return GLITZ_FILL_REFLECT;
!   case RENDER_FILL_TRANSPARENT:
    default:
!     return GLITZ_FILL_TRANSPARENT;
    }
  }
--- 112,118 ----
    case RENDER_FILL_REFLECT:
      return GLITZ_FILL_REFLECT;
!   case RENDER_FILL_NONE:
    default:
!     return GLITZ_FILL_CLIP;
    }
  }
***************
*** 126,129 ****
--- 126,131 ----
    case RENDER_FILTER_CONVOLUTION:
      return GLITZ_FILTER_CONVOLUTION;
+   case RENDER_FILTER_GAUSSIAN:
+     return GLITZ_FILTER_GAUSSIAN;
    case RENDER_FILTER_LINEAR_GRADIENT:
      return GLITZ_FILTER_LINEAR_GRADIENT;
***************
*** 151,154 ****
--- 153,157 ----
                                                  other->surface,
                                                  format_name);
+ 
    if (format == NULL)
      return NULL;
***************
*** 340,341 ****
--- 343,415 ----
    return RENDER_STATUS_SUCCESS;
  }
+ 
+ render_status_t
+ _glitz_render_fill_rectangle (render_operator_t op,
+                               render_surface_t *dst,
+                               const render_color_t *color,
+                               int x,
+                               int y,
+                               unsigned int width,
+                               unsigned int height)
+ {
+   glitz_status_t status;
+ 
+   glitz_fill_rectangle (_glitz_operator (op),
+                         (glitz_surface_t *) dst->surface,
+                         (glitz_color_t *) color,
+                         x, y, width, height);
+   
+   status = glitz_surface_get_status ((glitz_surface_t *) dst->surface);
+   while (glitz_surface_get_status ((glitz_surface_t *) dst->surface));
+   
+   return _glitz_status (status);
+ }
+ 
+ render_status_t
+ _glitz_render_add_traps (render_surface_t *dst,
+                          int x_offset,
+                          int y_offset,
+                          render_trapezoid_t *traps,
+                          int n_traps)
+ {
+   glitz_status_t status;
+ 
+   glitz_add_trapezoids ((glitz_surface_t *) dst->surface,
+                         x_offset, y_offset,
+                         (glitz_trapezoid_t *) traps,
+                         n_traps);
+   
+   status = glitz_surface_get_status ((glitz_surface_t *) dst->surface);
+   while (glitz_surface_get_status ((glitz_surface_t *) dst->surface));
+   
+   return _glitz_status (status);
+ }
+ 
+ render_status_t
+ _glitz_render_composite_traps (render_operator_t op,
+                                render_surface_t *dst,
+                                render_surface_t *src,
+                                int x_src,
+                                int y_src,
+                                int x_offset,
+                                int y_offset,
+                                unsigned short opacity,
+                                render_trapezoid_t *traps,
+                                int n_traps)
+ {
+   glitz_status_t status;
+ 
+   glitz_composite_trapezoids (_glitz_operator (op),
+                               (glitz_surface_t *) dst->surface,
+                               (glitz_surface_t *) src->surface,
+                               x_src, y_src,
+                               x_offset, y_offset,
+                               opacity,
+                               (glitz_trapezoid_t *) traps,
+                               n_traps);
+   
+   status = glitz_surface_get_status ((glitz_surface_t *) dst->surface);
+   while (glitz_surface_get_status ((glitz_surface_t *) dst->surface));
+   
+   return _glitz_status (status);
+ }

Index: glitz_agl.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz_agl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** glitz_agl.c	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- glitz_agl.c	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 45,57 ****
    _glitz_render_set_component_alpha,
    _glitz_render_set_transform,
!   _glitz_render_set_filter
  };
  
  typedef struct agl_options {
!   glitz_correctness_hint_t correctness;
  } agl_options_t;
  
  static const render_option_t _glx_options[] = {
!   { "correct", 'c', NULL, 0, "          require highest correctness" },
    { 0 }
  };
--- 45,66 ----
    _glitz_render_set_component_alpha,
    _glitz_render_set_transform,
!   _glitz_render_set_filter,
!   _glitz_render_fill_rectangle,
!   _glitz_render_add_traps,
!   _glitz_render_composite_traps
  };
  
  typedef struct agl_options {
!   int aa;
!   int samples;
!   int db;
  } agl_options_t;
  
  static const render_option_t _glx_options[] = {
!   { "single-buffer", 'l', NULL, 0, "    use single buffered format" },
!   { "anti-aliasing", 'a', "TYPE", 0, "use this type of anti-aliasing: "
!     "SW, HW or NONE" },
!   { "samples", 'p', "SAMPLES", 0, "   number of samples used with "
!     "multi-sampling" },
    { 0 }
  };
***************
*** 63,68 ****
    
    switch (key) {
!   case 'c':
!     options->correctness = GLITZ_CORRECTNESS_HINT_QUALITY;
      break;
    default:
--- 72,88 ----
    
    switch (key) {
!   case 'l':
!     options->db = 0;
!     break;
!   case 'a':
!     if (strcasecmp (arg, "HW") == 0)
!       options->aa = 2;
!     else if (strcasecmp (arg, "NONE") == 0)
!       options->aa = 0;
!     else
!       options->aa = 1;
!     break;
!   case 'p':
!     options->samples = atoi (arg);
      break;
    default:
***************
*** 87,91 ****
    CFStringRef title;
  
!   options.correctness = GLITZ_CORRECTNESS_HINT_CAPABILITY;
    
    state.pointer = &options;
--- 107,113 ----
    CFStringRef title;
  
!   options.aa = 1;
!   options.samples = 4;
!   options.db = 1;
    
    state.pointer = &options;
***************
*** 122,127 ****
    templ.draw.onscreen = 1;
    mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
    
!   format = glitz_agl_find_format (&templ, mask, 0);
    if (!format) {
      fprintf (stderr, "Error: couldn't find onscreen format\n");
--- 144,167 ----
    templ.draw.onscreen = 1;
    mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
+ 
+   if (options.aa == 2) {
+     templ.multisample.supported = 1;
+     templ.multisample.samples = options.samples;
+   } else {
+     templ.multisample.supported = 0;
+     templ.multisample.samples = 0;
+   }
    
!   mask |= GLITZ_FORMAT_MULTISAMPLE_MASK;
!   mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
! 
!   if (options.db)
!     templ.doublebuffer = 1;
!   else
!     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");
***************
*** 134,145 ****
      return 1;
    }
-   
-   glitz_surface_set_correctness_hint (surface.surface, options.correctness);
  
    ShowWindow (win);
  
    status = render_run (&surface, &state.settings);
  
!   glitz_glx_fini ();
    
    return status;
--- 174,204 ----
      return 1;
    }
  
+   if (options.aa == 1) {
+     glitz_surface_set_polyedge (surface.surface, GLITZ_POLYEDGE_SMOOTH);
+     if (options.samples == 2) {
+       glitz_surface_set_polyedge_smooth_hint (surface.surface,
+                                               GLITZ_POLYEDGE_SMOOTH_HINT_FAST);
+     } else if (options.samples == 4) {
+       glitz_surface_set_polyedge_smooth_hint (surface.surface,
+                                               GLITZ_POLYEDGE_SMOOTH_HINT_GOOD);
+     } else if (options.samples == 8) {
+       glitz_surface_set_polyedge_smooth_hint (surface.surface,
+                                               GLITZ_POLYEDGE_SMOOTH_HINT_BEST);
+     } else {
+       fprintf (stderr, "Error: %d samples software multi-sampling not "
+                "supported\n", options.samples);
+       return 1;
+     }
+   } else if (options.aa == 2) {
+     glitz_surface_set_polyedge (surface.surface, GLITZ_POLYEDGE_SMOOTH);
+   } else
+     glitz_surface_set_polyedge (surface.surface, GLITZ_POLYEDGE_SHARP);
+   
    ShowWindow (win);
  
    status = render_run (&surface, &state.settings);
  
!   glitz_agl_fini ();
    
    return status;

Index: glitz_common.h
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz_common.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** glitz_common.h	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- glitz_common.h	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 72,73 ****
--- 72,101 ----
                            render_fixed16_16_t *params,
                            int n_params);
+ 
+ render_status_t
+ _glitz_render_fill_rectangle (render_operator_t op,
+                               render_surface_t *dst,
+                               const render_color_t *color,
+                               int x,
+                               int y,
+                               unsigned int width,
+                               unsigned int height);
+                          
+ render_status_t
+ _glitz_render_add_traps (render_surface_t *dst,
+                          int x_offset,
+                          int y_offset,
+                          render_trapezoid_t *traps,
+                          int n_traps);
+ 
+ render_status_t
+ _glitz_render_composite_traps (render_operator_t op,
+                                render_surface_t *dst,
+                                render_surface_t *src,
+                                int x_src,
+                                int y_src,
+                                int x_offset,
+                                int y_offset,
+                                unsigned short opacity,
+                                render_trapezoid_t *traps,
+                                int n_traps);

Index: glitz_glx.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz_glx.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** glitz_glx.c	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- glitz_glx.c	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 30,33 ****
--- 30,35 ----
  #include <stdio.h>
  #include <stdlib.h>
+ #include <string.h>
+ #include <strings.h>
  
  #include "rendertest.h"
***************
*** 45,49 ****
    _glitz_render_set_component_alpha,
    _glitz_render_set_transform,
!   _glitz_render_set_filter
  };
  
--- 47,54 ----
    _glitz_render_set_component_alpha,
    _glitz_render_set_transform,
!   _glitz_render_set_filter,
!   _glitz_render_fill_rectangle,
!   _glitz_render_add_traps,
!   _glitz_render_composite_traps
  };
  
***************
*** 51,55 ****
    char *display;
    char *geometry;
!   glitz_correctness_hint_t correctness;
  } glx_options_t;
  
--- 56,62 ----
    char *display;
    char *geometry;
!   int aa;
!   int samples;
!   int db;
  } glx_options_t;
  
***************
*** 57,61 ****
    { "display", 'd', "DISPLAY", 0, "   X display to use" },
    { "geometry", 'g', "GEOMETRY", 0, " X geometry specification" },
!   { "correct", 'c', NULL, 0, "          require highest correctness" },
    { 0 }
  };
--- 64,72 ----
    { "display", 'd', "DISPLAY", 0, "   X display to use" },
    { "geometry", 'g', "GEOMETRY", 0, " X geometry specification" },
!   { "single-buffer", 'l', NULL, 0, "    use single buffered format" },
!   { "anti-aliasing", 'a', "TYPE", 0, "use this type of anti-aliasing: "
!     "SW, HW or NONE" },
!   { "samples", 'p', "SAMPLES", 0, "   number of samples used with "
!     "multi-sampling" },
    { 0 }
  };
***************
*** 73,78 ****
      options->geometry = arg;
      break;
!   case 'c':
!     options->correctness = GLITZ_CORRECTNESS_HINT_QUALITY;
      break;
    default:
--- 84,100 ----
      options->geometry = arg;
      break;
!   case 'l':
!     options->db = 0;
!     break;
!   case 'a':
!     if (strcasecmp (arg, "HW") == 0)
!       options->aa = 2;
!     else if (strcasecmp (arg, "NONE") == 0)
!       options->aa = 0;
!     else
!       options->aa = 1;
!     break;
!   case 'p':
!     options->samples = atoi (arg);
      break;
    default:
***************
*** 102,106 ****
    options.display = NULL;
    options.geometry = NULL;
!   options.correctness = GLITZ_CORRECTNESS_HINT_CAPABILITY;
    
    state.pointer = &options;
--- 124,130 ----
    options.display = NULL;
    options.geometry = NULL;
!   options.aa = 1;
!   options.samples = 4;
!   options.db = 1;
    
    state.pointer = &options;
***************
*** 136,139 ****
--- 160,181 ----
    templ.draw.onscreen = 1;
    mask = GLITZ_FORMAT_DRAW_ONSCREEN_MASK;
+ 
+   if (options.aa == 2) {
+     templ.multisample.supported = 1;
+     templ.multisample.samples = options.samples;
+   } else {
+     templ.multisample.supported = 0;
+     templ.multisample.samples = 0;
+   }
+   
+   mask |= GLITZ_FORMAT_MULTISAMPLE_MASK;
+   mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
+ 
+   if (options.db)
+     templ.doublebuffer = 1;
+   else
+     templ.doublebuffer = 0;
+ 
+   mask |= GLITZ_FORMAT_DOUBLEBUFFER_MASK;
    
    format = glitz_glx_find_format (display, screen, mask, &templ, 0);
***************
*** 167,172 ****
    }
  
!   glitz_surface_set_correctness_hint (surface.surface, options.correctness);
! 
    XSelectInput (display, win, ExposureMask);
    XMapWindow (display, win);
--- 209,233 ----
    }
  
!   if (options.aa == 1) {
!     glitz_surface_set_polyedge (surface.surface, GLITZ_POLYEDGE_SMOOTH);
!     if (options.samples == 2) {
!       glitz_surface_set_polyedge_smooth_hint (surface.surface,
!                                               GLITZ_POLYEDGE_SMOOTH_HINT_FAST);
!     } else if (options.samples == 4) {
!       glitz_surface_set_polyedge_smooth_hint (surface.surface,
!                                               GLITZ_POLYEDGE_SMOOTH_HINT_GOOD);
!     } else if (options.samples == 8) {
!       glitz_surface_set_polyedge_smooth_hint (surface.surface,
!                                               GLITZ_POLYEDGE_SMOOTH_HINT_BEST);
!     } else {
!       fprintf (stderr, "Error: %d samples software multi-sampling not "
!                "supported\n", options.samples);
!       return 1;
!     }
!   } else if (options.aa == 2) {
!     glitz_surface_set_polyedge (surface.surface, GLITZ_POLYEDGE_SMOOTH);
!   } else
!     glitz_surface_set_polyedge (surface.surface, GLITZ_POLYEDGE_SHARP);
!   
    XSelectInput (display, win, ExposureMask);
    XMapWindow (display, win);

Index: images.h
===================================================================
RCS file: /cvs/cairo/rendertest/src/images.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** images.h	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- images.h	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 2754,2756 ****
--- 2754,4512 ----
  };
  
+ unsigned char glider_pot_png[] = {
+   0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00,
+   0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x40,
+   0x00, 0x00, 0x00, 0x40, 0x08, 0x06, 0x00, 0x00, 0x00, 0xaa,
+   0x69, 0x71, 0xde, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59,
+   0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13, 0x01,
+   0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x0d, 0xad, 0x49, 0x44,
[...1730 lines suppressed...]
+   0x73, 0xf9, 0xf2, 0xe5, 0xc6, 0x70, 0xf9, 0xd2, 0x8a, 0x4f,
+   0xdc, 0xed, 0xd3, 0x7d, 0xbe, 0xbf, 0x39, 0xe3, 0x11, 0x04,
+   0x41, 0x94, 0x96, 0x96, 0xae, 0xd9, 0xba, 0x75, 0xeb, 0xab,
+   0x35, 0x35, 0x35, 0x4f, 0x66, 0x66, 0x66, 0x16, 0xc4, 0xf0,
+   0x1c, 0x1c, 0x2c, 0x30, 0x36, 0x36, 0xa6, 0x6f, 0x69, 0x69,
+   0xf9, 0xa6, 0xb1, 0xb1, 0xf1, 0x78, 0x60, 0x01, 0x27, 0x12,
+   0x08, 0xc0, 0x2f, 0xec, 0xfd, 0x42, 0x03, 0x73, 0xc5, 0x0f,
+   0xfc, 0x4d, 0x10, 0x04, 0x51, 0x58, 0x58, 0x58, 0xae, 0xd1,
+   0x68, 0xd6, 0x15, 0x17, 0x17, 0x57, 0xe6, 0xe5, 0xe5, 0xad,
+   0xc8, 0xc8, 0xc8, 0x50, 0xa7, 0xa7, 0xa7, 0xe7, 0x88, 0xc5,
+   0xe2, 0x54, 0x81, 0x40, 0x20, 0xe2, 0xf3, 0xf9, 0xdc, 0x38,
+   0xc0, 0x10, 0x14, 0x45, 0xb9, 0xdd, 0x6e, 0xb7, 0xcb, 0xe9,
+   0x74, 0x4e, 0x9a, 0xcd, 0x66, 0x83, 0xc9, 0x64, 0x1a, 0x1e,
+   0x1e, 0x1e, 0xee, 0xe9, 0xed, 0xed, 0xed, 0xd0, 0x6a, 0xb5,
+   0xad, 0xfd, 0xfd, 0xfd, 0x31, 0x85, 0xf7, 0xfe, 0x3f, 0x9a,
+   0x4f, 0x8e, 0xcc, 0xf8, 0x4f, 0x6c, 0x38, 0x00, 0x00, 0x00,
+   0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
+ };
+ 
  #endif /* IMAGES_H_INCLUDED */

Index: rendertest.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/rendertest.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** rendertest.c	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- rendertest.c	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 28,33 ****
  #endif
  
- #include "images.h"
  #include "rendertest.h"
  
  #include <stdio.h>
--- 28,34 ----
  #endif
  
  #include "rendertest.h"
[...1362 lines suppressed...]
+                                              sizeof (params) /
+                                              sizeof (render_fixed16_16_t));
+     _render_composite_tests (&info, grad11x1, NULL, status);
+     surface->backend->set_filter (grad11x1, RENDER_FILTER_NEAREST, NULL, 0);
+     surface->backend->set_transform (grad11x1, &_identity);
+   }
+ 
+   surface->backend->destroy (grad2x1);
+   surface->backend->destroy (grad11x1);
+   surface->backend->destroy (a_scratch);
+   surface->backend->destroy (argb_scratch);
    surface->backend->destroy (solid_blue);
    surface->backend->destroy (solid_red);
    surface->backend->destroy (argb_mask);
+   surface->backend->destroy (big_glider);
+   surface->backend->destroy (glider);
    surface->backend->destroy (a_mask);
!   
    surface->backend->destroy (info.bg);
    surface->backend->destroy (info.logo);

Index: rendertest.h
===================================================================
RCS file: /cvs/cairo/rendertest/src/rendertest.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** rendertest.h	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- rendertest.h	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 30,38 ****
  #define RENDER_DEFAULT_DST_HEIGHT 240
  
- #define DOUBLE_TO_FIXED(f) ((int) ((f) * 65536))
- 
  typedef int render_bool_t;
  typedef int render_fixed16_16_t;
  
  typedef enum {
    RENDER_STATUS_SUCCESS,
--- 30,53 ----
  #define RENDER_DEFAULT_DST_HEIGHT 240
  
  typedef int render_bool_t;
  typedef int render_fixed16_16_t;
  
+ #define FIXED_BITS 16
+ 
+ #define FIXED_TO_INT(f) (int) ((f) >> FIXED_BITS)
+ #define INT_TO_FIXED(i) ((render_fixed16_16_t) (i) << FIXED_BITS)
+ #define FIXED_E ((render_fixed16_16_t) 1)
+ #define FIXED1 (INT_TO_FIXED (1))
+ #define FIXED1_MINUS_E (FIXED1 - FIXED_E)
+ #define FIXED_FRAC(f) ((f) & FIXED1_MINUS_E)
+ #define FIXED_FLOOR(f) ((f) & ~FIXED1_MINUS_E)
+ #define FIXED_CEIL(f) FIXED_FLOOR ((f) + FIXED1_MINUS_E)
+ 
+ #define FIXED_FRACTION(f) ((f) & FIXED1_MINUS_E)
+ #define FIXED_MOD2(f) ((f) & (FIXED1 | FIXED1_MINUS_E))
+ 
+ #define FIXED_TO_DOUBLE(f) (((double) (f)) / 65536)
+ #define DOUBLE_TO_FIXED(f) ((int) ((f) * 65536))
+ 
  typedef enum {
    RENDER_STATUS_SUCCESS,
***************
*** 67,71 ****
  
  typedef enum {
!   RENDER_FILL_TRANSPARENT,
    RENDER_FILL_NEAREST,
    RENDER_FILL_REPEAT,
--- 82,86 ----
  
  typedef enum {
!   RENDER_FILL_NONE,
    RENDER_FILL_NEAREST,
    RENDER_FILL_REPEAT,
***************
*** 81,88 ****
--- 96,119 ----
    RENDER_FILTER_BILINEAR,
    RENDER_FILTER_CONVOLUTION,
+   RENDER_FILTER_GAUSSIAN,
    RENDER_FILTER_LINEAR_GRADIENT,
    RENDER_FILTER_RADIAL_GRADIENT
  } render_filter_t;
  
+ typedef struct render_span_fixed {
+   render_fixed16_16_t left, right, y;
+ } render_span_fixed_t;
+   
+ typedef struct render_trapezoid {
+   render_span_fixed_t top, bottom;
+ } render_trapezoid_t;
+ 
+ typedef struct render_color {
+   unsigned short red;
+   unsigned short green;
+   unsigned short blue;
+   unsigned short alpha;
+ } render_color_t;
+ 
  typedef struct render_backend render_backend_t;
  
***************
*** 134,137 ****
--- 165,193 ----
                                              render_fixed16_16_t *params,
                                              int n_params);
+   
+   render_status_t   (*fill_rectangle)      (render_operator_t op,
+                                             render_surface_t *dst,
+                                             const render_color_t *color,
+                                             int x,
+                                             int y,
+                                             unsigned int width,
+                                             unsigned int height);
+                                               
+   render_status_t   (*add_traps)           (render_surface_t *dst,
+                                             int x_offset,
+                                             int y_offset,
+                                             render_trapezoid_t *traps,
+                                             int n_traps);
+ 
+   render_status_t   (*composite_traps)     (render_operator_t op,
+                                             render_surface_t *dst,
+                                             render_surface_t *src,
+                                             int x_src,
+                                             int y_src,
+                                             int x_offset,
+                                             int y_offset,
+                                             unsigned short opacity,
+                                             render_trapezoid_t *traps,
+                                             int n_traps);
  };
  
***************
*** 144,148 ****
    int npot;
    int quiet;
!   int test;
    render_operator_t op;
  } render_settings_t;
--- 200,206 ----
    int npot;
    int quiet;
!   int first_test, last_test;
!   int repeat;
!   int time;
    render_operator_t op;
  } render_settings_t;

Index: xcb.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/xcb.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** xcb.c	9 Aug 2004 23:18:53 -0000	1.1.1.1
--- xcb.c	18 Aug 2004 12:49:30 -0000	1.2
***************
*** 421,425 ****
      pa = 1;
      break;
!   case RENDER_FILL_TRANSPARENT:
    default:
      pa = 0;
--- 421,425 ----
      pa = 1;
      break;
!   case RENDER_FILL_NONE:
    default:
      pa = 0;
***************
*** 505,508 ****
--- 505,558 ----
  }
  
+ static render_status_t
+ _xcb_render_fill_rectangle (render_operator_t op,
+                             render_surface_t *dst,
+                             const render_color_t *color,
+                             int x,
+                             int y,
+                             unsigned int width,
+                             unsigned int height)
+ {
+   xcb_surface_t *surface = (xcb_surface_t *) dst->surface;
+   XCBRECTANGLE rect;
+ 
+   rect.x = x;
+   rect.y = y;
+   rect.width = width;
+   rect.height = height;
+ 
+   XCBRenderFillRectangles (surface->c,
+                            _xcb_operator (op),
+                            ((xcb_surface_t *) dst->surface)->picture,
+                            *((XCBRenderCOLOR *) color), 1, &rect);
+   
+   return RENDER_STATUS_SUCCESS;
+ }
+ 
+ static render_status_t
+ _xcb_render_add_traps (render_surface_t *dst,
+                        int x_offset,
+                        int y_offset,
+                        render_trapezoid_t *traps,
+                        int n_traps)
+ {
+   return RENDER_STATUS_NOT_SUPPORTED;
+ }
+ 
+ static render_status_t
+ _xcb_render_composite_traps (render_operator_t op,
+                              render_surface_t *dst,
+                              render_surface_t *src,
+                              int x_src,
+                              int y_src,
+                              int x_offset,
+                              int y_offset,
+                              unsigned short opacity,
+                              render_trapezoid_t *traps,
+                              int n_traps)
+ {
+   return RENDER_STATUS_NOT_SUPPORTED;
+ }
+ 
  static const render_backend_t _glitz_xcb_render_backend = {
    _xcb_render_create_similar,
***************
*** 514,518 ****
    _xcb_render_set_component_alpha,
    _xcb_render_set_transform,
!   _xcb_render_set_filter
  };
  
--- 564,571 ----
    _xcb_render_set_component_alpha,
    _xcb_render_set_transform,
!   _xcb_render_set_filter,
!   _xcb_render_fill_rectangle,
!   _xcb_render_add_traps,
!   _xcb_render_composite_traps
  };
  




More information about the cairo-commit mailing list