1From 7c64ef8281b59fc5e1f6f2afc01ce3679af6c061 Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Mon, 28 Mar 2022 18:29:24 +0800
4Subject: [PATCH 6/6] HACK: gdk: gdkgl: Avoid using shared contexts
5
6Some GL implementations don't support sharing framebuffers in shared
7GL contexts, for example Mali DDK.
8
9Let's avoid switching GL context here to make sure of generating
10framebuffer in the common GL context.
11
12Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
13---
14 gdk/gdkgl.c | 8 +++++++-
15 1 file changed, 7 insertions(+), 1 deletion(-)
16
17diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
18index 9690077..c0b5bb3 100644
19--- a/gdk/gdkgl.c
20+++ b/gdk/gdkgl.c
21@@ -366,7 +366,13 @@ gdk_cairo_draw_from_gl (cairo_t              *cr,
22
23   clip_region = gdk_cairo_region_from_clip (cr);
24
25-  gdk_gl_context_make_current (paint_context);
26+  /**
27+   * HACK: Some GL implementations don't support sharing framebuffers in shared
28+   * GL contexts, for example Mali DDK.
29+   * Let's avoid switching GL context here to make sure of generating
30+   * framebuffer in the common GL context.
31+   */
32+  // gdk_gl_context_make_current (paint_context);
33   paint_data = gdk_gl_context_get_paint_data (paint_context);
34
35   if (paint_data->tmp_framebuffer == 0)
36--
372.20.1
38
39