sung pushed a commit to branch master.
commit 4ece1a1f9f0f58235fb92ed8cfb0bafe5ee6ef45
Author: Sung W. Park <[email protected]>
Date: Tue Sep 10 13:53:56 2013 +0900
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.
---
src/modules/evas/engines/gl_common/evas_gl_core.c | 22 +++++++++-------------
.../evas/engines/gl_common/evas_gl_core_private.h | 1 +
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 8476541..5ae7a9e 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)
return NULL;
}
- /*
// Create resource surface
- // Use Evas' surface if it's in the same thread
- if (rsc->id == evgl_engine->main_tid)
- rsc->surface =
evgl_engine->funcs->evas_surface_get(evgl_engine->engine_data);
- */
rsc->window = evgl_engine->funcs->native_window_create(eng_data);
if (!rsc->window)
{
@@ -63,12 +58,6 @@ _internal_resources_create(void *eng_data)
goto error;
}
- if (!rsc->surface)
- {
- ERR("Internal resource surface failed.");
- goto error;
- }
-
// Create a resource context
rsc->context = evgl_engine->funcs->context_create(eng_data, NULL);
if (!rsc->context)
@@ -90,7 +79,7 @@ _internal_resources_destroy(void *eng_data, EVGL_Resource
*rsc)
if ((!eng_data) || (!rsc)) return;
if (rsc->context)
- evgl_engine->funcs->context_destroy(eng_data, rsc->context);
+ evgl_engine->funcs->context_destroy(eng_data, rsc->context);
if (rsc->surface)
evgl_engine->funcs->surface_destroy(eng_data, rsc->surface);
if (rsc->window)
@@ -123,7 +112,14 @@ _internal_resource_make_current(void *eng_data,
EVGL_Context *ctx)
else
context = (void*)rsc->context;
- surface = (void*)rsc->surface;
+ // Set the surface to evas surface if it's there
+ if (rsc->id == evgl_engine->main_tid)
+ rsc->direct_surface = evgl_engine->funcs->evas_surface_get(eng_data);
+
+ if (rsc->direct_surface)
+ surface = (void*)rsc->direct_surface;
+ else
+ surface = (void*)rsc->surface;
// Do the make current
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 fe296ae..5c617b6 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
EVGL_Context *current_ctx;
void *current_eng;
+ EVGLNative_Surface direct_surface;
int direct_rendered;
Evas_Object *direct_img_obj;
int get_pixels_set;
--
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk