mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
Merge branch 'fix-neg-scales-4.2' into 'gtk-4-2'
ngl: Handle negative scales See merge request GNOME/gtk!3760
This commit is contained in:
commit
8251e40809
@ -3573,19 +3573,23 @@ gsk_ngl_render_job_visit_node_with_offscreen (GskNglRenderJob *job,
|
||||
{
|
||||
int max_texture_size = job->command_queue->max_texture_size;
|
||||
|
||||
scaled_width = ceilf (offscreen->bounds->size.width * job->scale_x);
|
||||
scaled_width = ceilf (offscreen->bounds->size.width * fabs (job->scale_x));
|
||||
if (scaled_width > max_texture_size)
|
||||
{
|
||||
downscale_x = (float)max_texture_size / scaled_width;
|
||||
scaled_width = max_texture_size;
|
||||
}
|
||||
if (job->scale_x < 0)
|
||||
downscale_x = -downscale_x;
|
||||
|
||||
scaled_height = ceilf (offscreen->bounds->size.height * job->scale_y);
|
||||
scaled_height = ceilf (offscreen->bounds->size.height * fabs (job->scale_y));
|
||||
if (scaled_height > max_texture_size)
|
||||
{
|
||||
downscale_y = (float)max_texture_size / scaled_height;
|
||||
scaled_height = max_texture_size;
|
||||
}
|
||||
if (job->scale_y < 0)
|
||||
downscale_y = -downscale_y;
|
||||
}
|
||||
|
||||
GskNglRenderTarget *render_target;
|
||||
|
48
testsuite/gsk/compare/scale-textures-negative-ngl.node
Normal file
48
testsuite/gsk/compare/scale-textures-negative-ngl.node
Normal file
@ -0,0 +1,48 @@
|
||||
transform {
|
||||
transform: scale(1, 1);
|
||||
child: opacity {
|
||||
opacity: 0.6;
|
||||
child: container {
|
||||
texture {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:,<svg width='50' height='50'><rect x='25' y='25' width='25' height='25' fill='red'/></svg>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
transform {
|
||||
transform: scale(1, -1);
|
||||
child: opacity {
|
||||
opacity: 0.6;
|
||||
child: container {
|
||||
texture {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:,<svg width='50' height='50'><rect x='25' y='25' width='25' height='25' fill='lime'/></svg>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
transform {
|
||||
transform: scale(-1, -1);
|
||||
child: opacity {
|
||||
opacity: 0.6;
|
||||
child: container {
|
||||
texture {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:,<svg width='50' height='50'><rect x='25' y='25' width='25' height='25' fill='blue'/></svg>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
transform {
|
||||
transform: scale(-1, 1);
|
||||
child: opacity {
|
||||
opacity: 0.6;
|
||||
child: container {
|
||||
texture {
|
||||
bounds: 0 0 50 50;
|
||||
texture: url("data:,<svg width='50' height='50'><rect x='25' y='25' width='25' height='25' fill='yellow'/></svg>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
testsuite/gsk/compare/scale-textures-negative-ngl.png
Normal file
BIN
testsuite/gsk/compare/scale-textures-negative-ngl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 265 B |
@ -56,6 +56,7 @@ compare_render_tests = [
|
||||
'outset_shadow_rounded_top',
|
||||
'outset_shadow_simple',
|
||||
'scaled-cairo',
|
||||
'scale-textures-negative-ngl',
|
||||
'shadow-in-opacity',
|
||||
'texture-url',
|
||||
'color-matrix-identity',
|
||||
|
Loading…
Reference in New Issue
Block a user