diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 03308e1500..5c3125a2a4 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -2077,6 +2077,8 @@ gsk_gpu_node_processor_add_texture_scale_node (GskGpuNodeProcessor *self, /* now intersect with actual node bounds */ if (!gsk_rect_intersection (&clip_bounds, &node->bounds, &clip_bounds)) return; + clip_bounds.size.width = ceilf (clip_bounds.size.width); + clip_bounds.size.height = ceilf (clip_bounds.size.height); offscreen = gsk_gpu_node_processor_create_offscreen (self->frame, graphene_vec2_one (), &clip_bounds, diff --git a/testsuite/gsk/compare/texture-scale-nearest-noninteger-scaled-nogl.node b/testsuite/gsk/compare/texture-scale-nearest-noninteger-scaled-nogl.node new file mode 100644 index 0000000000..6516dad845 --- /dev/null +++ b/testsuite/gsk/compare/texture-scale-nearest-noninteger-scaled-nogl.node @@ -0,0 +1,14 @@ +color { + bounds: 0 0 3 2; + color: rgb(0,0,0); +} +transform { + transform: scale(2); + child: texture-scale { + bounds: 0 0 1.5 1; + filter: nearest; + texture: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQImWNoYGAAAAGEAIGs40g+\ +AAAAAElFTkSuQmCC\ +"); + } +} diff --git a/testsuite/gsk/compare/texture-scale-nearest-noninteger-scaled-nogl.png b/testsuite/gsk/compare/texture-scale-nearest-noninteger-scaled-nogl.png new file mode 100644 index 0000000000..64a761cf99 Binary files /dev/null and b/testsuite/gsk/compare/texture-scale-nearest-noninteger-scaled-nogl.png differ diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index 28ffe5c286..d8776c451a 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -171,6 +171,7 @@ compare_render_tests = [ 'texture-scale-filters-nocairo', 'texture-scale-magnify-10000x', 'texture-scale-magnify-rotate', + 'texture-scale-nearest-noninteger-scaled-nogl', 'texture-scale-nearest-vs-linear', 'texture-scale-offset', 'texture-scale-stripes',