diff --git a/gsk/gpu/gskgpuclip.c b/gsk/gpu/gskgpuclip.c index 05af08c615..da297969f7 100644 --- a/gsk/gpu/gskgpuclip.c +++ b/gsk/gpu/gskgpuclip.c @@ -30,6 +30,14 @@ gsk_gpu_clip_init_rect (GskGpuClip *clip, gsk_rounded_rect_init_from_rect (&clip->rect, rect, 0); } +static void +gsk_gpu_clip_init_rounded_rect (GskGpuClip *self, + const GskRoundedRect *rect) +{ + self->type = GSK_GPU_CLIP_ROUNDED; + gsk_rounded_rect_init_copy (&self->rect, rect); +} + void gsk_gpu_clip_init_copy (GskGpuClip *self, const GskGpuClip *src) @@ -129,6 +137,13 @@ gsk_gpu_clip_intersect_rounded_rect (GskGpuClip *dest, break; case GSK_GPU_CLIP_NONE: + res = gsk_rounded_rect_intersect_with_rect (rounded, &src->rect.bounds, &dest->rect); + if (gsk_gpu_clip_init_after_intersection (dest, res)) + break; + /* XXX: This may grow the bounds quite substantially */ + gsk_gpu_clip_init_rounded_rect (dest, rounded); + break; + case GSK_GPU_CLIP_CONTAINED: case GSK_GPU_CLIP_RECT: res = gsk_rounded_rect_intersect_with_rect (rounded, &src->rect.bounds, &dest->rect); diff --git a/gsk/gpu/gskgpuclipprivate.h b/gsk/gpu/gskgpuclipprivate.h index 70d5525f40..a83957c1a0 100644 --- a/gsk/gpu/gskgpuclipprivate.h +++ b/gsk/gpu/gskgpuclipprivate.h @@ -16,6 +16,7 @@ typedef enum { GSK_GPU_CLIP_ALL_CLIPPED, /* No clipping is necessary, but the clip rect is set * to the actual bounds of the underlying framebuffer + * or handled via the scissor. */ GSK_GPU_CLIP_NONE, /* The clip exists outside the rect, so clipping must diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 4c28f33af6..f4b6161fc9 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -184,13 +184,13 @@ gsk_gpu_node_processor_init (GskGpuNodeProcessor *self, { float scale_x = viewport->size.width / width; float scale_y = viewport->size.height / height; - gsk_gpu_clip_init_rect (&self->clip, - &GRAPHENE_RECT_INIT ( - scale_x * clip->x, - scale_y * clip->y, - scale_x * clip->width, - scale_y * clip->height - )); + gsk_gpu_clip_init_empty (&self->clip, + &GRAPHENE_RECT_INIT ( + scale_x * clip->x, + scale_y * clip->y, + scale_x * clip->width, + scale_y * clip->height + )); } self->modelview = NULL; @@ -1328,7 +1328,7 @@ gsk_gpu_node_processor_add_node_clipped (GskGpuNodeProcessor *self, gsk_gpu_clip_init_copy (&self->clip, &old_clip); return; } - else if (self->clip.type == GSK_GPU_CLIP_RECT && + else if ((self->clip.type == GSK_GPU_CLIP_RECT || self->clip.type == GSK_GPU_CLIP_CONTAINED) && gsk_rect_contains_rect (&self->clip.rect.bounds, &clip)) { self->clip.type = GSK_GPU_CLIP_NONE; diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c index 0b66aacc75..d2641161cb 100644 --- a/gsk/gskrendernodeparser.c +++ b/gsk/gskrendernodeparser.c @@ -4466,6 +4466,8 @@ render_node_print (Printer *p, start_node (p, "subsurface", node_name); append_node_param (p, "child", gsk_subsurface_node_get_child (node)); + + end_node (p); } break; diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index bf2af382ba..971c87063a 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -224,6 +224,7 @@ compare_xfails = { 'radial-gradient-with-64-colorstops': ['clipped', 'colorflipped'], 'conic-gradient-with-64-colorstops': ['clipped', 'colorflipped'], 'blur-child-bounds-oversize-nogl': ['clipped'], # 6450 + 'rounded-clip-with-huge-bounds-nogl': ['plain','flipped','rotated','repeated','masked','replayed','clipped','colorflipped'], # 6532 }, 'vulkan': { 'radial-gradient-with-64-colorstops': ['clipped', 'colorflipped'], @@ -231,6 +232,7 @@ compare_xfails = { 'blur-child-bounds-oversize-nogl': ['clipped'], # 6450 'repeat-repeats-nested-nogl': ['clipped'], # 6522 'repeating-radial-gradient-edge-colors': ['colorflipped'], + 'rounded-clip-with-huge-bounds-nogl': ['plain','flipped','rotated','repeated','masked','replayed','clipped','colorflipped'], # 6532 }, 'gl': { # 6525 @@ -359,6 +361,8 @@ node_parser_tests = [ 'empty-shadow.ref.node', 'empty-stroke.node', 'empty-stroke.ref.node', + 'empty-subsurface.node', + 'empty-subsurface.ref.node', 'empty-text.node', 'empty-text.ref.node', 'empty-texture.node', diff --git a/testsuite/gsk/nodeparser/empty-subsurface.node b/testsuite/gsk/nodeparser/empty-subsurface.node new file mode 100644 index 0000000000..cfc44b45f5 --- /dev/null +++ b/testsuite/gsk/nodeparser/empty-subsurface.node @@ -0,0 +1,2 @@ +subsurface { +} diff --git a/testsuite/gsk/nodeparser/empty-subsurface.ref.node b/testsuite/gsk/nodeparser/empty-subsurface.ref.node new file mode 100644 index 0000000000..137c66600f --- /dev/null +++ b/testsuite/gsk/nodeparser/empty-subsurface.ref.node @@ -0,0 +1,6 @@ +subsurface { + child: color { + bounds: 0 0 50 50; + color: rgb(255,0,204); + } +}