From: HeeJu Kang Date: Sat, 29 Jun 2013 02:20:39 +0000 (+0900) Subject: Fix distorted picture X-Git-Tag: accepted/tizen/20130912.150013^2~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=669414df43f726b245e2add804f3ff9e6c530f6f;p=platform%2Fframework%2Fnative%2Fshell.git Fix distorted picture Change-Id: I5a694f5ddf662b3ba18a368c5ff3c8b35e4a9abb Signed-off-by: HeeJu Kang --- diff --git a/src/FShell_AppWidgetLayer.cpp b/src/FShell_AppWidgetLayer.cpp index aa25cff..764e39c 100644 --- a/src/FShell_AppWidgetLayer.cpp +++ b/src/FShell_AppWidgetLayer.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include "FUi_AccessibilityManager.h" #include "FUi_Window.h" #include "FShell_AppWidgetBuffer.h" @@ -108,6 +109,7 @@ _AppWidgetLayer::_AppWidgetLayer(const Tizen::Base::String& providerId, const Fl : __isReleased(false) , __size(size) , __pAppWidgetBuffer(new (std::nothrow) _AppWidgetBuffer) + , __type(0) , __pEcoreEvas(null) , __pEvasObject(null) , __providerId(providerId) @@ -147,7 +149,7 @@ _AppWidgetLayer::OnConstructed(void) SysTryReturn(NID_SHELL, pEvas, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); evas_event_callback_add(pEvas, EVAS_CALLBACK_RENDER_PRE, PreRender, this); -// evas_event_callback_add(pEvas, EVAS_CALLBACK_RENDER_POST, PostRender, this); + evas_event_callback_add(pEvas, EVAS_CALLBACK_RENDER_POST, PostRender, this); unique_ptr pEvasObject(evas_object_rectangle_add(pEvas)); SysTryReturn(NID_SHELL, pEvasObject, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient."); @@ -305,7 +307,7 @@ _AppWidgetLayer::OnRendered(void) SysTryReturnVoidResult(NID_SHELL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } - SysLog(NID_SHELL, "ENTER"); + SysLog(NID_SHELL, "ENTER (%d)", __type); r = Sync(__size); SysTryReturnVoidResult(NID_SHELL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -314,14 +316,22 @@ _AppWidgetLayer::OnRendered(void) void _AppWidgetLayer::OnNativeCanvasPreRendered(void) { - SysLog(NID_SHELL, "ENTER"); + SysLog(NID_SHELL, "ENTER (%d)", __type); __pAppWidgetBuffer->LockBuffer(); + + if(_DisplayManager::GetInstance()) + { + _DisplayManager::GetInstance()->Render(*GetRootVisualElement()); + } } void _AppWidgetLayer::OnNativeCanvasPostRendered(void) { + SysLog(NID_SHELL, "ENTER (%d)", __type); + + __pAppWidgetBuffer->UnlockBuffer(); } result @@ -354,7 +364,14 @@ _AppWidgetLayer::Sync(const FloatDimension& size) SysTryReturn(NID_SHELL, !__providerId.IsEmpty(), E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid."); #if defined(_DUMP_BUFFER) - __pAppWidgetBuffer->Dump("Box"); + if (__type == 0) + { + __pAppWidgetBuffer->Dump("Box"); + } + else + { + __pAppWidgetBuffer->Dump("Popup"); + } #endif //_DUMP_BUFFER result r = _AppWidgetProviderManagerImpl::GetInstance()->RequestSyncSharedMemory(__providerId, size.width, size.height); @@ -468,6 +485,8 @@ _AppWidgetLayer::Flush(void) { bool needed = IsFlushNeeded(); + __pAppWidgetBuffer->LockBuffer(); + if (needed) { Evas* pEvas = ecore_evas_get(__pEcoreEvas.get()); diff --git a/src/FShell_AppWidgetLayer.h b/src/FShell_AppWidgetLayer.h index f42e154..0ede9ac 100644 --- a/src/FShell_AppWidgetLayer.h +++ b/src/FShell_AppWidgetLayer.h @@ -81,6 +81,7 @@ protected: bool __isReleased; Tizen::Graphics::FloatDimension __size; std::unique_ptr<_AppWidgetBuffer> __pAppWidgetBuffer; + int __type; private: struct _EcoreEvasDeleter diff --git a/src/FShell_AppWidgetPopup.cpp b/src/FShell_AppWidgetPopup.cpp index 6475a98..eb960e8 100644 --- a/src/FShell_AppWidgetPopup.cpp +++ b/src/FShell_AppWidgetPopup.cpp @@ -68,6 +68,7 @@ private: _AppWidgetPopupLayer::_AppWidgetPopupLayer(const Tizen::Base::String& providerId, const FloatDimension& size) : _AppWidgetLayer(providerId, size) { + __type = 1; } _AppWidgetPopupLayer::~_AppWidgetPopupLayer(void)