shaped-texture: Clean-up deprecated NPOT check

There are most likely no GNOME users left still using hardware that
does not support NPOT textures. Further more, they would crash much
earlier and never hit this code-path. So remove the unnecessary check
here.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/447
This commit is contained in:
Robert Mader 2019-02-16 13:41:30 +01:00
parent ddd2ce3a88
commit 803ffc19a4

View File

@ -1278,22 +1278,10 @@ get_image_via_offscreen (MetaShapedTexture *stex,
CoglOffscreen *offscreen;
CoglFramebuffer *fb;
CoglMatrix projection_matrix;
int fb_width, fb_height;
cairo_rectangle_int_t fallback_clip;
CoglColor clear_color;
cairo_surface_t *surface;
if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_TEXTURE_NPOT))
{
fb_width = stex->dst_width;
fb_height = stex->dst_height;
}
else
{
fb_width = _cogl_util_next_p2 (stex->dst_width);
fb_height = _cogl_util_next_p2 (stex->dst_height);
}
if (!clip)
{
fallback_clip = (cairo_rectangle_int_t) {
@ -1305,7 +1293,8 @@ get_image_via_offscreen (MetaShapedTexture *stex,
image_texture =
COGL_TEXTURE (cogl_texture_2d_new_with_size (cogl_context,
fb_width, fb_height));
stex->dst_width,
stex->dst_height));
cogl_primitive_texture_set_auto_mipmap (COGL_PRIMITIVE_TEXTURE (image_texture),
FALSE);
if (!cogl_texture_allocate (COGL_TEXTURE (image_texture), &error))
@ -1315,18 +1304,6 @@ get_image_via_offscreen (MetaShapedTexture *stex,
return FALSE;
}
if (fb_width != stex->dst_width || fb_height != stex->dst_height)
{
CoglSubTexture *sub_texture;
sub_texture = cogl_sub_texture_new (cogl_context,
image_texture,
0, 0,
stex->dst_width, stex->dst_height);
cogl_object_unref (image_texture);
image_texture = COGL_TEXTURE (sub_texture);
}
offscreen = cogl_offscreen_new_with_texture (COGL_TEXTURE (image_texture));
fb = COGL_FRAMEBUFFER (offscreen);
cogl_object_unref (image_texture);