[cairo-commit] rendertest/src glitz.c, 1.3, 1.4 glitz_agl.c, 1.3, 1.4 glitz_glx.c, 1.3, 1.4 rendertest.c, 1.4, 1.5

David Reveman commit at pdx.freedesktop.org
Mon Sep 6 15:28:26 PDT 2004


Committed by: davidr

Update of /cvs/cairo/rendertest/src
In directory gabe:/tmp/cvs-serv8039/src

Modified Files:
	glitz.c glitz_agl.c glitz_glx.c rendertest.c 
Log Message:
Various glitz backend fixes

Index: glitz.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** glitz.c	3 Sep 2004 14:29:26 -0000	1.3
--- glitz.c	6 Sep 2004 22:28:24 -0000	1.4
***************
*** 106,111 ****
  {
    switch (fill) {
-   case RENDER_FILL_TRANSPARENT:
-     return GLITZ_FILL_TRANSPARENT;
    case RENDER_FILL_REPEAT:
      return GLITZ_FILL_REPEAT;
--- 106,109 ----
***************
*** 113,119 ****
      return GLITZ_FILL_REFLECT;
    case RENDER_FILL_NEAREST:
    case RENDER_FILL_NONE:
    default:
!     return GLITZ_FILL_NEAREST;
    }
  }
--- 111,119 ----
      return GLITZ_FILL_REFLECT;
    case RENDER_FILL_NEAREST:
+     return GLITZ_FILL_NEAREST;
    case RENDER_FILL_NONE:
+   case RENDER_FILL_TRANSPARENT:
    default:
!     return GLITZ_FILL_TRANSPARENT;
    }
  }
***************
*** 425,441 ****
        return RENDER_STATUS_NO_MEMORY;
  
!     do {
!       data = glitz_buffer_map (buffer, GLITZ_BUFFER_ACCESS_WRITE_ONLY);
!       for (; n_rects; rects++, n_rects--) {
!         *data++ = (glitz_float_t) rects->x;
!         *data++ = (glitz_float_t) rects->y;
!         *data++ = (glitz_float_t) (rects->x + rects->width);
!         *data++ = (glitz_float_t) rects->y;
!         *data++ = (glitz_float_t) (rects->x + rects->width);
!         *data++ = (glitz_float_t) (rects->y + rects->height);
!         *data++ = (glitz_float_t) rects->x;
!         *data++ = (glitz_float_t) (rects->y + rects->height);
!       }
!     } while (glitz_buffer_unmap (buffer));
  
      glitz_set_geometry ((glitz_surface_t *) surface->surface,
--- 425,440 ----
        return RENDER_STATUS_NO_MEMORY;
  
!     data = glitz_buffer_map (buffer, GLITZ_BUFFER_ACCESS_WRITE_ONLY);
!     for (; n_rects; rects++, n_rects--) {
!       *data++ = (glitz_float_t) rects->x;
!       *data++ = (glitz_float_t) rects->y;
!       *data++ = (glitz_float_t) (rects->x + rects->width);
!       *data++ = (glitz_float_t) rects->y;
!       *data++ = (glitz_float_t) (rects->x + rects->width);
!       *data++ = (glitz_float_t) (rects->y + rects->height);
!       *data++ = (glitz_float_t) rects->x;
!       *data++ = (glitz_float_t) (rects->y + rects->height);
!     }
!     glitz_buffer_unmap (buffer);
  
      glitz_set_geometry ((glitz_surface_t *) surface->surface,
***************
*** 489,505 ****
        return RENDER_STATUS_NO_MEMORY;
  
!     do {
!       data = glitz_buffer_map (buffer, GLITZ_BUFFER_ACCESS_WRITE_ONLY);
!       for (; n_traps; traps++, n_traps--) {
!         *data++ = FIXED_TO_FLOAT (traps->top.left);
!         *data++ = FIXED_TO_FLOAT (traps->top.y);
!         *data++ = FIXED_TO_FLOAT (traps->top.right);
!         *data++ = FIXED_TO_FLOAT (traps->top.y);
!         *data++ = FIXED_TO_FLOAT (traps->bottom.right);
!         *data++ = FIXED_TO_FLOAT (traps->bottom.y);
!         *data++ = FIXED_TO_FLOAT (traps->bottom.left);
!         *data++ = FIXED_TO_FLOAT (traps->bottom.y);
!       }
!     } while (glitz_buffer_unmap (buffer));
      
      glitz_set_geometry ((glitz_surface_t *) surface->surface,
--- 488,503 ----
        return RENDER_STATUS_NO_MEMORY;
  
!     data = glitz_buffer_map (buffer, GLITZ_BUFFER_ACCESS_WRITE_ONLY);
!     for (; n_traps; traps++, n_traps--) {
!       *data++ = FIXED_TO_FLOAT (traps->top.left);
!       *data++ = FIXED_TO_FLOAT (traps->top.y);
!       *data++ = FIXED_TO_FLOAT (traps->top.right);
!       *data++ = FIXED_TO_FLOAT (traps->top.y);
!       *data++ = FIXED_TO_FLOAT (traps->bottom.right);
!       *data++ = FIXED_TO_FLOAT (traps->bottom.y);
!       *data++ = FIXED_TO_FLOAT (traps->bottom.left);
!       *data++ = FIXED_TO_FLOAT (traps->bottom.y);
!     }
!     glitz_buffer_unmap (buffer);
      
      glitz_set_geometry ((glitz_surface_t *) surface->surface,

Index: glitz_agl.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz_agl.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** glitz_agl.c	3 Sep 2004 14:29:26 -0000	1.3
--- glitz_agl.c	6 Sep 2004 22:28:24 -0000	1.4
***************
*** 169,172 ****
--- 169,173 ----
      templ.multisample.supported = 1;
      templ.multisample.samples = options.samples;
+     mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
    } else {
      templ.multisample.supported = 0;
***************
*** 175,179 ****
    
    mask |= GLITZ_FORMAT_MULTISAMPLE_MASK;
-   mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
  
    if (options.db)
--- 176,179 ----

Index: glitz_glx.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/glitz_glx.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** glitz_glx.c	3 Sep 2004 14:29:26 -0000	1.3
--- glitz_glx.c	6 Sep 2004 22:28:24 -0000	1.4
***************
*** 185,188 ****
--- 185,189 ----
      templ.multisample.supported = 1;
      templ.multisample.samples = options.samples;
+     mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
    } else {
      templ.multisample.supported = 0;
***************
*** 191,195 ****
    
    mask |= GLITZ_FORMAT_MULTISAMPLE_MASK;
-   mask |= GLITZ_FORMAT_MULTISAMPLE_SAMPLES_MASK;
  
    if (options.db)
--- 192,195 ----

Index: rendertest.c
===================================================================
RCS file: /cvs/cairo/rendertest/src/rendertest.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rendertest.c	4 Sep 2004 10:09:18 -0000	1.4
--- rendertest.c	6 Sep 2004 22:28:24 -0000	1.5
***************
*** 142,160 ****
  }
  
- static int
- _render_int_to_power_of_two (int x)
- {
-   if ((x & (x - 1)) == 0)
-     return x;
-   
-   x |= (x >> 1);
-   x |= (x >> 2);
-   x |= (x >> 4);
-   x |= (x >> 8);
-   x |= (x >> 16);
-   
-   return (x + 1);
- }
- 
  static render_status_t
  _render_set_background (render_surface_t *surface,
--- 142,145 ----
***************
*** 517,521 ****
    unsigned char *data;
    render_info_t info;
!   int x, y, w, h, bg_w, bg_h, test = 0;
    render_surface_t *a_mask, *argb_mask, *solid_red, *solid_blue, *glider,
      *big_glider, *grad2x1, *grad11x1;
--- 502,506 ----
    unsigned char *data;
    render_info_t info;
!   int x, y, w, h, test = 0;
    render_surface_t *a_mask, *argb_mask, *solid_red, *solid_blue, *glider,
      *big_glider, *grad2x1, *grad11x1;
***************
*** 637,656 ****
    }
  
!   bg_w = _render_int_to_power_of_two (w);
!   bg_h = _render_int_to_power_of_two (h);
!     
!   data = malloc (bg_w * bg_h * 4);
    if (!data) {
      fprintf (stderr, "out of memory\n");
      return RENDER_STATUS_FAILED;
    }
! 
    for (y = 0; y < h; y++) {
      unsigned int *line, pixel;
      unsigned char red, green, blue;
  
!     line = (unsigned int *) &data[y * bg_w * 4];
      
!     for (x = 0; x < bg_w; x++) {
        red = green = blue = (unsigned char) ((0xff * (h - y / 2)) / h);
        pixel = 0xff000000 | (red << 16) | (green << 8) | (blue << 0);
--- 622,638 ----
    }
  
!   data = malloc (w * h * 4);
    if (!data) {
      fprintf (stderr, "out of memory\n");
      return RENDER_STATUS_FAILED;
    }
!   
    for (y = 0; y < h; y++) {
      unsigned int *line, pixel;
      unsigned char red, green, blue;
  
!     line = (unsigned int *) &data[y * w * 4];
      
!     for (x = 0; x < w; x++) {
        red = green = blue = (unsigned char) ((0xff * (h - y / 2)) / h);
        pixel = 0xff000000 | (red << 16) | (green << 8) | (blue << 0);
***************
*** 661,665 ****
    info.bg = create_surface_for_data (surface,
                                       RENDER_FORMAT_ARGB32,
!                                      data, bg_w, bg_h);
    if (info.bg == NULL) {
      fprintf (stderr, "failed to create background surface\n");
--- 643,647 ----
    info.bg = create_surface_for_data (surface,
                                       RENDER_FORMAT_ARGB32,
!                                      data, w, h);
    if (info.bg == NULL) {
      fprintf (stderr, "failed to create background surface\n");




More information about the cairo-commit mailing list