shaped-texture: Don't use mipmaps for small textures
Mipmapping extremely small textures is pointless. We chose a lower limit of 8 pixels in each direction. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3468>
This commit is contained in:
parent
54c5ea9c13
commit
4b8798a800
@ -640,6 +640,7 @@ do_paint_content (MetaShapedTexture *stex,
|
|||||||
MetaMultiTexture *paint_tex = stex->texture;
|
MetaMultiTexture *paint_tex = stex->texture;
|
||||||
CoglFramebuffer *framebuffer;
|
CoglFramebuffer *framebuffer;
|
||||||
int sample_width, sample_height;
|
int sample_width, sample_height;
|
||||||
|
int texture_width, texture_height;
|
||||||
gboolean debug_paint_opaque_region;
|
gboolean debug_paint_opaque_region;
|
||||||
int n_planes;
|
int n_planes;
|
||||||
|
|
||||||
@ -651,6 +652,9 @@ do_paint_content (MetaShapedTexture *stex,
|
|||||||
if (dst_width == 0 || dst_height == 0) /* no contents yet */
|
if (dst_width == 0 || dst_height == 0) /* no contents yet */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
texture_width = meta_multi_texture_get_width (stex->texture);
|
||||||
|
texture_height = meta_multi_texture_get_height (stex->texture);
|
||||||
|
|
||||||
content_rect = (MtkRectangle) {
|
content_rect = (MtkRectangle) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
@ -676,8 +680,8 @@ do_paint_content (MetaShapedTexture *stex,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sample_width = meta_multi_texture_get_width (stex->texture);
|
sample_width = texture_width;
|
||||||
sample_height = meta_multi_texture_get_height (stex->texture);
|
sample_height = texture_height;
|
||||||
}
|
}
|
||||||
if (meta_monitor_transform_is_rotated (stex->transform))
|
if (meta_monitor_transform_is_rotated (stex->transform))
|
||||||
flip_ints (&sample_width, &sample_height);
|
flip_ints (&sample_width, &sample_height);
|
||||||
@ -702,7 +706,9 @@ do_paint_content (MetaShapedTexture *stex,
|
|||||||
*/
|
*/
|
||||||
if (stex->create_mipmaps &&
|
if (stex->create_mipmaps &&
|
||||||
transforms.x_scale < 0.5 &&
|
transforms.x_scale < 0.5 &&
|
||||||
transforms.y_scale < 0.5)
|
transforms.y_scale < 0.5 &&
|
||||||
|
texture_width >= 8 &&
|
||||||
|
texture_height >= 8)
|
||||||
{
|
{
|
||||||
paint_tex = meta_texture_mipmap_get_paint_texture (stex->texture_mipmap);
|
paint_tex = meta_texture_mipmap_get_paint_texture (stex->texture_mipmap);
|
||||||
min_filter = COGL_PIPELINE_FILTER_LINEAR_MIPMAP_NEAREST;
|
min_filter = COGL_PIPELINE_FILTER_LINEAR_MIPMAP_NEAREST;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user