[cairo-commit] libglc/src glc_programmatic.c,NONE,1.1 Makefile.am,1.8,1.9 glc.c,1.19,1.20 glc.h,1.13,1.14 glc_agl_extension.c,1.4,1.5 glc_agl_info.c,1.6,1.7 glc_glx_extension.c,1.11,1.12 glc_glx_info.c,1.11,1.12 glc_glx_surface.c,1.16,1.17 glc_program.c,1.3,1.4 glc_surface.c,1.18,1.19 glc_trap.c,1.10,1.11 glc_tri.c,1.10,1.11 glcint.h,1.20,1.21

David Reveman commit at pdx.freedesktop.org
Mon Aug 15 11:12:59 PDT 2005


Committed by: davidr

Update of /cvs/cairo/libglc/src
In directory pdx:/tmp/cvs-serv19637/src

Modified Files:
	Makefile.am glc.c glc.h glc_agl_extension.c glc_agl_info.c 
	glc_glx_extension.c glc_glx_info.c glc_glx_surface.c 
	glc_program.c glc_surface.c glc_trap.c glc_tri.c glcint.h 
Added Files:
	glc_programmatic.c 
Log Message:
Added programmatic surface support

--- NEW FILE: glc_programmatic.c ---
(This appears to be a binary file; contents omitted.)

Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/libglc/src/Makefile.am,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** a/Makefile.am	10 Feb 2004 23:38:36 -0000	1.8
--- b/Makefile.am	26 Feb 2004 10:16:04 -0000	1.9
***************
*** 40,43 ****
--- 40,44 ----
  	glc_format.c \
  	glc_program.c \
+ 	glc_programmatic.c \
  	$(libglc_glx_sources) \
  	$(libglc_agl_sources) \

Index: glc.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** a/glc.c	21 Feb 2004 03:19:11 -0000	1.19
--- b/glc.c	26 Feb 2004 10:16:04 -0000	1.20
***************
*** 83,86 ****
--- 83,91 ----
    double src_width, src_height, mask_width, mask_height;
  
+   /* TODO: support direct compositing with programmatic mask surface
+      and mask surface with convolution filter */
+   if (mask->programmatic || mask->convolution)
+     return 0;
+ 
    /* We cannot continue if we have a rotating transformation or
       if both surfaces have transformations or the surface not being
***************
*** 108,112 ****
    glDisable (GL_SCISSOR_TEST);
  
!   if (!glc_surface_enable_program (src, src_texture, mask_texture)) {
      glc_surface_pop_current (dst);
      return 0;
--- 113,117 ----
    glDisable (GL_SCISSOR_TEST);
  
!   if (!glc_surface_enable_program (dst, src, src_texture, mask_texture)) {
      glc_surface_pop_current (dst);
      return 0;
***************
*** 392,395 ****
--- 397,404 ----
    glc_region_box_t clip;
  
+   if (src->programmatic)
+     glc_programmatic_surface_setup (src, dst->width + x_src,
+                                     dst->height + y_src);
+ 
    if (mask) {
      glc_region_box_t mask_bounds;
***************
*** 518,523 ****
    glc_set_operator (op);
  
!   if (src->convolution)
!     glc_surface_enable_program (src, texture, NULL);
    
    if ((!TRANSFORM (src)) && GLREPEAT (src, texture)) {
--- 527,532 ----
    glc_set_operator (op);
  
!   if (src->convolution || src->programmatic)
!     glc_surface_enable_program (dst, src, texture, NULL);
    
    if ((!TRANSFORM (src)) && GLREPEAT (src, texture)) {
***************
*** 644,649 ****
          glTexCoord2d (0.0, texture->texcoord_height);
          glVertex2d (tl.x, tl.y);
!         glTexCoord2d (texture->texcoord_width,
!                       texture->texcoord_height);
          glVertex2d (tr.x, tr.y);
          glTexCoord2d (texture->texcoord_width, 0.0);
--- 653,657 ----
          glTexCoord2d (0.0, texture->texcoord_height);
          glVertex2d (tl.x, tl.y);
!         glTexCoord2d (texture->texcoord_width, texture->texcoord_height);
          glVertex2d (tr.x, tr.y);
          glTexCoord2d (texture->texcoord_width, 0.0);
***************
*** 677,682 ****
    }
  
!   if (src->convolution)
!     glc_surface_disable_program (src);
    
    glc_texture_unbind (texture);
--- 685,690 ----
    }
  
!   if (src->convolution || src->programmatic)
!     glc_surface_disable_program (dst);
    
    glc_texture_unbind (texture);

Index: glc.h
===================================================================
RCS file: /cvs/cairo/libglc/src/glc.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** a/glc.h	20 Feb 2004 17:40:57 -0000	1.13
--- b/glc.h	26 Feb 2004 10:16:04 -0000	1.14
***************
*** 100,103 ****
--- 100,108 ----
    glc_color_t color;
  } glc_colorpoint_t;
+ 
+ typedef struct _glc_colorstop_t {
+   glc_fixed16_16_t stop;
+   glc_color_t color;
+ } glc_colorstop_t;
    
  typedef struct _glc_color_trapezoid_t {
***************
*** 136,145 ****
  #define GLC_FEATURE_OFFSCREEN_DRAWING_MASK     (1L << 0)
  #define GLC_FEATURE_CONVOLUTION_FILTER_MASK    (1L << 1)
! #define GLC_FEATURE_TEXTURE_RECTANGLE_MASK     (1L << 2)
! #define GLC_FEATURE_MULTISAMPLE_MASK           (1L << 3)
! #define GLC_FEATURE_OFFSCREEN_MULTISAMPLE_MASK (1L << 4)
! #define GLC_FEATURE_ARB_VERTEX_PROGRAM_MASK    (1L << 5)
! #define GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK  (1L << 6)
! #define GLC_FEATURE_ATI_RENDER_TEXTURE_MASK    (1L << 7)
  
  typedef enum {  
--- 141,151 ----
  #define GLC_FEATURE_OFFSCREEN_DRAWING_MASK     (1L << 0)
  #define GLC_FEATURE_CONVOLUTION_FILTER_MASK    (1L << 1)
! #define GLC_FEATURE_PROGRAMMATIC_SURFACE_MASK  (1L << 2)
! #define GLC_FEATURE_TEXTURE_RECTANGLE_MASK     (1L << 3)
! #define GLC_FEATURE_MULTISAMPLE_MASK           (1L << 4)
! #define GLC_FEATURE_OFFSCREEN_MULTISAMPLE_MASK (1L << 5)
! #define GLC_FEATURE_ARB_VERTEX_PROGRAM_MASK    (1L << 6)
! #define GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK  (1L << 7)
! #define GLC_FEATURE_ATI_RENDER_TEXTURE_MASK    (1L << 8)
  
  typedef enum {  
***************
*** 307,310 ****
--- 313,330 ----
  
    
+ /* glc_programmatic.c */
+ 
+ glc_surface_t *
+ glc_linear_gradient_create (glc_colorpoint_t *start,
+                             glc_colorpoint_t *end,
+                             glc_colorstop_t *stops,
+                             int n_stops);
+ 
+ glc_surface_t *
+ glc_radial_gradient_create (glc_colorpoint_t *start,
+                             glc_colorstop_t *stops,
+                             int n_stops);
+   
+   
  /* glc_rect.c */
  

Index: glc_agl_extension.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_agl_extension.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** a/glc_agl_extension.c	20 Feb 2004 17:40:57 -0000	1.4
--- b/glc_agl_extension.c	26 Feb 2004 10:16:04 -0000	1.5
***************
*** 86,91 ****
    
    if (thread_info->agl_feature_mask &
!       GLC_AGL_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
      thread_info->feature_mask |= GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
  
    if ((thread_info->feature_mask & GLC_FEATURE_ARB_VERTEX_PROGRAM_MASK) &&
--- 86,93 ----
    
    if (thread_info->agl_feature_mask &
!       GLC_AGL_FEATURE_ARB_FRAGMENT_PROGRAM_MASK) {
      thread_info->feature_mask |= GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
+     thread_info->feature_mask |= GLC_FEATURE_PROGRAMMATIC_SURFACE_MASK;
+   }
  
    if ((thread_info->feature_mask & GLC_FEATURE_ARB_VERTEX_PROGRAM_MASK) &&

Index: glc_agl_info.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_agl_info.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** a/glc_agl_info.c	20 Feb 2004 17:40:57 -0000	1.6
--- b/glc_agl_info.c	26 Feb 2004 10:16:04 -0000	1.7
***************
*** 166,169 ****
--- 166,170 ----
            | GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK
            | GLC_FEATURE_CONVOLUTION_FILTER_MASK
+           | GLC_FEATURE_PROGRAMMATIC_SURFACE_MASK
  #endif          
            

Index: glc_glx_extension.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_extension.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** a/glc_glx_extension.c	23 Feb 2004 22:38:14 -0000	1.11
--- b/glc_glx_extension.c	26 Feb 2004 10:16:04 -0000	1.12
***************
*** 149,152 ****
--- 149,153 ----
        GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
      screen_info->feature_mask |= GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
+     screen_info->feature_mask |= GLC_FEATURE_PROGRAMMATIC_SURFACE_MASK;
  #endif
      

Index: glc_glx_info.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_info.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** a/glc_glx_info.c	20 Feb 2004 17:40:57 -0000	1.11
--- b/glc_glx_info.c	26 Feb 2004 10:16:04 -0000	1.12
***************
*** 318,321 ****
--- 318,322 ----
            | GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK
            | GLC_FEATURE_CONVOLUTION_FILTER_MASK
+           | GLC_FEATURE_PROGRAMMATIC_SURFACE_MASK
  #endif
            

Index: glc_glx_surface.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_surface.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** a/glc_glx_surface.c	20 Feb 2004 17:40:57 -0000	1.16
--- b/glc_glx_surface.c	26 Feb 2004 10:16:04 -0000	1.17
***************
*** 169,172 ****
--- 169,173 ----
    surface->base.feature_mask &= ~GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
    surface->base.feature_mask &= ~GLC_FEATURE_CONVOLUTION_FILTER_MASK;
+   surface->base.feature_mask &= ~GLC_FEATURE_PROGRAMMATIC_SURFACE_MASK;
    surface->base.feature_mask &= ~GLC_FEATURE_MULTISAMPLE_MASK;
    surface->base.feature_mask &= ~GLC_FEATURE_OFFSCREEN_MULTISAMPLE_MASK;
***************
*** 193,198 ****
        surface->context->gl_proc_address.gl_bind_program_arb) {
      if (surface->screen_info->feature_mask &
!         GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
        surface->base.feature_mask |= GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
      
      if (surface->screen_info->feature_mask &
--- 194,201 ----
        surface->context->gl_proc_address.gl_bind_program_arb) {
      if (surface->screen_info->feature_mask &
!         GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK) {
        surface->base.feature_mask |= GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK;
+       surface->base.feature_mask |= GLC_FEATURE_PROGRAMMATIC_SURFACE_MASK;
+     }
      
      if (surface->screen_info->feature_mask &

Index: glc_program.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_program.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/glc_program.c	20 Feb 2004 17:40:57 -0000	1.3
--- b/glc_program.c	26 Feb 2004 10:16:04 -0000	1.4
***************
*** 32,469 ****
  #include "glcint.h"
  
! #ifdef GL_ARB_fragment_program
! 
! static char *_glc_vertex_programs[] =
!   {
!     /*
!      * Passes texture coordinates to convolution filter
!      * fragment programs. Texture unit 1 is reserved for MASK
!      * in Porter-Duff compositing.
[...1034 lines suppressed...]
  {
    
  #ifdef GL_ARB_fragment_program
!   surface->proc_address->gl_bind_program_arb (GL_FRAGMENT_PROGRAM_ARB, 0);
    glDisable (GL_FRAGMENT_PROGRAM_ARB);
!   surface->proc_address->gl_bind_program_arb (GL_VERTEX_PROGRAM_ARB, 0);
    glDisable (GL_VERTEX_PROGRAM_ARB);
  #endif
--- 564,574 ----
  
  void
! glc_program_disable (glc_surface_t *dst)
  {
    
  #ifdef GL_ARB_fragment_program
!   dst->proc_address->gl_bind_program_arb (GL_FRAGMENT_PROGRAM_ARB, 0);
    glDisable (GL_FRAGMENT_PROGRAM_ARB);
!   dst->proc_address->gl_bind_program_arb (GL_VERTEX_PROGRAM_ARB, 0);
    glDisable (GL_VERTEX_PROGRAM_ARB);
  #endif

Index: glc_surface.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_surface.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** a/glc_surface.c	21 Feb 2004 03:19:12 -0000	1.18
--- b/glc_surface.c	26 Feb 2004 10:16:04 -0000	1.19
***************
*** 57,60 ****
--- 57,61 ----
    surface->convolution = NULL;
    surface->clear_exterior = 0;
+   surface->programmatic = 0;
  }
  
***************
*** 110,119 ****
  glc_bool_t
  glc_surface_enable_program (glc_surface_t *surface,
!                             glc_texture_t *src,
!                             glc_texture_t *mask)
  {
    if (surface->feature_mask & GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
      return
!       glc_program_enable (surface, src, mask);
    
    return 0;
--- 111,121 ----
  glc_bool_t
  glc_surface_enable_program (glc_surface_t *surface,
!                             glc_surface_t *src,
!                             glc_texture_t *src_texture,
!                             glc_texture_t *mask_texture)
  {
    if (surface->feature_mask & GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK)
      return
!       glc_program_enable (surface, src, src_texture, mask_texture);
    
    return 0;
***************
*** 188,191 ****
--- 190,196 ----
    };
  
+   if (surface->programmatic)
+     return;
+ 
    if (transform && memcmp (transform, &identity,
                             sizeof (glc_transform_t)) == 0)
***************
*** 220,223 ****
--- 225,231 ----
                               glc_convolution_t *convolution)
  {
+   if (surface->programmatic)
+     return;
+   
    if (convolution &&
        convolution->matrix[0][0] == 0x00000 &&
***************
*** 263,266 ****
--- 271,277 ----
                          glc_bool_t repeat)
  {
+   if (surface->programmatic)
+     return;
+   
    surface->repeat = repeat;
  }
***************
*** 271,274 ****
--- 282,288 ----
                          glc_filter_t filter)
  {
+   if (surface->programmatic)
+     return;
+   
    surface->filter = filter;
  }
***************
*** 286,289 ****
--- 300,306 ----
  glc_surface_get_width (glc_surface_t *surface)
  {
+   if (surface->programmatic)
+     return 1;
+   
    return surface->width;
  }
***************
*** 293,296 ****
--- 310,316 ----
  glc_surface_get_height (glc_surface_t *surface)
  {
+   if (surface->programmatic)
+     return 1;
+   
    return surface->height;
  }
***************
*** 339,342 ****
--- 359,365 ----
                    unsigned int height)
  {
+   if (surface->programmatic)
+     return;
+   
    if (surface->format->doublebuffer &&
        x <= 0 && y <= 0 &&
***************
*** 441,444 ****
--- 464,470 ----
    GLenum format, type;
  
+   if (surface->programmatic)
+     return;
+ 
    if (x < 0 || x > (int) surface->width - (int) width ||
        y < 0 || y > (int) surface->height - (int) height) {
***************
*** 511,514 ****
--- 537,543 ----
    int bytes_per_pixel;
  
+   if (surface->programmatic)
+     return;
+ 
    if (x < 0 || x > (surface->width - (int) width) ||
        y < 0 || y > (surface->height - (int) height)) {
***************
*** 587,599 ****
  {
    glc_texture_t *texture = glc_surface_get_texture (surface);
! 
    if (!texture)
      return;
  
!   glc_texture_bind (texture);
!   glc_texture_ensure_filter (texture, surface->filter);
!   glc_texture_ensure_repeat (texture,
!                              (surface->repeat && texture->repeatable));
!   glc_texture_unbind (texture);
  
    if (name)
--- 616,630 ----
  {
    glc_texture_t *texture = glc_surface_get_texture (surface);
!   
    if (!texture)
      return;
  
!   if (!surface->programmatic) {
!     glc_texture_bind (texture);
!     glc_texture_ensure_filter (texture, surface->filter);
!     glc_texture_ensure_repeat (texture,
!                                (surface->repeat && texture->repeatable));
!     glc_texture_unbind (texture);
!   }
  
    if (name)

Index: glc_trap.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_trap.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** a/glc_trap.c	10 Feb 2004 23:38:36 -0000	1.10
--- b/glc_trap.c	26 Feb 2004 10:16:04 -0000	1.11
***************
*** 143,146 ****
--- 143,150 ----
    double x_draw_offset, y_draw_offset;
  
+   if (src->programmatic)
+     glc_programmatic_surface_setup (src, dst->width + x_src,
+                                     dst->height + y_src);
+   
    if (n_traps == 1 &&
        glc_composite_direct_check (op, src, dst, x_src, y_src, traps))

Index: glc_tri.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_tri.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** a/glc_tri.c	10 Feb 2004 23:38:36 -0000	1.10
--- b/glc_tri.c	26 Feb 2004 10:16:04 -0000	1.11
***************
*** 75,78 ****
--- 75,82 ----
    double x_draw_offset, y_draw_offset;
  
+   if (src->programmatic)
+     glc_programmatic_surface_setup (src, dst->width + x_src,
+                                     dst->height + y_src);
+ 
    glc_point_fixed_bounds (n_tris * 3, (glc_point_fixed_t *) tris, &bounds);
    if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2 ||
***************
*** 192,195 ****
--- 196,203 ----
      return;
  
+   if (src->programmatic)
+     glc_programmatic_surface_setup (src, dst->width + x_src,
+                                     dst->height + y_src);
+ 
    glc_point_fixed_bounds (n_points, points, &bounds);
    if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2 ||
***************
*** 304,307 ****
--- 312,319 ----
      return;
  
+   if (src->programmatic)
+     glc_programmatic_surface_setup (src, dst->width + x_src,
+                                     dst->height + y_src);
+ 
    glc_point_fixed_bounds (n_points, points, &bounds);
    if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2 ||

Index: glcint.h
===================================================================
RCS file: /cvs/cairo/libglc/src/glcint.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** a/glcint.h	23 Feb 2004 22:38:14 -0000	1.20
--- b/glcint.h	26 Feb 2004 10:16:04 -0000	1.21
***************
*** 122,143 ****
  } glc_gl_proc_address_list_t;
  
! #define GLC_VERTEX_PROGRAMS   1
! #define GLC_FRAGMENT_PROGRAMS 10
  
! #define GLC_VERTEX_PROGRAM_COMP_CONV_BASE 0
  
! #define GLC_FRAGMENT_PROGRAM_COMP_BASE      0
! #define GLC_FRAGMENT_PROGRAM_COMP_CONV_BASE 4
  
! #define GLC_FRAGMENT_PROGRAM_2D_2D_OFFSET     0
! #define GLC_FRAGMENT_PROGRAM_RECT_2D_OFFSET   1
! #define GLC_FRAGMENT_PROGRAM_2D_RECT_OFFSET   2
! #define GLC_FRAGMENT_PROGRAM_RECT_RECT_OFFSET 3
! #define GLC_FRAGMENT_PROGRAM_2D_OFFSET        4
! #define GLC_FRAGMENT_PROGRAM_RECT_OFFSET      5
  
  typedef struct _glc_programs_t {
!   unsigned long vertex[GLC_VERTEX_PROGRAMS];
!   unsigned long fragment[GLC_FRAGMENT_PROGRAMS];
  } glc_programs_t;
  
--- 122,153 ----
  } glc_gl_proc_address_list_t;
  
! typedef enum {
!   GLC_PROGRAMMATIC_SURFACE_LINEAR_GRADIENT_TYPE = 0,
!   GLC_PROGRAMMATIC_SURFACE_RADIAL_GRADIENT_TYPE
! } glc_programmatic_surface_type_t;
  
! #define GLC_PROGRAMMATIC_SURFACE_NUM \
!   (GLC_PROGRAMMATIC_SURFACE_RADIAL_GRADIENT_TYPE + 1)
  
! #define GLC_PROGRAM_2DSRC_2DMASK_OFFSET     0
! #define GLC_PROGRAM_RECTSRC_2DMASK_OFFSET   1
! #define GLC_PROGRAM_2DSRC_RECTMASK_OFFSET   2
! #define GLC_PROGRAM_RECTSRC_RECTMASK_OFFSET 3
! #define GLC_PROGRAM_NOSRC_2DMASK_OFFSET     4
! #define GLC_PROGRAM_NOSRC_RECTMASK_OFFSET   5
! #define GLC_PROGRAM_2DSRC_NOMASK_OFFSET     6
! #define GLC_PROGRAM_RECTSRC_NOMASK_OFFSET   7
! #define GLC_PROGRAM_NOSRC_NOMASK_OFFSET     8
  
! #define GLC_VERTEX_PROGRAM_TYPES   1
! #define GLC_FRAGMENT_PROGRAM_TYPES 9
! #define GLC_FRAGMENT_PROGRAMMATIC_PROGRAM_TYPES \
!   (GLC_FRAGMENT_PROGRAM_TYPES * GLC_PROGRAMMATIC_SURFACE_NUM)
  
  typedef struct _glc_programs_t {
!   unsigned long vertex_convolution[GLC_VERTEX_PROGRAM_TYPES];
!   unsigned long fragment_simple[GLC_FRAGMENT_PROGRAM_TYPES];
!   unsigned long fragment_convolution[GLC_FRAGMENT_PROGRAM_TYPES];
!   unsigned long fragment_programmatic[GLC_FRAGMENT_PROGRAMMATIC_PROGRAM_TYPES];
  } glc_programs_t;
  
***************
*** 233,238 ****
--- 243,272 ----
    glc_matrix_t *convolution;
    glc_bool_t clear_exterior;
+   glc_bool_t programmatic;
  };
  
+ typedef struct _glc_linear_gradient_t {
+   glc_colorpoint_t start;
+   glc_colorpoint_t end;
+ } glc_linear_gradient_t;
+ 
+ typedef struct _glc_radial_gradient_t {
+   glc_colorpoint_t start;
+   glc_colorstop_t stop;
+ } glc_radial_gradient_t;
+ 
+ typedef union _glc_programmatic_attributes_t {
+   glc_linear_gradient_t linear_gradient;
+   glc_radial_gradient_t radial_gradient;
+ } glc_programmatic_attributes_t;
+ 
+ typedef struct _glc_programmatic_surface_t {
+   glc_surface_t base;
+   
+   glc_programmatic_surface_type_t type;
+   glc_programmatic_attributes_t attributes;
+   glc_texture_t texture;
+ } glc_programmatic_surface_t;
+ 
  typedef struct _glc_extension_map {
    char *name;
***************
*** 362,367 ****
  extern glc_bool_t __internal_linkage
  glc_surface_enable_program (glc_surface_t *surface,
!                             glc_texture_t *src,
!                             glc_texture_t *mask);
  
  extern void __internal_linkage
--- 396,402 ----
  extern glc_bool_t __internal_linkage
  glc_surface_enable_program (glc_surface_t *surface,
!                             glc_surface_t *src,
!                             glc_texture_t *src_texture,
!                             glc_texture_t *mask_texture);
  
  extern void __internal_linkage
***************
*** 404,413 ****
  
  extern glc_bool_t __internal_linkage
! glc_program_enable (glc_surface_t *surface,
                      glc_texture_t *src_texture,
                      glc_texture_t *mask_texture);
  
  extern void __internal_linkage
! glc_program_disable (glc_surface_t *surface);
  
  #define MAXSHORT SHRT_MAX
--- 439,459 ----
  
  extern glc_bool_t __internal_linkage
! glc_program_enable (glc_surface_t *dst,
!                     glc_surface_t *src,
                      glc_texture_t *src_texture,
                      glc_texture_t *mask_texture);
  
  extern void __internal_linkage
! glc_program_disable (glc_surface_t *dst);
! 
! extern void __internal_linkage
! glc_programmatic_surface_setup (glc_surface_t *abstract_surface,
!                                 int width,
!                                 int height);
! 
! extern void __internal_linkage
! glc_programmatic_surface_set_parameters (glc_gl_proc_address_list_t
!                                          *proc_address,
!                                          glc_programmatic_surface_t *surface);
  
  #define MAXSHORT SHRT_MAX
***************
*** 492,496 ****
  slim_hidden_proto(glc_composite_tri_fan)
  slim_hidden_proto(glc_color_triangles)
! 
       
  #ifdef LIBGLC_HAS_GLX_BACKEND
--- 538,544 ----
  slim_hidden_proto(glc_composite_tri_fan)
  slim_hidden_proto(glc_color_triangles)
! slim_hidden_proto(glc_linear_gradient_create)
! slim_hidden_proto(glc_radial_gradient_create)
!      
       
  #ifdef LIBGLC_HAS_GLX_BACKEND





More information about the cairo-commit mailing list