From: Matthias Clasen Date: Sat, 18 Mar 2023 04:10:38 +0000 (-0400) Subject: gsk: Drop texture subsetting X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~531^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d31ba5f551642a0fc7049b0d30dd118d2898b5ca;p=gtk4.git gsk: Drop texture subsetting We don't do this for unfiltered textures either, and with working slicing, it isn't needed. --- diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c index f29375fa6b..8fbc06ab35 100644 --- a/gsk/gl/gskglrenderjob.c +++ b/gsk/gl/gskglrenderjob.c @@ -3643,8 +3643,6 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob *job, guint prev_fbo; float u0, u1, v0, v1; GskTextureKey key; - GdkTexture *subtexture = NULL; - graphene_rect_t subbounds; guint texture_id; if (filter == GSK_SCALING_FILTER_LINEAR) @@ -3685,36 +3683,6 @@ gsk_gl_render_job_visit_texture_scale_node (GskGLRenderJob *job, return; } - if G_UNLIKELY (texture->width > max_texture_size || - texture->height > max_texture_size) - { - float scale_x = bounds->size.width / texture->width; - float scale_y = bounds->size.height / texture->height; - int x, y, width, height; - - x = (int) floorf ((clip_rect.origin.x - bounds->origin.x) / scale_x); - y = (int) floorf ((clip_rect.origin.y - bounds->origin.y) / scale_y); - width = (int) ceilf (clip_rect.size.width / scale_x); - height = (int) ceilf (clip_rect.size.height / scale_y); - - if (width <= max_texture_size && height <= max_texture_size) - { - GdkMemoryTexture *memtex; - - memtex = gdk_memory_texture_from_texture (texture, gdk_texture_get_format (texture)); - subtexture = gdk_memory_texture_new_subtexture (memtex, x, y, width, height); - g_object_unref (memtex); - - subbounds.origin.x = bounds->origin.x + x * scale_x; - subbounds.origin.y = bounds->origin.y + y * scale_y; - subbounds.size.width = width * scale_x; - subbounds.size.height = height * scale_y; - - texture = subtexture; - bounds = &subbounds; - } - } - gsk_gl_render_job_set_viewport (job, &viewport, &prev_viewport); gsk_gl_render_job_set_projection_from_rect (job, &viewport, &prev_projection); gsk_gl_render_job_set_modelview (job, NULL); @@ -3819,8 +3787,6 @@ render_texture: clip_rect.size.height / ceilf (clip_rect.size.height), 0, (guint16[]){ FP16_ZERO, FP16_ZERO, FP16_ZERO, FP16_ZERO } ); gsk_gl_render_job_end_draw (job); - - g_clear_object (&subtexture); } static inline void