mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
cogl: NPOT textures are always available
https://gitlab.gnome.org/GNOME/mutter/merge_requests/546
This commit is contained in:
@ -67,11 +67,6 @@ meta_create_texture_pipeline (CoglTexture *src_texture)
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
static gboolean is_pot(int x)
|
||||
{
|
||||
return x > 0 && (x & (x - 1)) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_create_texture:
|
||||
* @width: width of the texture to create
|
||||
@ -108,16 +103,6 @@ meta_create_texture (int width,
|
||||
|
||||
gboolean should_use_rectangle = FALSE;
|
||||
|
||||
if (!(is_pot (width) && is_pot (height)) &&
|
||||
!cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_NPOT))
|
||||
{
|
||||
if (cogl_has_feature (ctx, COGL_FEATURE_ID_TEXTURE_RECTANGLE))
|
||||
should_use_rectangle = TRUE;
|
||||
else
|
||||
g_error ("Cannot create texture. Support for GL_ARB_texture_non_power_of_two or "
|
||||
"ARB_texture_rectangle is required");
|
||||
}
|
||||
|
||||
if (should_use_rectangle)
|
||||
texture = COGL_TEXTURE (cogl_texture_rectangle_new_with_size (ctx, width, height));
|
||||
else
|
||||
|
Reference in New Issue
Block a user