summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung W. Park <dunamis.park@samsung.com>2013-09-10 13:53:56 +0900
committerSung W. Park <dunamis.park@samsung.com>2013-09-10 13:53:56 +0900
commit4ece1a1f9f0f58235fb92ed8cfb0bafe5ee6ef45 (patch)
tree4f7ce89e925cb0e4df922f14ce90b73e1fe96149
parent5c82716fe899417902e17d0d26b7d467df186cbe (diff)
EvasGL: Fix surface destroy mismatch bug.
For EvasGL direct rendering, EvasGL does a make_current to the surface that evas is holding on to. When EvasGL was shutting down it was wrongly deleting evas' surface. This issue was temporarily fixed by Raphael before but the proper fix was added.
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.c22
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core_private.h1
2 files changed, 10 insertions, 13 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c
index 847654191e..5ae7a9e28d 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -43,12 +43,7 @@ _internal_resources_create(void *eng_data)
43 return NULL; 43 return NULL;
44 } 44 }
45 45
46 /*
47 // Create resource surface 46 // Create resource surface
48 // Use Evas' surface if it's in the same thread
49 if (rsc->id == evgl_engine->main_tid)
50 rsc->surface = evgl_engine->funcs->evas_surface_get(evgl_engine->engine_data);
51 */
52 rsc->window = evgl_engine->funcs->native_window_create(eng_data); 47 rsc->window = evgl_engine->funcs->native_window_create(eng_data);
53 if (!rsc->window) 48 if (!rsc->window)
54 { 49 {
@@ -63,12 +58,6 @@ _internal_resources_create(void *eng_data)
63 goto error; 58 goto error;
64 } 59 }
65 60
66 if (!rsc->surface)
67 {
68 ERR("Internal resource surface failed.");
69 goto error;
70 }
71
72 // Create a resource context 61 // Create a resource context
73 rsc->context = evgl_engine->funcs->context_create(eng_data, NULL); 62 rsc->context = evgl_engine->funcs->context_create(eng_data, NULL);
74 if (!rsc->context) 63 if (!rsc->context)
@@ -90,7 +79,7 @@ _internal_resources_destroy(void *eng_data, EVGL_Resource *rsc)
90 if ((!eng_data) || (!rsc)) return; 79 if ((!eng_data) || (!rsc)) return;
91 80
92 if (rsc->context) 81 if (rsc->context)
93 evgl_engine->funcs->context_destroy(eng_data, rsc->context); 82 evgl_engine->funcs->context_destroy(eng_data, rsc->context);
94 if (rsc->surface) 83 if (rsc->surface)
95 evgl_engine->funcs->surface_destroy(eng_data, rsc->surface); 84 evgl_engine->funcs->surface_destroy(eng_data, rsc->surface);
96 if (rsc->window) 85 if (rsc->window)
@@ -123,7 +112,14 @@ _internal_resource_make_current(void *eng_data, EVGL_Context *ctx)
123 else 112 else
124 context = (void*)rsc->context; 113 context = (void*)rsc->context;
125 114
126 surface = (void*)rsc->surface; 115 // Set the surface to evas surface if it's there
116 if (rsc->id == evgl_engine->main_tid)
117 rsc->direct_surface = evgl_engine->funcs->evas_surface_get(eng_data);
118
119 if (rsc->direct_surface)
120 surface = (void*)rsc->direct_surface;
121 else
122 surface = (void*)rsc->surface;
127 123
128 // Do the make current 124 // Do the make current
129 ret = evgl_engine->funcs->make_current(eng_data, surface, context, 1); 125 ret = evgl_engine->funcs->make_current(eng_data, surface, context, 1);
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core_private.h b/src/modules/evas/engines/gl_common/evas_gl_core_private.h
index fe296aee6d..5c617b6c69 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core_private.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_core_private.h
@@ -209,6 +209,7 @@ struct _EVGL_Resource
209 EVGL_Context *current_ctx; 209 EVGL_Context *current_ctx;
210 void *current_eng; 210 void *current_eng;
211 211
212 EVGLNative_Surface direct_surface;
212 int direct_rendered; 213 int direct_rendered;
213 Evas_Object *direct_img_obj; 214 Evas_Object *direct_img_obj;
214 int get_pixels_set; 215 int get_pixels_set;