[mutter] shaped-texture: Clean-up deprecated NPOT check
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] shaped-texture: Clean-up deprecated NPOT check
- Date: Mon, 25 Feb 2019 17:30:46 +0000 (UTC)
commit 803ffc19a489514b2416cc14c2a46e206bca2132
Author: Robert Mader <robert mader posteo de>
Date: Sat Feb 16 13:41:30 2019 +0100
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
src/compositor/meta-shaped-texture.c | 27 ++-------------------------
1 file changed, 2 insertions(+), 25 deletions(-)
---
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index b04ae89c2..3076e3501 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]