rendernode: Bail if matrix is invalid
Invalid matrices are okay in GSK (and GL), but not in Cairo. Testcase included.
This commit is contained in:
@@ -2755,6 +2755,16 @@ gsk_transform_node_draw (GskRenderNode *node,
|
||||
ctm.xx, ctm.yx,
|
||||
ctm.xy, ctm.yy,
|
||||
ctm.x0, ctm.y0));
|
||||
if (xx * yy == xy * yx)
|
||||
{
|
||||
/* broken matrix here. This can happen during transitions
|
||||
* (like when flipping an axis at the point where scale == 0)
|
||||
* and just means that nothing should be drawn.
|
||||
* But Cairo thows lots of ugly errors instead of silently
|
||||
* going on. So We silently go on.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
cairo_transform (cr, &ctm);
|
||||
|
||||
gsk_render_node_draw (self->child, cr);
|
||||
|
||||
16
testsuite/gsk/compare/invalid-transform.node
Normal file
16
testsuite/gsk/compare/invalid-transform.node
Normal file
@@ -0,0 +1,16 @@
|
||||
transform {
|
||||
/* break the transform on purpose, because
|
||||
this is valid in GSK and should result
|
||||
in nothing being drawn. */
|
||||
transform: scale(0);
|
||||
child: color {
|
||||
color: red;
|
||||
bounds: 0 0 100 100;
|
||||
}
|
||||
}
|
||||
|
||||
/* make sure the rendering has a size */
|
||||
color {
|
||||
color: transparent;
|
||||
bounds: 0 0 1 1;
|
||||
}
|
||||
BIN
testsuite/gsk/compare/invalid-transform.png
Normal file
BIN
testsuite/gsk/compare/invalid-transform.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 86 B |
@@ -48,6 +48,7 @@ compare_render_tests = [
|
||||
'empty-shadow',
|
||||
'empty-texture',
|
||||
'empty-transform',
|
||||
'invalid-transform',
|
||||
'opacity_clip',
|
||||
'outset_shadow_offset_both',
|
||||
'outset_shadow_offset_x',
|
||||
|
||||
Reference in New Issue
Block a user