[libhandy] shadow-helper: Use OVER operator instead of ATOP
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] shadow-helper: Use OVER operator instead of ATOP
- Date: Thu, 25 Jun 2020 14:28:56 +0000 (UTC)
commit f9b84e51890f8aaa5bd13e24f07ea897884da6df
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Thu Jun 25 18:41:26 2020 +0500
shadow-helper: Use OVER operator instead of ATOP
Since GTK draws cairo content in an offscreen surface when it's to be
overlaid onto OpenGL content, and that surface has alpha channel is empty
at first, using ATOP here results in nothing being drawn. So here we have
to finally stop doing that and use plain OVER. While it results in a subtle
glitch with window corners in case of GtkWindow, we have a solution for
that now, and there's not much reason to keep using it.
Fixes https://gitlab.gnome.org/GNOME/libhandy/issues/242
Signed-off-by: Alexander Mikhaylenko <alexm gnome org>
src/hdy-shadow-helper.c | 12 ------------
1 file changed, 12 deletions(-)
---
diff --git a/src/hdy-shadow-helper.c b/src/hdy-shadow-helper.c
index 2ff12d3e..929f04a3 100644
--- a/src/hdy-shadow-helper.c
+++ b/src/hdy-shadow-helper.c
@@ -384,11 +384,8 @@ hdy_shadow_helper_draw_shadow (HdyShadowHelper *self,
cairo_clip (cr);
gdk_window_mark_paint_from_clip (gtk_widget_get_window (self->widget), cr);
- cairo_save (cr);
- cairo_set_operator (cr, CAIRO_OPERATOR_ATOP);
cairo_set_source (cr, self->dimming_pattern);
cairo_paint_with_alpha (cr, 1 - progress);
- cairo_restore (cr);
switch (direction) {
case GTK_PAN_DIRECTION_RIGHT:
@@ -404,11 +401,8 @@ hdy_shadow_helper_draw_shadow (HdyShadowHelper *self,
g_assert_not_reached ();
}
- cairo_save (cr);
- cairo_set_operator (cr, CAIRO_OPERATOR_ATOP);
cairo_set_source (cr, self->shadow_pattern);
cairo_paint_with_alpha (cr, shadow_opacity);
- cairo_restore (cr);
switch (direction) {
case GTK_PAN_DIRECTION_RIGHT:
@@ -424,11 +418,8 @@ hdy_shadow_helper_draw_shadow (HdyShadowHelper *self,
g_assert_not_reached ();
}
- cairo_save (cr);
- cairo_set_operator (cr, CAIRO_OPERATOR_ATOP);
cairo_set_source (cr, self->border_pattern);
cairo_paint (cr);
- cairo_restore (cr);
switch (direction) {
case GTK_PAN_DIRECTION_RIGHT:
@@ -447,11 +438,8 @@ hdy_shadow_helper_draw_shadow (HdyShadowHelper *self,
g_assert_not_reached ();
}
- cairo_save (cr);
- cairo_set_operator (cr, CAIRO_OPERATOR_ATOP);
cairo_set_source (cr, self->outline_pattern);
cairo_paint (cr);
- cairo_restore (cr);
cairo_restore (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]