#include <FUi_WindowImpl.h>
#include <FUiAnim_VisualElementSurfaceImpl.h>
#include <FUiAnim_VisualElementImpl.h>
-
+#include <FUiAnim_DisplayManager.h>
#ifdef __cplusplus
extern "C"
#define FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT
#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
+void _RestoreContext(void);
void _PostRenderCallback(Ecore_Evas* ee);
void _SaveCurrentContext(_SglInfo* pSglInfo);
void _UnregisterRenderCallback(Evas_Object* pObject);
if (engineName.Contains(String("opengl_x11")))
{
+ _DisplayManager* pDisplayManger = _DisplayManager::GetInstance();
+ pDisplayManger->SetRestoreContextCallback(_RestoreContext);
return ENGINE_TYPE_OPENGL_X11;
}
else
if (engineName.Contains(String("opengl_x11")))
{
+ _DisplayManager* pDisplayManger = _DisplayManager::GetInstance();
+ pDisplayManger->SetRestoreContextCallback(_RestoreContext);
return ENGINE_TYPE_OPENGL_X11;
}
else if (engineName.Contains(String("software_x11")))
#if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
void
+_RestoreContext(void)
+{
+ if (__pPreviousSglInfo != null)
+ {
+ EGLDisplay display = __pPreviousSglInfo->display;
+ EGLSurface surface = __pPreviousSglInfo->surface;
+ EGLContext context = __pPreviousSglInfo->context;
+
+ if (__isDoublePixmapEnabled)
+ {
+ _SglInfo* pBackSglInfo = null;
+ _SglInfo* pFrontSglInfo = null;
+
+ if (__pPreviousSglInfo->isBackbuffer)
+ {
+ pBackSglInfo = __pPreviousSglInfo;
+ pFrontSglInfo = __pPreviousSglInfo->pSecondSglInfo;
+ }
+ else
+ {
+ pBackSglInfo = __pPreviousSglInfo->pSecondSglInfo;
+ pFrontSglInfo = __pPreviousSglInfo;
+ }
+
+ surface = pBackSglInfo->surface;
+ }
+
+ EGLBoolean ret = eglMakeCurrent(display, surface, surface, context);
+ SysTryLog(NID_GRP, ret == EGL_TRUE, "fail to restore previous surface and context. %#x %#x %#x %#x egl error:%#x"
+ , (unsigned int)display
+ , (unsigned int)surface
+ , (unsigned int)surface
+ , (unsigned int)context
+ , (unsigned int)eglGetError());
+ }
+}
+
+void
_PostRenderCallback(Ecore_Evas* ee)
{
if (__pPreviousSglInfo != null)
#include <Evas.h>
//#define VE_DEBUG // debug config
+//#define UI_ANIM_DEBUG
#define VE_DEBUG_MODULE
extern "C" _OSP_EXPORT_ void DumpAllEvas(void);
void* _DisplayManager::__pWakeUpEventHandler = null;
bool _DisplayManager::__wakeUpEventAdded = false;
_DisplayManager* _DisplayManager::__pInstance = null;
+_DisplayManager::RestoreContextCallback _DisplayManager::__pRestoreContextCallback = null;
_DisplayManager::_DisplayManager(void)
: __roots()
return E_SUCCESS;
}
+void
+_DisplayManager::SetRestoreContextCallback(RestoreContextCallback pRestoreContextCallback)
+{
+ __pRestoreContextCallback = pRestoreContextCallback;
+}
-
+void
+_DisplayManager::RestoreContext(void)
+{
+ if (__pRestoreContextCallback)
+ {
+ (*__pRestoreContextCallback)();
+ }
+}
}}} // Tizen::Ui::Animations
#include "FUiAnim_EflNode.h"
#include "FUiAnim_EflLayer.h"
#include "FUiAnim_EflVisualElementSurfaceImpl.h"
+#include "FUiAnim_DisplayManager.h"
using namespace std;
using namespace Tizen::Base;
evas_object_show(__pEvasImage);
evas_object_move(__pEvasImage, -999999, -999999);
#endif
+
+ _DisplayManager::RestoreContext();
return;
CATCH:
evas_object_del(__pEvasImage);
__pEvasImage = null;
+ _DisplayManager::RestoreContext();
}
_EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, const Handle object, const Dimension& size)
ClearLastResult();
_EflLayer* pLayer = reinterpret_cast<_EflLayer*>(layer);
- Evas* evas = evas_object_evas_get(reinterpret_cast<Evas_Object*>(object));
- if (pLayer->GetEvas() == evas)
+ Evas* pEvas = evas_object_evas_get(reinterpret_cast<Evas_Object*>(object));
+ if (pLayer->GetEvas() == pEvas)
{
__pEvasImage = reinterpret_cast<Evas_Object*>(object);
}
evas_object_show(__pEvasImage);
evas_object_move(__pEvasImage, -999999, -999999);
#endif
+ _DisplayManager::RestoreContext();
}
_EflVisualElementSurfaceImpl::~_EflVisualElementSurfaceImpl(void)
evas_object_del(__pEvasImage);
}
evas_object_smart_member_del(__pEvasImage);
+ _DisplayManager::RestoreContext();
}
if (__pBuffer != null)
}
__pBuffer = null;
+ _DisplayManager::RestoreContext();
return E_SUCCESS;
}
#include "FUiAnim_MatrixUtil.h"
#include "FUiAnim_Debug.h"
#include "FUiAnim_EflNode.h"
+#include "FUiAnim_EflLayer.h"
#include "FUiAnim_VisualElementSurfaceImpl.h"
#include "FUiAnim_EflVisualElementSurfaceImpl.h"
#include "FUiAnim_DisplayManager.h"
__pSharedData->pSurface->GetBufferInfo(info);
byte* pStart = (byte*)evas_object_image_data_get((Evas_Object*)pSurfImpl->GetNativeHandle(), false);
+ _DisplayManager::RestoreContext();
if(pStart)
{
if(pSurfImpl && pSurfImpl->GetNativeHandle() && pSurfImpl->__isImageObject)
{
byte* pStart = (byte*)evas_object_image_data_get((Evas_Object*)pSurfImpl->GetNativeHandle(), false);
+ _DisplayManager::RestoreContext();
+
BufferInfo info;
__pSharedData->pSurface->GetBufferInfo(info);
static result ReleaseInstance(void);
static bool __wakeUpEventAdded;
+ // For restoring gl context
+ typedef void (*RestoreContextCallback)(void);
+ static void SetRestoreContextCallback(RestoreContextCallback pRestoreContextCallback);
+ static void RestoreContext(void);
public:
_RootVisualElement* CreateRoot(void);
static int __eventType;
static void* __pWakeUpEventHandler;
static _DisplayManager* __pInstance;
+ static RestoreContextCallback __pRestoreContextCallback;
}; // _DisplayManager
}}} //namespace Tizen { namespace Ui { namespace Animations