[gtk] gl renderer: Fix rounded rect intersection code
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] gl renderer: Fix rounded rect intersection code
- Date: Sun, 2 Jun 2019 06:33:56 +0000 (UTC)
commit f1996783ec89e09a7ed3b8ec7431a134b681b492
Author: Timm Bäder <mail baedert org>
Date: Sun Jun 2 08:31:44 2019 +0200
gl renderer: Fix rounded rect intersection code
Test case attached.
Fixes #1920
gsk/gl/gskglrenderer.c | 5 ++--
testsuite/gsk/compare/clip-nested1.node | 48 ++++++++++++++++++++++++++++++++
testsuite/gsk/compare/clip-nested1.png | Bin 0 -> 1583 bytes
testsuite/gsk/meson.build | 2 ++
4 files changed, 53 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 98e28a8034..c5d5918eac 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1072,13 +1072,14 @@ gsk_rounded_rect_intersection (const GskRoundedRect *outer,
gboolean contained_x;
gboolean contained_y;
- if (graphene_rect_contains_rect (outer_bounds, inner_bounds))
+ get_inner_rect (outer, &outer_inner);
+
+ if (graphene_rect_contains_rect (&outer_inner, inner_bounds))
{
*out_intersection = *inner;
return TRUE;
}
- get_inner_rect (outer, &outer_inner);
get_inner_rect (inner, &inner_inner);
contained_x = outer_inner.origin.x <= inner_inner.origin.x &&
diff --git a/testsuite/gsk/compare/clip-nested1.node b/testsuite/gsk/compare/clip-nested1.node
new file mode 100644
index 0000000000..0e269abe0a
--- /dev/null
+++ b/testsuite/gsk/compare/clip-nested1.node
@@ -0,0 +1,48 @@
+transform {
+transform: scale(8);
+child:container {
+
+rounded-clip {
+ clip: 0 0 50 50 / 30 0 0 0;
+ child: rounded-clip {
+ clip: 0 0 100 100 / 0;
+ child: color {
+ bounds: 0 0 50 50;
+ color: teal;
+ }
+ }
+}
+
+debug {
+ message: "Clipped-out area";
+ child: container {
+ color {
+ color: black;
+ bounds: 0 16 5 14;
+ }
+ color {
+ color: black;
+ bounds: 3 12 5 5;
+ }
+ color {
+ color: black;
+ bounds: 6 7 5 5;
+ }
+ color {
+ color: black;
+ bounds: 10 3 5 5;
+ }
+ color {
+ color: black;
+ bounds: 15 0 5 5;
+ }
+ color {
+ color: black;
+ bounds: 19 0 14 2;
+ }
+ }
+}
+
+
+}
+}
\ No newline at end of file
diff --git a/testsuite/gsk/compare/clip-nested1.png b/testsuite/gsk/compare/clip-nested1.png
new file mode 100644
index 0000000000..3b1e4cce6c
Binary files /dev/null and b/testsuite/gsk/compare/clip-nested1.png differ
diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build
index f2bc21b920..a8aac553d8 100644
--- a/testsuite/gsk/meson.build
+++ b/testsuite/gsk/meson.build
@@ -54,6 +54,8 @@ compare_render_tests = [
'scaled-cairo',
'shadow-in-opacity',
'texture-url',
+ 'color-matrix-identity',
+ 'clip-nested1',
]
renderers = [
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]