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,
|
cogl_texture_get_gl_texture (priv->mask_texture,
|
||||||
&mask_gl_tex, &mask_gl_target);
|
&mask_gl_tex, &mask_gl_target);
|
||||||
|
|
||||||
|
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||||
if (mask_gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
if (mask_gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||||
glDeleteTextures (1, &mask_gl_tex);
|
glDeleteTextures (1, &mask_gl_tex);
|
||||||
|
#endif
|
||||||
|
|
||||||
cogl_handle_unref (priv->mask_texture);
|
cogl_handle_unref (priv->mask_texture);
|
||||||
priv->mask_texture = COGL_INVALID_HANDLE;
|
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);
|
cogl_texture_get_gl_texture (paint_tex, NULL, &paint_gl_target);
|
||||||
|
|
||||||
|
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||||
if (paint_gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
if (paint_gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||||
{
|
{
|
||||||
GLuint tex;
|
GLuint tex;
|
||||||
@ -275,6 +278,7 @@ meta_shaped_texture_ensure_mask (MetaShapedTexture *stex)
|
|||||||
COGL_PIXEL_FORMAT_A_8);
|
COGL_PIXEL_FORMAT_A_8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||||
priv->mask_texture = cogl_texture_new_from_data (tex_width, tex_height,
|
priv->mask_texture = cogl_texture_new_from_data (tex_width, tex_height,
|
||||||
COGL_TEXTURE_NONE,
|
COGL_TEXTURE_NONE,
|
||||||
COGL_PIXEL_FORMAT_A_8,
|
COGL_PIXEL_FORMAT_A_8,
|
||||||
|
@ -97,6 +97,7 @@ meta_texture_tower_free (MetaTextureTower *tower)
|
|||||||
g_slice_free (MetaTextureTower, tower);
|
g_slice_free (MetaTextureTower, tower);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||||
static gboolean
|
static gboolean
|
||||||
texture_is_rectangle (CoglHandle texture)
|
texture_is_rectangle (CoglHandle texture)
|
||||||
{
|
{
|
||||||
@ -106,10 +107,12 @@ texture_is_rectangle (CoglHandle texture)
|
|||||||
cogl_texture_get_gl_texture (texture, &gl_tex, &gl_target);
|
cogl_texture_get_gl_texture (texture, &gl_tex, &gl_target);
|
||||||
return gl_target == GL_TEXTURE_RECTANGLE_ARB;
|
return gl_target == GL_TEXTURE_RECTANGLE_ARB;
|
||||||
}
|
}
|
||||||
|
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
free_texture (CoglHandle texture)
|
free_texture (CoglHandle texture)
|
||||||
{
|
{
|
||||||
|
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||||
GLuint gl_tex;
|
GLuint gl_tex;
|
||||||
GLenum gl_target;
|
GLenum gl_target;
|
||||||
|
|
||||||
@ -117,6 +120,7 @@ free_texture (CoglHandle texture)
|
|||||||
|
|
||||||
if (gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
if (gl_target == GL_TEXTURE_RECTANGLE_ARB)
|
||||||
glDeleteTextures (1, &gl_tex);
|
glDeleteTextures (1, &gl_tex);
|
||||||
|
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||||
|
|
||||||
cogl_handle_unref (texture);
|
cogl_handle_unref (texture);
|
||||||
}
|
}
|
||||||
@ -362,11 +366,13 @@ get_paint_level (int width, int height)
|
|||||||
return (int)(0.5 + lambda);
|
return (int)(0.5 + lambda);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||||
static gboolean
|
static gboolean
|
||||||
is_power_of_two (int x)
|
is_power_of_two (int x)
|
||||||
{
|
{
|
||||||
return (x & (x - 1)) == 0;
|
return (x & (x - 1)) == 0;
|
||||||
}
|
}
|
||||||
|
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
texture_tower_create_texture (MetaTextureTower *tower,
|
texture_tower_create_texture (MetaTextureTower *tower,
|
||||||
@ -374,6 +380,7 @@ texture_tower_create_texture (MetaTextureTower *tower,
|
|||||||
int width,
|
int width,
|
||||||
int height)
|
int height)
|
||||||
{
|
{
|
||||||
|
#ifdef GL_TEXTURE_RECTANGLE_ARB
|
||||||
if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
|
if ((!is_power_of_two (width) || !is_power_of_two (height)) &&
|
||||||
texture_is_rectangle (tower->textures[level - 1]))
|
texture_is_rectangle (tower->textures[level - 1]))
|
||||||
{
|
{
|
||||||
@ -396,6 +403,7 @@ texture_tower_create_texture (MetaTextureTower *tower,
|
|||||||
TEXTURE_FORMAT);
|
TEXTURE_FORMAT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif /* GL_TEXTURE_RECTANGLE_ARB */
|
||||||
{
|
{
|
||||||
tower->textures[level] = cogl_texture_new_with_size (width, height,
|
tower->textures[level] = cogl_texture_new_with_size (width, height,
|
||||||
COGL_TEXTURE_NO_AUTO_MIPMAP,
|
COGL_TEXTURE_NO_AUTO_MIPMAP,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#define _ISOC99_SOURCE /* for roundf */
|
#define _ISOC99_SOURCE /* for roundf */
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
@ -1823,9 +1825,11 @@ check_needs_pixmap (MetaWindowActor *self)
|
|||||||
* do it here.
|
* do it here.
|
||||||
* See: http://bugzilla.clutter-project.org/show_bug.cgi?id=2236
|
* 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 (
|
if (G_UNLIKELY (!clutter_glx_texture_pixmap_using_extension (
|
||||||
CLUTTER_GLX_TEXTURE_PIXMAP (priv->actor))))
|
CLUTTER_GLX_TEXTURE_PIXMAP (priv->actor))))
|
||||||
g_warning ("NOTE: Not using GLX TFP!\n");
|
g_warning ("NOTE: Not using GLX TFP!\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
g_object_get (priv->actor,
|
g_object_get (priv->actor,
|
||||||
"pixmap-width", &pxm_width,
|
"pixmap-width", &pxm_width,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user