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