From ca78f5d3cbdd9478ef1206b2c7f1c9472e28796d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 1 Dec 2016 01:38:20 +0100 Subject: gdk: Make gdk_window_begin_draw_frame() take a draw context ... instead of a gl context. This requires some refactoring in the way we mark the shared context as drawing: We now call begin_frame/end_frame() on it and ignore the call on the main context. Unfortunately we need to do this check in all vfuncs, which sucks. But I haven't found a better way. --- gsk/gskglrenderer.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'gsk/gskglrenderer.c') diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c index e021b358fa..5d0bb12c63 100644 --- a/gsk/gskglrenderer.c +++ b/gsk/gskglrenderer.c @@ -292,8 +292,6 @@ gsk_gl_renderer_realize (GskRenderer *renderer, if (!gsk_gl_renderer_create_programs (self, error)) return FALSE; - gsk_renderer_set_gl_context (renderer, self->gl_context); - return TRUE; } @@ -320,8 +318,6 @@ gsk_gl_renderer_unrealize (GskRenderer *renderer) if (self->gl_context == gdk_gl_context_get_current ()) gdk_gl_context_clear_current (); - - gsk_renderer_set_gl_context (renderer, NULL); } static GdkDrawingContext * @@ -341,9 +337,9 @@ gsk_gl_renderer_begin_draw_frame (GskRenderer *renderer, gdk_window_get_height (window) }); - result = gdk_window_begin_draw_frame (window, - self->gl_context, - region); + return gdk_window_begin_draw_frame (window, + GDK_DRAW_CONTEXT (self->gl_context), + region); cairo_region_destroy (whole_window); -- cgit v1.2.1