mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00: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:
@ -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
|
||||
|
Reference in New Issue
Block a user