mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
2007-06-08 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c: * clutter/clutter-debug.h: * clutter/clutter-main.c: * clutter/clutter-main.h: * clutter/clutter-private.h: * clutter/clutter-timeline.c: Add 'schedule' debug flag and new CLUTTER_TIMESTAMP macro. * clutter/clutter-texture.c: * clutter/clutter-texture.h: * clutter/cogl/cogl.h: * clutter/cogl/gl/cogl-defines.h: * clutter/cogl/gles/cogl-defines.h: * clutter/cogl/gl/cogl.c: * clutter/cogl/gles/cogl.c: Add initial experiemental YUV texture support. Move texture rect size checks into cogl. Better handle moving texture data from video -> system memory (if support available).
This commit is contained in:
parent
682aba56e3
commit
f72e754876
4
cogl.h
4
cogl.h
@ -113,10 +113,12 @@ void
|
||||
cogl_enable (gulong flags);
|
||||
|
||||
gboolean
|
||||
cogl_texture_can_size (COGLenum pixel_format,
|
||||
cogl_texture_can_size (COGLenum target,
|
||||
COGLenum pixel_format,
|
||||
COGLenum pixel_type,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
void
|
||||
cogl_texture_quad (gint x1,
|
||||
gint x2,
|
||||
|
@ -671,6 +671,15 @@ typedef GLint COGLint;
|
||||
#define CGL_TEXTURE_2D GL_TEXTURE_2D
|
||||
#define CGL_ARGB GL_ARGB
|
||||
#define CGL_TEXTURE_RECTANGLE_ARB GL_TEXTURE_RECTANGLE_ARB
|
||||
#ifdef GL_YCBCR_MESA
|
||||
#define CGL_YCBCR_MESA GL_YCBCR_MESA
|
||||
#define CGL_UNSIGNED_SHORT_8_8_REV_MESA GL_UNSIGNED_SHORT_8_8_REV_MESA
|
||||
#define CGL_UNSIGNED_SHORT_8_8_MESA GL_UNSIGNED_SHORT_8_8_MESA
|
||||
#else
|
||||
#define CGL_YCBCR_MESA 0
|
||||
#define CGL_UNSIGNED_SHORT_8_8_REV_MESA 0
|
||||
#define CGL_UNSIGNED_SHORT_8_8_MESA 0
|
||||
#endif
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
28
gl/cogl.c
28
gl/cogl.c
@ -300,21 +300,33 @@ cogl_clip_unset (void)
|
||||
}
|
||||
|
||||
gboolean
|
||||
cogl_texture_can_size (COGLenum pixel_format,
|
||||
cogl_texture_can_size (COGLenum target,
|
||||
COGLenum pixel_format,
|
||||
COGLenum pixel_type,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
GLint new_width = 0;
|
||||
if (target == CGL_TEXTURE_RECTANGLE_ARB)
|
||||
{
|
||||
gint max_size = 0;
|
||||
|
||||
GE( glTexImage2D (GL_PROXY_TEXTURE_2D, 0, GL_RGBA,
|
||||
width, height, 0 /* border */,
|
||||
pixel_format, pixel_type, NULL) );
|
||||
GE( glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &max_size) );
|
||||
|
||||
GE( glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0,
|
||||
GL_TEXTURE_WIDTH, &new_width) );
|
||||
return (max_size && width <= max_size && height <= max_size);
|
||||
}
|
||||
else /* Assumes CGL_TEXTURE_2D */
|
||||
{
|
||||
GLint new_width = 0;
|
||||
|
||||
return new_width != 0;
|
||||
GE( glTexImage2D (GL_PROXY_TEXTURE_2D, 0, GL_RGBA,
|
||||
width, height, 0 /* border */,
|
||||
pixel_format, pixel_type, NULL) );
|
||||
|
||||
GE( glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0,
|
||||
GL_TEXTURE_WIDTH, &new_width) );
|
||||
|
||||
return new_width != 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -451,7 +451,13 @@ typedef GLint COGLint;
|
||||
#define CGL_BGR GL_RGB
|
||||
#define CGL_BGRA GL_RGBA
|
||||
|
||||
#define CGL_TEXTURE_RECTANGLE_ARB 0 /* Its unlikely we support this */
|
||||
/* Its unlikely we support this */
|
||||
#define CGL_TEXTURE_RECTANGLE_ARB 0
|
||||
|
||||
/* YUV textures also unsupported */
|
||||
#define CGL_YCBCR_MESA 0
|
||||
#define CGL_UNSIGNED_SHORT_8_8_REV_MESA 0
|
||||
#define CGL_UNSIGNED_SHORT_8_8_MESA 0
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
20
gles/cogl.c
20
gles/cogl.c
@ -267,29 +267,15 @@ cogl_clip_unset (void)
|
||||
GE( glDisable (GL_STENCIL_TEST) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
gboolean
|
||||
cogl_texture_can_size (COGLenum pixel_format,
|
||||
cogl_texture_can_size (COGLenum target,
|
||||
COGLenum pixel_format,
|
||||
COGLenum pixel_type,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
/* FIXME */
|
||||
/* FIXME: How we get this is likely GLES implementation dependant. */
|
||||
return TRUE;
|
||||
|
||||
#if 0
|
||||
GLint new_width = 0;
|
||||
|
||||
GE( glTexImage2D (GL_PROXY_TEXTURE_2D, 0, GL_RGBA,
|
||||
width, height, 0 /* border */,
|
||||
pixel_format, pixel_type, NULL) );
|
||||
|
||||
GE( glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0,
|
||||
GL_TEXTURE_WIDTH, &new_width) );
|
||||
|
||||
return new_width != 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user