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:
Matthew Allum 2007-06-07 23:51:53 +00:00
parent 682aba56e3
commit f72e754876
5 changed files with 42 additions and 27 deletions

4
cogl.h
View File

@ -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,

View File

@ -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

View File

@ -300,10 +300,21 @@ 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)
{
if (target == CGL_TEXTURE_RECTANGLE_ARB)
{
gint max_size = 0;
GE( glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &max_size) );
return (max_size && width <= max_size && height <= max_size);
}
else /* Assumes CGL_TEXTURE_2D */
{
GLint new_width = 0;
@ -316,6 +327,7 @@ cogl_texture_can_size (COGLenum pixel_format,
return new_width != 0;
}
}
void
cogl_texture_quad (gint x1,

View File

@ -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

View File

@ -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