From: Matthias Clasen Date: Wed, 15 Mar 2023 19:33:32 +0000 (-0400) Subject: gsk: Fix handling of large textures X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~547^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2e2c41cef60112140533d9bf61fd56ce04ca50a0;p=gtk4.git gsk: Fix handling of large textures When the texture is too large, actually shrink the size to max_texture_size. --- diff --git a/gsk/gl/gskglcommandqueue.c b/gsk/gl/gskglcommandqueue.c index 30617898e8..39917877ad 100644 --- a/gsk/gl/gskglcommandqueue.c +++ b/gsk/gl/gskglcommandqueue.c @@ -1469,8 +1469,8 @@ gsk_gl_command_queue_upload_texture (GskGLCommandQueue *self, g_warning ("Attempt to create texture of size %ux%u but max size is %d. " "Clipping will occur.", width, height, self->max_texture_size); - width = MAX (width, self->max_texture_size); - height = MAX (height, self->max_texture_size); + width = MIN (width, self->max_texture_size); + height = MIN (height, self->max_texture_size); } texture_id = gsk_gl_command_queue_create_texture (self, width, height, GL_RGBA8, min_filter, mag_filter); if (texture_id == -1)