rotatePartial = false;
}
- Evas_Object* pWinObj = pLayer->GetElmWin();
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
int rootW = 0;
{
ecore_evas_rotation_with_resize_set(pEcoreEvas, orientation);
- evas_object_move(pWinObj, 0, 0);
if ((orientation == 0) || (orientation == 180))
{
- evas_object_resize(pWinObj, rootW, rootH);
+ pLayer->SetBounds(FloatRectangle(0, 0, rootW, rootH));
}
else
{
- evas_object_resize(pWinObj, rootH, rootW);
+ pLayer->SetBounds(FloatRectangle(0, 0, rootH, rootW));
}
SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, FULL SCREEN] Rotate bounds(ROT %d).", win, orientation);
Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
int rotate = ecore_evas_rotation_get(pEcoreEvas);
-
int winX = winBounds.x;
int winY = winBounds.y;
int h = 0;
Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
- evas_object_move(pWinObj, winX, winY);
if (ret == EINA_FALSE)
{
- evas_object_resize(pWinObj, winBounds.width, winBounds.height);
+ pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d, %d, %d).", win, orientation, winX, winY, winBounds.width, winBounds.height);
}
else
{
+ pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d) ONLY MOVE.", win, orientation, winX, winY);
}
}
int h = 0;
Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
- evas_object_move(pWinObject, winX, winY);
if (ret == EINA_FALSE)
{
- evas_object_resize(pWinObject, winBounds.width, winBounds.height);
+ pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
}
else
{
- SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+ pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
}
SetLastResult(E_SUCCESS);
int h = 0;
Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
- evas_object_move(pWinObject, winX, winY);
if (ret == EINA_FALSE)
{
- evas_object_resize(pWinObject, winBounds.width, winBounds.height);
+ pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
}
else
{
- SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+ pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+ SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
}
SetLastResult(E_SUCCESS);
using namespace Tizen::Ui;
using namespace Tizen::Ui::Animations;
-//#define _NEED_DAMAGE_HANDER_
-
-//#define PRINT printf
+//#define PRINT(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)
#define PRINT(...)
-
-
namespace
{
#define __UNUSED__
Ecore_Idle_Enterer* __pOnIdleLoopIterator = null;
-
-//static const double fpsLimitInterval = 1.0 / 55.0;
-static bool __needPreRender = false;
-Eina_Bool
-OnIdleLoopIterate(void* pData)
-{
- _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
-
-// PRINT("OnIdleLoopIterate()\n");
-
-
- if (!pDisplayManager)
- {
- return ECORE_CALLBACK_CANCEL; // for remove callback
- }
-
- Tizen::Ui::Animations::_AnimationManager* pAnimationManager = Tizen::Ui::Animations::_AnimationManager::GetInstance();
-
- if (!pAnimationManager)
- {
- return ECORE_CALLBACK_CANCEL; // for remove callback
- }
-
- //CHECK ME : how about the performance?
-// double currentTime = ecore_time_get();
-// static double prevFlushTime = 0;
-
-// if (currentTime - prevFlushTime >= fpsLimitInterval * 0.99)
- {
- pAnimationManager->ProcessAnimationTick();
-
-// prevFlushTime = currentTime;
-
- pDisplayManager->RenderAll();
-
- pDisplayManager->Flush();
- }
-
- return ECORE_CALLBACK_RENEW;
-}
-
-// WARNING: Without this, idle-enterer will be called after evas destroyed which may cause crash while accessing ecore-evas.
+#ifdef USE_WORKAROUND
void
-OnEcoreEvasFree(Ecore_Evas* pEcoreEvas)
+OnRenderFlushPost(void* pData, Evas* pEvas, void* ev)
{
- ecore_evas_manual_render_set(pEcoreEvas, EINA_FALSE);
+// _EflLayer* pLayer = (_EflLayer*)pData;
+// int w, h;
+// evas_output_size_get(pLayer->GetEvas(), &w, &h);
+// int rotate = ecore_evas_rotation_get(pLayer->GetEcoreEvas());
+// PRINT("[%#x] OnRenderFlushPost size(%d,%d) rotate=%d\n", (unsigned int)pData, w, h, rotate);
}
-#endif
-
-
-#ifdef _NEED_DAMAGE_HANDER_
Eina_Bool
OnXWindowDamaged(void* pData __UNUSED__, int type __UNUSED__, void* pEventInfo)
{
-#if 1
_Ecore_X_Event_Window_Damage* pEvent = (_Ecore_X_Event_Window_Damage*)pEventInfo;
if (pData)
if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
{
- FloatRectangle bounds = pLayer->GetBounds();
-
- evas_damage_rectangle_add(pLayer->GetEvas(), 0, 0, (int)bounds.width, (int)bounds.height);
- pLayer->SetEvasRenderNeeded();
-
- _DisplayManager::GetInstance()->AddWakeUpEvent();
-
- PRINT("OnXWindowDamaged(%p)[%d,%d,%d,%d]------------\n", pLayer->GetEvas(), pEvent->x, pEvent->y, pEvent->w, pEvent->h);
+ PRINT("[%#x] OnXWindowDamaged[%d,%d,%d,%d]------------\n", (unsigned int)pLayer, pEvent->x, pEvent->y, pEvent->w, pEvent->h);
}
}
-#endif
return EINA_TRUE;
}
Eina_Bool
OnXWindowConfigured(void* pData, int type, void* pEventInfo)
{
-#if 0
_Ecore_X_Event_Window_Configure* pEvent = (_Ecore_X_Event_Window_Configure*)pEventInfo;
if (pData)
if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
{
- FloatRectangle bounds = pLayer->GetBounds();
-
- evas_damage_rectangle_add(pLayer->GetEvas(), 0, 0, (int)bounds.width, (int)bounds.height);
- pLayer->SetEvasRenderNeeded();
+ int w, h;
+ evas_output_size_get(pLayer->GetEvas(), &w, &h);
+ PRINT("[%#x] OnXWindowConfigured[%d,%d,%d,%d] evas(%d,%d)------------\n", (unsigned int)pLayer, pEvent->x, pEvent->y, pEvent->w, pEvent->h, w, h);
- _DisplayManager::GetInstance()->AddWakeUpEvent();
-
- PRINT("OnXWindowConfigured(%p)[%d,%d,%d,%d]------------\n", pLayer->GetEvas(), pEvent->x, pEvent->y, pEvent->w, pEvent->h);
}
}
-#endif
return EINA_TRUE;
}
}
_EflLayer* pLayer = (_EflLayer*)pData;
- PRINT("############ Hidden (%p, 0x%x) \n" , pLayer, pEvent->win);
-
if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
{
- PRINT("############ Hidden (%p) -> EventDone() \n" , pData);
- pLayer->SetVisibilityChangeCompleted();
- _DisplayManager::GetInstance()->AddWakeUpEvent();
+ PRINT("[%#x] ############ Hidden -> EventDone() \n" , (unsigned int)pData);
}
return EINA_TRUE;
}
_EflLayer* pLayer = (_EflLayer*)pData;
- PRINT("############ Shown (%p, 0x%x) \n" , pLayer, pEvent->win);
-
if (pLayer->GetEvas() && pLayer->GetEcoreEvas() && pEvent->win == ecore_evas_window_get(pLayer->GetEcoreEvas()))
{
- PRINT("############ Shown (%p) -> EventDone() \n" , pData);
- FloatRectangle bounds = pLayer->GetBounds();
+ //ecore_evas_rotation_set(pLayer->GetEcoreEvas(), 270);
+ PRINT("[%#x] ############ Shown -> EventDone() \n" , (unsigned int)pData);
+ }
+
+ return EINA_TRUE;
+}
+#endif // USE_WORKAROUND
+
+
+
+//static const double fpsLimitInterval = 1.0 / 55.0;
+static bool __needPreRender = false;
+Eina_Bool
+OnIdleLoopIterate(void* pData)
+{
+ _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+
+// PRINT("OnIdleLoopIterate()\n");
+
+
+ if (!pDisplayManager)
+ {
+ return ECORE_CALLBACK_CANCEL; // for remove callback
+ }
- evas_damage_rectangle_add(pLayer->GetEvas(), 0, 0, (int)bounds.width, (int)bounds.height);
+ Tizen::Ui::Animations::_AnimationManager* pAnimationManager = Tizen::Ui::Animations::_AnimationManager::GetInstance();
- pLayer->SetVisibilityChangeCompleted();
- _DisplayManager::GetInstance()->AddWakeUpEvent();
+ if (!pAnimationManager)
+ {
+ return ECORE_CALLBACK_CANCEL; // for remove callback
}
- return EINA_TRUE;
+ //CHECK ME : how about the performance?
+// double currentTime = ecore_time_get();
+// static double prevFlushTime = 0;
+
+// if (currentTime - prevFlushTime >= fpsLimitInterval * 0.99)
+ {
+ pAnimationManager->ProcessAnimationTick();
+
+// prevFlushTime = currentTime;
+
+ pDisplayManager->RenderAll();
+
+ pDisplayManager->Flush();
+ }
+
+ return ECORE_CALLBACK_RENEW;
}
+// WARNING: Without this, idle-enterer will be called after evas destroyed which may cause crash while accessing ecore-evas.
+void
+OnEcoreEvasFree(Ecore_Evas* pEcoreEvas)
+{
+ ecore_evas_manual_render_set(pEcoreEvas, EINA_FALSE);
+}
#endif
+
void
PreRenderCallback(Ecore_Evas* ee)
{
}
#endif
- _DisplayManager::GetInstance()->Render(*pEflLayer->GetRootVisualElement());
+ _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+ if (pDisplayManager)
+ {
+ pDisplayManager->Render(*pEflLayer->GetRootVisualElement());
+ }
}
}
if (pEflLayer && pEflLayer->GetRootVisualElement())
{
- _DisplayManager::GetInstance()->PostRender(*pEflLayer->GetRootVisualElement());
+ _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+ if (pDisplayManager)
+ {
+ pDisplayManager->PostRender(*pEflLayer->GetRootVisualElement());
+ }
}
}
int _EflLayer::_countOfLayer = 0;
_EflLayer::_EflLayer(void)
- : _pEvas(null)
+ : _pRootVisualElement(null)
+ , _pEvas(null)
, _pEcoreEvas(null)
, _pWindow(null)
- , _pOnWindowDamagedHandler(null)
- , _pOnWindowConfiguredHandler(null)
- , _pOnWindowHideHandler(null)
- , _pOnWindowShowHandler(null)
- , _needEvasRender(0)
+ , _needBoundsChangeRequest(false)
, _needShowStateChangeRequest(false)
, _isShow(false)
- , _isVisibilityChangeInProgress(false)
, _needAsyncVisibilityChangeRequest(true)
, _isMainType(true)
, _needRender(true)
+ , _pOnWindowDamagedHandler(null)
+ , _pOnWindowConfiguredHandler(null)
+ , _pOnWindowHideHandler(null)
+ , _pOnWindowShowHandler(null)
, __isWinObject(true)
+ , __bounds()
{
_countOfLayer++;
}
_EflLayer::_EflLayer(bool isMainType)
- : _pEvas(null)
+ : _pRootVisualElement(null)
+ , _pEvas(null)
, _pEcoreEvas(null)
, _pWindow(null)
- , _pOnWindowDamagedHandler(null)
- , _pOnWindowConfiguredHandler(null)
- , _pOnWindowHideHandler(null)
- , _pOnWindowShowHandler(null)
- , _needEvasRender(0)
+ , _needBoundsChangeRequest(false)
, _needShowStateChangeRequest(false)
, _isShow(false)
- , _isVisibilityChangeInProgress(false)
, _needAsyncVisibilityChangeRequest(true)
, _isMainType(isMainType)
, _needRender(true)
+ , _pOnWindowDamagedHandler(null)
+ , _pOnWindowConfiguredHandler(null)
+ , _pOnWindowHideHandler(null)
+ , _pOnWindowShowHandler(null)
, __isWinObject(true)
+ , __bounds()
{
_countOfLayer++;
}
__pOnIdleLoopIterator = null;
}
-#ifdef _NEED_DAMAGE_HANDER_
+
+#ifdef USE_WORKAROUND
if (_pOnWindowDamagedHandler)
{
ecore_event_handler_del(_pOnWindowDamagedHandler);
ecore_event_handler_del(_pOnWindowShowHandler);
_pOnWindowShowHandler = null;
}
-#endif
+#endif // USE_WORKAROUND
#endif
if(_isMainType)
{
_pWindow = elm_win_add(NULL, NULL, ELM_WIN_BASIC);
+ PRINT("[%#x] CREATE WINDOW [MAIN TYPE]\n", (unsigned int)this);
}
else
{
_pWindow = elm_win_add(NULL, NULL, ELM_WIN_UTILITY);
+ PRINT("[%#x] CREATE WINDOW [UTIL TYPE]\n", (unsigned int)this);
}
SysTryReturnResult(NID_UI, _pWindow, E_SYSTEM, "A system error has been occurred.");
}
// CHECK ME: Is this needed for GL mode?
-#ifdef _NEED_DAMAGE_HANDER_
+
+#ifdef USE_WORKAROUND
if(_pOnWindowDamagedHandler == null)
{
_pOnWindowDamagedHandler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DAMAGE, OnXWindowDamaged, this);
{
_pOnWindowShowHandler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, OnXWindowShown, this);
}
+ evas_event_callback_add(_pEvas, EVAS_CALLBACK_RENDER_FLUSH_POST, OnRenderFlushPost, (void*)this);
+#endif // USE_WORKAROUND
-#endif
#ifdef VE_VSYNC_UPDATE
if(__pOnIdleLoopIterator == null)
result
_EflLayer::SetBounds(const FloatRectangle& bounds)
{
- if (_pWindow)
- {
- evas_object_move(_pWindow, bounds.x, bounds.y);
- evas_object_resize(_pWindow, bounds.width, bounds.height);
- }
+ if (__bounds == bounds)
+ return E_SUCCESS;
+
+ __bounds = bounds;
+ evas_object_move(_pWindow, __bounds.x, __bounds.y);
+ evas_object_resize(_pWindow, __bounds.width, __bounds.height);
+ PRINT("[%#x] Initialzing evas_object_move(%f, %f) \n", (unsigned int)this, __bounds.x, __bounds.y);
+ PRINT("[%#x] Initialzing evas_object_resize(%f, %f) \n", (unsigned int)this, __bounds.width, __bounds.height);
+
return E_SUCCESS;
}
{
if (_pWindow)
{
- int x = 0;
- int y = 0;
- int w = 0;
- int h = 0;
-
- evas_object_geometry_get(_pWindow, null, null, &w, &h);
-
- if (__isWinObject == true)
- {
- elm_win_screen_position_get(_pWindow, &x, &y);
- }
-
- return FloatRectangle(x, y, w, h);
+ return __bounds;
}
return FloatRectangle();
result
_EflLayer::SetShowState(bool show)
{
-#ifdef ECORE_EVAS_ASYNC_VISIBILITY_BUG_HACK
if (_isShow == show)
{
return E_SUCCESS;
{
// Show State is not applied yet. Need cancel the visibility change request.
_needShowStateChangeRequest = false;
- PRINT("Cancel SetShowState request (%d)\n", show);
+ PRINT("[%#x] Cancel SetShowState request (%d)\n", (unsigned int)this, show);
}
else
{
_needShowStateChangeRequest = true;
- _DisplayManager::GetInstance()->AddWakeUpEvent();
- PRINT("SetShowState request (%d)\n", show);
- }
- _isShow = show;
-#else
- if (_pWindow)
- {
- if (show)
+ _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+ if (pDisplayManager)
{
- evas_object_show(_pWindow);
- }
- else
- {
- evas_object_hide(_pWindow);
+ pDisplayManager->AddWakeUpEvent();
}
+ PRINT("[%#x] SetShowState request (%d)\n", (unsigned int)this, show);
}
-#endif
+
+ _isShow = show;
return E_SUCCESS;
}
{
opacity = 1.0f;
}
- else if(opacity<0.0f)
+ else if(opacity < 0.0f)
{
opacity = 0.0f;
}
if (_FloatCompare(opacity, 1.0f))
{
-// ecore_evas_alpha_set(_pEcoreEvas, EINA_FALSE);
if (__isWinObject == true)
{
elm_win_alpha_set(_pWindow, EINA_FALSE);
}
else if (opacity < 1.0f)
{
-
-// ecore_evas_alpha_set(_pEcoreEvas, EINA_TRUE);
if (__isWinObject == true)
{
elm_win_alpha_set(_pWindow, EINA_TRUE);
a = opacity*255;
evas_object_color_set(_pWindow, r, g, b, a);
}
+ PRINT("[%#x] ALPHA SET(opacity=%f)\n", (unsigned int)this, opacity);
}
float
_EflLayer::GetOpacity(void)
{
if (!_pWindow)
- return 0.0f;
+ {
+ return 0.0f;
+ }
int r,g,b,a;
evas_object_color_get(_pWindow, &r, &g, &b, &a);
if (a > 255)
+ {
return 1.0f;
+ }
return a / 255.0f;
{
if (_pEcoreEvas)
{
- PRINT("Flush StateChange(%p) - is Pending(%d) \n",this , _isVisibilityChangeInProgress);
-
- if (_needShowStateChangeRequest && (!_needAsyncVisibilityChangeRequest || !_isVisibilityChangeInProgress))
+ if (_needShowStateChangeRequest)
{
if (_isShow)
{
evas_object_show(_pWindow);
-
- // QUICK-DIRTY HACK TO BE REMOVED !!!
-#ifdef ECORE_EVAS_ASYNC_VISIBILITY_BUG_HACK
- ecore_x_sync();
- ecore_x_flush();
- usleep(30 * 1000);
-
- FloatRectangle bounds = GetBounds();
- evas_damage_rectangle_add(_pEvas, 0, 0, (int)bounds.width, (int)bounds.height);
-#endif
-
- PRINT("evas_object_show(%p) \n", this);
+ PRINT("[%#x] evas_object_show \n", (unsigned int)this);
}
else
{
evas_object_hide(_pWindow);
- PRINT("evas_object_hide(%p) \n", this);
+ PRINT("[%#x] evas_object_hide \n", (unsigned int)this);
}
-
-#ifdef _NEED_DAMAGE_HANDER_
- _isVisibilityChangeInProgress = true;
-#endif
_needShowStateChangeRequest = false;
}
- if (_needEvasRender > 0)
- {
- _DisplayManager::GetInstance()->AddWakeUpEvent();
- _needEvasRender--;
- }
FloatRectangle rect = GetBounds();
if(!_needRender)
{
- PRINT("_needRender = false bounds(%f %f %f %f)\n", rect.x, rect.y, rect.width, rect.height);
+ PRINT("[%#x] _needRender = false bounds(%f %f %f %f)\n", (unsigned int)this, __bounds.x, __bounds.y, __bounds.width, __bounds.height);
return;
}
- PRINT("ecore_evas_manual_render bounds(%f %f %f %f)\n", rect.x, rect.y, rect.width, rect.height);
+ //PRINT("[%#x] ecore_evas_manual_render bounds(%f %f %f %f)\n", (unsigned int)this, __bounds.x, __bounds.y, __bounds.width, __bounds.height);
__needPreRender = false;
ecore_evas_manual_render(_pEcoreEvas);
__needPreRender = true;
}
-#if 0
- if (_pEvas)
- {
- if(show)
- {
- evas_render_idle_flush(_pEvas);
- }
- else
- {
- evas_render(_pEvas);
- }
- }
-#endif
+
}