mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
Fix errors building for gles-systems (clutter-eglx)
* GL_TEXTURE_RECTANGLE_ARB not avaliable * clutter_glx_texture_pixmap_using_extension / CLUTTER_GLX_TEXTURE_PIXMAP not avaliable Signed-off-by: Andreas Mueller <schnitzeltony@gmx.de>
This commit is contained in:
parent
1160744830
commit
d3df33ecdb
@ -187,8 +187,10 @@ meta_shaped_texture_dirty_mask (MetaShapedTexture *stex)
|
||||
cogl_texture_get_gl_texture (priv->mask_texture,
|
||||
&mask_gl_tex, &mask_gl_target);
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
if (mask_gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||
glDeleteTextures (1, &mask_gl_tex);
|
||||
#endif
|
||||
|
||||
cogl_handle_unref (priv->mask_texture);
|
||||
priv->mask_texture = COGL_INVALID_HANDLE;
|
||||
@ -253,6 +255,7 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
|
||||
|
||||
cogl_texture_get_gl_texture (paint_tex, NULL, &paint_gl_target);
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
if (paint_gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||
{
|
||||
GLuint tex;
|
||||
@ -275,6 +278,7 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
|
||||
COGL_PIXEL_FORMAT_A_8);
|
||||
}
|
||||
else
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
priv->mask_texture = cogl_texture_new_from_data (tex_width, tex_height,
|
||||
COGL_TEXTURE_NONE,
|
||||
COGL_PIXEL_FORMAT_A_8,
|
||||
|
@ -97,6 +97,7 @@ meta_texture_tower_free (MetaTextureTower *tower)
|
||||
g_slice_free (MetaTextureTower, tower);
|
||||
}
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
static gboolean
|
||||
texture_is_rectangle (CoglHandle texture)
|
||||
{
|
||||
@ -106,10 +107,12 @@ texture_is_rectangle (CoglHandle texture)
|
||||
cogl_texture_get_gl_texture (texture, &gl_tex, &gl_target);
|
||||
return gl_target == GL_TEXTURE_RECTANGLE_ARB;
|
||||
}
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
|
||||
static void
|
||||
free_texture (CoglHandle texture)
|
||||
{
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
GLuint gl_tex;
|
||||
GLenum gl_target;
|
||||
|
||||
@ -117,6 +120,7 @@ free_texture (CoglHandle texture)
|
||||
|
||||
if (gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||
glDeleteTextures (1, &gl_tex);
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
|
||||
cogl_handle_unref (texture);
|
||||
}
|
||||
@ -362,11 +366,13 @@ get_paint_level (int width, int height)
|
||||
return (int)(0.5 + lambda);
|
||||
}
|
||||
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
static gboolean
|
||||
is_power_of_two (int x)
|
||||
{
|
||||
return (x & (x - 1)) == 0;
|
||||
}
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
|
||||
static void
|
||||
texture_tower_create_texture (MetaTextureTower *tower,
|
||||
@ -374,6 +380,7 @@ texture_tower_create_texture (MetaTextureTower *tower,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||
if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
|
||||
texture_is_rectangle (tower->textures[level - 1]))
|
||||
{
|
||||
@ -396,6 +403,7 @@ texture_tower_create_texture (MetaTextureTower *tower,
|
||||
TEXTURE_FORMAT);
|
||||
}
|
||||
else
|
||||
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||
{
|
||||
tower->textures[level] = cogl_texture_new_with_size (width, height,
|
||||
COGL_TEXTURE_NO_AUTO_MIPMAP,
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define _ISOC99_SOURCE /* for roundf */
|
||||
#include <math.h>
|
||||
|
||||
@ -1823,9 +1825,11 @@ check_needs_pixmap (MetaWindowActor *self)
|
||||
* do it here.
|
||||
* See: http://bugzilla.clutter-project.org/show_bug.cgi?id=2236
|
||||
*/
|
||||
#ifdef HAVE_GLX_TEXTURE_PIXMAP
|
||||
if (G_UNLIKELY (!clutter_glx_texture_pixmap_using_extension (
|
||||
CLUTTER_GLX_TEXTURE_PIXMAP (priv->actor))))
|
||||
g_warning ("NOTE: Not using GLX TFP!\n");
|
||||
#endif
|
||||
|
||||
g_object_get (priv->actor,
|
||||
"pixmap-width", &pxm_width,
|
||||
|
Loading…
Reference in New Issue
Block a user