[cairo-commit] libglc/src glc.h,1.14,1.15 glc_agl_extension.c,1.5,1.6 glc_glx_extension.c,1.12,1.13 glc_texture.c,1.9,1.10 glc_trap.c,1.12,1.13 glcint.h,1.21,1.22
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-serv4980/src
Modified Files:
glc.h glc_agl_extension.c glc_glx_extension.c glc_texture.c
glc_trap.c glcint.h
Log Message:
Added NPOT texture support
Index: glc.h
===================================================================
RCS file: /cvs/cairo/libglc/src/glc.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** a/glc.h 26 Feb 2004 10:16:04 -0000 1.14
--- b/glc.h 29 Feb 2004 17:37:42 -0000 1.15
***************
*** 143,151 ****
#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 {
--- 143,152 ----
#define GLC_FEATURE_PROGRAMMATIC_SURFACE_MASK (1L << 2)
#define GLC_FEATURE_TEXTURE_RECTANGLE_MASK (1L << 3)
! #define GLC_FEATURE_TEXTURE_NPOT_MASK (1L << 4)
! #define GLC_FEATURE_MULTISAMPLE_MASK (1L << 5)
! #define GLC_FEATURE_OFFSCREEN_MULTISAMPLE_MASK (1L << 6)
! #define GLC_FEATURE_ARB_VERTEX_PROGRAM_MASK (1L << 7)
! #define GLC_FEATURE_ARB_FRAGMENT_PROGRAM_MASK (1L << 8)
! #define GLC_FEATURE_ATI_RENDER_TEXTURE_MASK (1L << 9)
typedef enum {
Index: glc_agl_extension.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_agl_extension.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** a/glc_agl_extension.c 26 Feb 2004 10:16:04 -0000 1.5
--- b/glc_agl_extension.c 29 Feb 2004 17:37:42 -0000 1.6
***************
*** 36,39 ****
--- 36,40 ----
{ "GL_EXT_texture_rectangle", GLC_AGL_FEATURE_TEXTURE_RECTANGLE_MASK },
{ "GL_NV_texture_rectangle", GLC_AGL_FEATURE_TEXTURE_RECTANGLE_MASK },
+ { "GL_ARB_texture_non_power_of_two", GLC_AGL_FEATURE_TEXTURE_NPOT_MASK },
{ "GL_ARB_multisample", GLC_AGL_FEATURE_MULTISAMPLE_MASK },
{ "GL_NV_multisample_filter_hint", GLC_AGL_FEATURE_MULTISAMPLE_FILTER_MASK },
***************
*** 76,79 ****
--- 77,85 ----
}
+ if (thread_info->agl_feature_mask & GLC_AGL_FEATURE_TEXTURE_NPOT_MASK) {
+ thread_info->texture_mask |= GLC_TEXTURE_TARGET_NPOT_MASK;
+ thread_info->feature_mask |= GLC_FEATURE_TEXTURE_NPOT_MASK;
+ }
+
if (thread_info->agl_feature_mask & GLC_AGL_FEATURE_TEXTURE_RECTANGLE_MASK) {
thread_info->texture_mask |= GLC_TEXTURE_TARGET_RECTANGLE_MASK;
Index: glc_glx_extension.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_glx_extension.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** a/glc_glx_extension.c 26 Feb 2004 10:16:04 -0000 1.12
--- b/glc_glx_extension.c 29 Feb 2004 17:37:42 -0000 1.13
***************
*** 41,44 ****
--- 41,45 ----
{ "GL_EXT_texture_rectangle", GLC_GLX_FEATURE_TEXTURE_RECTANGLE_MASK },
{ "GL_NV_texture_rectangle", GLC_GLX_FEATURE_TEXTURE_RECTANGLE_MASK },
+ { "GL_ARB_texture_non_power_of_two", GLC_GLX_FEATURE_TEXTURE_NPOT_MASK },
{ "GL_ARB_multisample", GLC_GLX_FEATURE_MULTISAMPLE_MASK },
{ "GL_NV_multisample_filter_hint", GLC_GLX_FEATURE_MULTISAMPLE_FILTER_MASK },
***************
*** 105,108 ****
--- 106,114 ----
#endif
+ if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_TEXTURE_NPOT_MASK) {
+ screen_info->texture_mask |= GLC_TEXTURE_TARGET_NPOT_MASK;
+ screen_info->feature_mask |= GLC_FEATURE_TEXTURE_NPOT_MASK;
+ }
+
#if defined(GL_EXT_texture_rectangle) || defined(GL_NV_texture_rectangle)
if (screen_info->glx_feature_mask & GLC_GLX_FEATURE_TEXTURE_RECTANGLE_MASK) {
Index: glc_texture.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_texture.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** a/glc_texture.c 18 Feb 2004 14:52:45 -0000 1.9
--- b/glc_texture.c 29 Feb 2004 17:37:42 -0000 1.10
***************
*** 46,55 ****
_glc_texture_find_best_target (int width, int height,
long int target_mask,
! unsigned int *target,
! unsigned int *proxy_target)
{
*target = GL_TEXTURE_2D;
! *proxy_target = GL_PROXY_TEXTURE_2D;
!
if ((!(target_mask & GLC_TEXTURE_TARGET_2D_MASK)) ||
(!_glc_texture_is_power_of_two (width)) ||
--- 46,53 ----
_glc_texture_find_best_target (int width, int height,
long int target_mask,
! unsigned int *target)
{
*target = GL_TEXTURE_2D;
!
if ((!(target_mask & GLC_TEXTURE_TARGET_2D_MASK)) ||
(!_glc_texture_is_power_of_two (width)) ||
***************
*** 59,66 ****
#ifdef GL_EXT_texture_rectangle
*target = GL_TEXTURE_RECTANGLE_EXT;
- *proxy_target = GL_PROXY_TEXTURE_RECTANGLE_EXT;
#else
*target = GL_TEXTURE_RECTANGLE_NV;
- *proxy_target = GL_PROXY_TEXTURE_RECTANGLE_NV;
#endif
--- 57,62 ----
***************
*** 87,91 ****
{
glc_texture_t *texture;
- unsigned int proxy_target;
texture = (glc_texture_t *) malloc (sizeof (glc_texture_t));
--- 83,86 ----
***************
*** 99,111 ****
texture->format = texture_format;
texture->allocated = 0;
!
! _glc_texture_find_best_target (width, height,
! target_mask,
! &texture->target, &proxy_target);
!
! if (texture->target == GL_TEXTURE_2D) {
! _glc_texture_power_of_two_size (&texture->width);
! _glc_texture_power_of_two_size (&texture->height);
! }
glGenTextures (1, (GLuint *) &texture->name);
--- 94,108 ----
texture->format = texture_format;
texture->allocated = 0;
!
! if (!(target_mask & GLC_TEXTURE_TARGET_NPOT_MASK)) {
! _glc_texture_find_best_target (width, height,
! target_mask, &texture->target);
!
! if (texture->target == GL_TEXTURE_2D) {
! _glc_texture_power_of_two_size (&texture->width);
! _glc_texture_power_of_two_size (&texture->height);
! }
! } else
! texture->target = GL_TEXTURE_2D;
glGenTextures (1, (GLuint *) &texture->name);
Index: glc_trap.c
===================================================================
RCS file: /cvs/cairo/libglc/src/glc_trap.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** a/glc_trap.c 27 Feb 2004 14:46:23 -0000 1.12
--- b/glc_trap.c 29 Feb 2004 17:37:42 -0000 1.13
***************
*** 146,150 ****
if (n_traps == 0)
return;
!
x_dst = traps[0].left.p1.x >> 16;
y_dst = traps[0].left.p1.y >> 16;
--- 146,150 ----
if (n_traps == 0)
return;
!
x_dst = traps[0].left.p1.x >> 16;
y_dst = traps[0].left.p1.y >> 16;
***************
*** 219,223 ****
glBegin (GL_QUADS);
!
for (; n_traps; n_traps--, traps++) {
double top, bottom;
--- 219,223 ----
glBegin (GL_QUADS);
!
for (; n_traps; n_traps--, traps++) {
double top, bottom;
***************
*** 242,246 ****
(&traps->left, traps->bottom, 0)), bottom);
}
!
glEnd ();
--- 242,246 ----
(&traps->left, traps->bottom, 0)), bottom);
}
!
glEnd ();
***************
*** 252,256 ****
}
! glc_surface_dirty (mask, NULL);
glc_surface_pop_current (mask);
--- 252,256 ----
}
! glc_surface_dirty (mask, NULL);
glc_surface_pop_current (mask);
Index: glcint.h
===================================================================
RCS file: /cvs/cairo/libglc/src/glcint.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** a/glcint.h 26 Feb 2004 10:16:04 -0000 1.21
--- b/glcint.h 29 Feb 2004 17:37:42 -0000 1.22
***************
*** 75,78 ****
--- 75,79 ----
#define GLC_TEXTURE_TARGET_2D_MASK (1L << 0)
#define GLC_TEXTURE_TARGET_RECTANGLE_MASK (1L << 1)
+ #define GLC_TEXTURE_TARGET_NPOT_MASK (1L << 2)
#define GLC_FORMAT_ALL_EXCEPT_ID_MASK ((1 << 16) - 2)
***************
*** 552,562 ****
#define GLC_GLX_FEATURE_TEXTURE_RECTANGLE_MASK (1L << 0)
! #define GLC_GLX_FEATURE_MULTISAMPLE_MASK (1L << 1)
! #define GLC_GLX_FEATURE_CLIENT_MULTISAMPLE_MASK (1L << 2)
! #define GLC_GLX_FEATURE_MULTISAMPLE_FILTER_MASK (1L << 3)
! #define GLC_GLX_FEATURE_ARB_VERTEX_PROGRAM_MASK (1L << 4)
! #define GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK (1L << 5)
! #define GLC_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK (1L << 6)
! #define GLC_GLX_FEATURE_GLX13_MASK (1L << 7)
typedef struct _glc_glx_surface glc_glx_surface_t;
--- 553,564 ----
#define GLC_GLX_FEATURE_TEXTURE_RECTANGLE_MASK (1L << 0)
! #define GLC_GLX_FEATURE_TEXTURE_NPOT_MASK (1L << 1)
! #define GLC_GLX_FEATURE_MULTISAMPLE_MASK (1L << 2)
! #define GLC_GLX_FEATURE_CLIENT_MULTISAMPLE_MASK (1L << 3)
! #define GLC_GLX_FEATURE_MULTISAMPLE_FILTER_MASK (1L << 4)
! #define GLC_GLX_FEATURE_ARB_VERTEX_PROGRAM_MASK (1L << 5)
! #define GLC_GLX_FEATURE_ARB_FRAGMENT_PROGRAM_MASK (1L << 6)
! #define GLC_GLX_FEATURE_ATI_RENDER_TEXTURE_MASK (1L << 7)
! #define GLC_GLX_FEATURE_GLX13_MASK (1L << 8)
typedef struct _glc_glx_surface glc_glx_surface_t;
***************
*** 742,749 ****
#define GLC_AGL_FEATURE_PBUFFER_MASK (1L << 0)
#define GLC_AGL_FEATURE_TEXTURE_RECTANGLE_MASK (1L << 1)
! #define GLC_AGL_FEATURE_MULTISAMPLE_MASK (1L << 2)
! #define GLC_AGL_FEATURE_MULTISAMPLE_FILTER_MASK (1L << 3)
! #define GLC_AGL_FEATURE_ARB_VERTEX_PROGRAM_MASK (1L << 4)
! #define GLC_AGL_FEATURE_ARB_FRAGMENT_PROGRAM_MASK (1L << 5)
typedef struct _glc_agl_surface_t glc_agl_surface_t;
--- 744,752 ----
#define GLC_AGL_FEATURE_PBUFFER_MASK (1L << 0)
#define GLC_AGL_FEATURE_TEXTURE_RECTANGLE_MASK (1L << 1)
! #define GLC_AGL_FEATURE_TEXTURE_NPOT_MASK (1L << 2)
! #define GLC_AGL_FEATURE_MULTISAMPLE_MASK (1L << 3)
! #define GLC_AGL_FEATURE_MULTISAMPLE_FILTER_MASK (1L << 4)
! #define GLC_AGL_FEATURE_ARB_VERTEX_PROGRAM_MASK (1L << 5)
! #define GLC_AGL_FEATURE_ARB_FRAGMENT_PROGRAM_MASK (1L << 6)
typedef struct _glc_agl_surface_t glc_agl_surface_t;
More information about the cairo-commit
mailing list