diff options
author | Christian Hergert <chergert@redhat.com> | 2020-11-17 18:20:55 -0800 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2020-11-17 18:20:55 -0800 |
commit | dd7f52c59a956db3c87d1929cb37a6d799c5973b (patch) | |
tree | 27482b1b1fe14632790fe34add2d376db35184ad | |
parent | 3003f37e9de90ba17d9be9710d69fdfde931a994 (diff) | |
download | gtk+-dd7f52c59a956db3c87d1929cb37a6d799c5973b.tar.gz |
macos: fix rendering artifacts with hover transitions
Using an image surface seems to fix some rendering artifacts when
performing cross-fade CSS transitions.
-rw-r--r-- | gdk/macos/gdkmacoscairocontext.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdk/macos/gdkmacoscairocontext.c b/gdk/macos/gdkmacoscairocontext.c index e70d2bf00f..d33f195e5c 100644 --- a/gdk/macos/gdkmacoscairocontext.c +++ b/gdk/macos/gdkmacoscairocontext.c @@ -23,7 +23,6 @@ #include "gdkconfig.h" #include <CoreGraphics/CoreGraphics.h> -#include <cairo-quartz.h> #import "GdkMacosCairoView.h" @@ -58,7 +57,12 @@ create_cairo_surface_for_surface (GdkSurface *surface) width = scale * gdk_surface_get_width (surface); height = scale * gdk_surface_get_height (surface); - cairo_surface = cairo_quartz_surface_create (CAIRO_FORMAT_ARGB32, width, height); + /* We use a cairo image surface here instead of a quartz surface because we + * get strange artifacts with the quartz surface such as empty cross-fades + * when hovering buttons. For performance, we want to be using GL rendering + * so there isn't much point here as correctness is better. + */ + cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); if (cairo_surface != NULL) cairo_surface_set_device_scale (cairo_surface, scale, scale); |