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