From: Bongjoo Seo Date: Thu, 30 May 2013 05:39:57 +0000 (+0900) Subject: Fix for power consumption X-Git-Tag: accepted/tizen/20130924.144426~1^2~680^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53f787143ca3ae7a5299c914249303f1e167389d;p=platform%2Fframework%2Fnative%2Fuifw.git Fix for power consumption Change-Id: I6f0665739c1d41c380bcd4c580328d73a5102899 Signed-off-by: Bongjoo Seo --- diff --git a/src/ui/FUi_EcoreEvas.cpp b/src/ui/FUi_EcoreEvas.cpp index 7c0de8d..b2a9f96 100644 --- a/src/ui/FUi_EcoreEvas.cpp +++ b/src/ui/FUi_EcoreEvas.cpp @@ -61,6 +61,8 @@ #include "FUi_ControlImplManager.h" #include "FUiCtrl_Popup.h" #include "FUiCtrl_ContextMenu.h" +#include "FUiAnim_DisplayContextImpl.h" +#include "FUiAnimDisplayContext.h" using namespace Tizen::Base; using namespace Tizen::Base::Runtime; @@ -227,17 +229,23 @@ OnWindowPropertyChanged(void* pData, int type, void* pEvent) if (pWindow->IsOrientationRoot() == true) { _Frame* pFrame = static_cast<_Frame*>(pWindow); + _DisplayContextImpl* pContext = _DisplayContextImpl::GetInstance(*pFrame->GetDisplayContext()); + _EflLayer* pLayer = static_cast<_EflLayer*>(pContext->GetNativeLayer()); + Ecore_X_Window_State_Hint state = ecore_x_icccm_state_get(targetWin); switch (state) { case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN: + pLayer->SetRenderNeeded(false); // Frame was hidden. break; case ECORE_X_WINDOW_STATE_HINT_ICONIC: + pLayer->SetRenderNeeded(false); pFrame->OnFrameMinimized(); break; case ECORE_X_WINDOW_STATE_HINT_NORMAL: + pLayer->SetRenderNeeded(true); pFrame->OnFrameRestored(); break; default: diff --git a/src/ui/animations/FUiAnim_EflLayer.cpp b/src/ui/animations/FUiAnim_EflLayer.cpp index 75d9a6b..2f1d4b3 100644 --- a/src/ui/animations/FUiAnim_EflLayer.cpp +++ b/src/ui/animations/FUiAnim_EflLayer.cpp @@ -271,6 +271,7 @@ _EflLayer::_EflLayer(void) , _isVisibilityChangeInProgress(false) , _needAsyncVisibilityChangeRequest(true) , _isMainType(true) + , _needRender(true) { _countOfLayer++; } @@ -290,6 +291,7 @@ _EflLayer::_EflLayer(bool isMainType) , _isVisibilityChangeInProgress(false) , _needAsyncVisibilityChangeRequest(true) , _isMainType(isMainType) + , _needRender(true) { _countOfLayer++; } @@ -634,7 +636,14 @@ _EflLayer::Flush(void) _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); + return; + } + PRINT("ecore_evas_manual_render bounds(%f %f %f %f)\n", rect.x, rect.y, rect.width, rect.height); ecore_evas_manual_render(_pEcoreEvas); } diff --git a/src/ui/animations/FUiAnim_EflNode.cpp b/src/ui/animations/FUiAnim_EflNode.cpp index 4dbd192..2c093ff 100644 --- a/src/ui/animations/FUiAnim_EflNode.cpp +++ b/src/ui/animations/FUiAnim_EflNode.cpp @@ -800,8 +800,6 @@ _EflNode::Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& elemen { Evas_Object* pImageObjectOrg = null; Evas_Object* pImageObjectNew = null; - int imageWidth = 0; - int imageHeight = 0; const int nativeProps = _VisualElementImpl::HIERARCHY_PROPERTY_COORDINATES | _VisualElementImpl::HIERARCHY_PROPERTY_OPACITY diff --git a/src/ui/inc/FUiAnim_EflLayer.h b/src/ui/inc/FUiAnim_EflLayer.h index b82b343..d65a64c 100644 --- a/src/ui/inc/FUiAnim_EflLayer.h +++ b/src/ui/inc/FUiAnim_EflLayer.h @@ -97,6 +97,15 @@ public: _needAsyncVisibilityChangeRequest = asyncVisibilityChange; } + void SetRenderNeeded(bool needRender) + { + _needRender = needRender; + } + bool IsRenderNeeded() + { + return _needRender; + } + protected: result Initialize(Evas_Object* pWindow); virtual result Configure(_RootVisualElement& rootElement); @@ -116,6 +125,7 @@ protected: bool _isVisibilityChangeInProgress; bool _needAsyncVisibilityChangeRequest; bool _isMainType; + bool _needRender; static int _countOfLayer; };