Fix for power consumption
authorBongjoo Seo <bongjoo.seo@samsung.com>
Thu, 30 May 2013 05:39:57 +0000 (14:39 +0900)
committerBongjoo Seo <bongjoo.seo@samsung.com>
Mon, 3 Jun 2013 02:39:10 +0000 (11:39 +0900)
Change-Id: I6f0665739c1d41c380bcd4c580328d73a5102899
Signed-off-by: Bongjoo Seo <bongjoo.seo@samsung.com>
src/ui/FUi_EcoreEvas.cpp
src/ui/animations/FUiAnim_EflLayer.cpp
src/ui/animations/FUiAnim_EflNode.cpp
src/ui/inc/FUiAnim_EflLayer.h

index 7c0de8d..b2a9f96 100644 (file)
@@ -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:
index 75d9a6b..2f1d4b3 100644 (file)
@@ -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);
        }
index 4dbd192..2c093ff 100644 (file)
@@ -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
index b82b343..d65a64c 100644 (file)
@@ -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;
 };