#include <Ecore_Evas.h>
#include <Ecore_X.h>
-#include <Evas_Engine_GL_X11.h>
#include <FBaseSysLog.h>
#include <FGrpBitmap.h>
void _UnregisterRenderCallback(Evas_Object* pObject);
int __registerCallbackCount = 0;
_SglInfo* __pPreviousSglInfo = null;
+EGLSurface __pPreviousMakeCurrent = EGL_NO_SURFACE;
#endif
#if !defined (_OSP_EMUL_)
EGLSurface readSurface = _SglGetCurrentSurface(EGL_READ);
EGLSurface eglContext = eglGetCurrentContext();
+ if (__pPreviousMakeCurrent == drawSurface)
+ {
+ __pPreviousMakeCurrent = EGL_NO_SURFACE;
+ }
+
if (drawSurface != EGL_NO_SURFACE && readSurface != EGL_NO_SURFACE)
{
needSglMakeCurrent = true;
pSglInfo->isBackbuffer = true;
pSglInfo->wasShown = false;
pSglInfo->swapDone = false;
- pSglInfo->isFirstSwap = true;
+ pSglInfo->isFirstSwap = true;
if (__isDoublePixmapEnabled)
{
pSglInfoSecond->wasShown = false;
pSglInfoSecond->swapDone = true;
- pSglInfo->isFirstSwap = true;
+ pSglInfo->isFirstSwap = true;
_EvasObjectImageChange(pSglInfoSecond);
}
return;
}
- Evas_Engine_Info_GL_X11* pEvasInfo = (Evas_Engine_Info_GL_X11*)evas_engine_info_get(pEvas);
- if (pEvasInfo == null)
- {
- SysLog(NID_GRP, "Getting evas engine info failed!");
- return;
- }
-
Evas_Native_Surface nativeSurface = {0, };
nativeSurface.type = EVAS_NATIVE_SURFACE_X11;
nativeSurface.version = EVAS_NATIVE_SURFACE_VERSION;
nativeSurface.data.x11.pixmap = (unsigned long)pSglInfo->nativePixmap;
- nativeSurface.data.x11.visual = pEvasInfo->info.visual;
+ nativeSurface.data.x11.visual = ecore_x_default_visual_get(ecore_x_display_get(), ecore_x_default_screen_get());
evas_object_image_native_surface_set(pSglInfo->pObject, &nativeSurface);
}
else
EGLBoolean
_SglDestroySurface(EGLDisplay dpy, EGLSurface surface)
{
+ if (__pPreviousMakeCurrent == surface)
+ {
+ __pPreviousMakeCurrent = EGL_NO_SURFACE;
+ }
+
EGLBoolean ret = EGL_FALSE;
_SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance();
EGLBoolean
_SglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
{
+ if (__pPreviousMakeCurrent == draw)
+ {
+ return EGL_TRUE;
+ }
+ __pPreviousMakeCurrent = draw;
+
_SglInfoTableManipulator* pSglInfoTableManipulatorInstance = _SglInfoTableManipulator::GetInstance();
_SglIndex sglIndexDraw = (_SglIndex)draw;
}
sglInfoReadSurface = sglInfoRead->surface;
- if (__isDoublePixmapEnabled && !sglInfoRead->isBackbuffer)
+ if (__isDoublePixmapEnabled && !sglInfoRead->isBackbuffer && sglInfoRead->pSecondSglInfo != null)
{
sglInfoReadSurface = sglInfoRead->pSecondSglInfo->surface;
}