Fixed Sync issue when OnDraw overriding
authorHeeJu Kang <mobum.kang@samsung.com>
Tue, 16 Apr 2013 07:25:11 +0000 (16:25 +0900)
committerHeeJu Kang <mobum.kang@samsung.com>
Tue, 16 Apr 2013 07:25:11 +0000 (16:25 +0900)
Change-Id: Ifd568673504c421cfd15be2322ec41be7122284b
Signed-off-by: HeeJu Kang <mobum.kang@samsung.com>
src/FShell_AppWidgetFrame.cpp
src/FShell_AppWidgetLayer.cpp
src/FShell_AppWidgetLayer.h
src/FShell_AppWidgetPopup.cpp
src/FShell_AppWidgetPopupView.cpp
src/FShell_AppWidgetPopupView.h
src/FShell_AppWidgetPopupViewPresenter.cpp
src/FShell_AppWidgetView.cpp
src/FShell_AppWidgetView.h
src/FShell_AppWidgetViewPresenter.cpp

index 4fd1d70..0fb29df 100644 (file)
@@ -230,8 +230,6 @@ _AppWidgetFrame::OnDraw(void)
        {
                __pAppWidgetFramePresenter->Draw();
        }
-
-       __pAppWidgetLayer->SetRenderEnabled(true);
 }
 
 }} // Tizen::Shell
index 10107c4..fe61a42 100644 (file)
@@ -72,6 +72,8 @@ FreeRenderBuffer(void* pData, void* pCanvas)
 void
 PostRender(void* pData, Evas* pEvas, void* pEventInfo)
 {
+       SysLog(NID_SHELL, "ENTER");
+
        _AppWidgetLayer* pAppWidgetLayer = static_cast<_AppWidgetLayer*>(pData);
        SysTryReturnVoidResult(NID_SHELL, pAppWidgetLayer, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 
@@ -92,7 +94,6 @@ _AppWidgetLayer::_AppWidgetLayer(const FloatDimension& size)
        , __pRenderBuffer(null)
        , __bufferSize(0)
        , __pixmapId(-1)
-       , __rendered(true)
 {
 }
 
@@ -118,7 +119,7 @@ _AppWidgetLayer::OnConstructed(void)
        Evas* pEvas = ecore_evas_get(pEcoreEvas.get());
        SysTryReturn(NID_SHELL, pEvas, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
-       evas_event_callback_add(pEvas, EVAS_CALLBACK_RENDER_POST, PostRender, this);
+//     evas_event_callback_add(pEvas, EVAS_CALLBACK_RENDER_POST, PostRender, this);
 
        unique_ptr<Evas_Object, _EvasObjectDeleter> pEvasObject(evas_object_rectangle_add(pEvas));
        SysTryReturn(NID_SHELL, pEvasObject, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
@@ -169,8 +170,6 @@ _AppWidgetLayer::GetPixmapId(void) const
 void
 _AppWidgetLayer::SetLayerBounds(const FloatRectangle& bounds)
 {
-       SetRenderEnabled(false);
-
        __size = FloatDimension(bounds.width, bounds.height);
 
        ecore_evas_resize(__pEcoreEvas.get(), __size.width, __size.height);
@@ -325,20 +324,8 @@ CATCH:
 }
 
 void
-_AppWidgetLayer::SetRenderEnabled(bool enable)
-{
-       __rendered = enable;
-}
-
-void
 _AppWidgetLayer::OnRendered(void)
 {
-       if (!__rendered)
-       {
-               SysLog(NID_SHELL, "do not sync");
-               return;
-       }
-
        if (__pixmapId == -1)
        {
                __pixmapId = AcquirePixmap();
@@ -438,5 +425,17 @@ _AppWidgetLayer::OnTouchEventRecevied(int eventType, double timestamp, double x,
        return 0;
 }
 
+void
+_AppWidgetLayer::Flush(void)
+{
+       SysLog(NID_SHELL, "ENTER");
+
+       _EflLayer::Flush();
+
+       if (IsFlushNeeded())
+       {
+               OnRendered();
+       }
+}
 
 }} // Tizen::Shell
index fd32e4c..0e42ff0 100644 (file)
@@ -60,7 +60,6 @@ public:
        void FreeCanvas(void* pCanvas);
        int EventHandler(int eventType, double timestamp, double x, double y);
        result SyncPixmap(const Tizen::Graphics::FloatDimension& size);
-       void SetRenderEnabled(bool enable);
        void OnRendered(void);
 
        virtual result RegisterTouchEventListener(void);
@@ -72,6 +71,7 @@ public:
 private:
        _AppWidgetLayer(const _AppWidgetLayer& rhs);
        _AppWidgetLayer& operator =(const _AppWidgetLayer&  rhs);
+       virtual void Flush(void);
 
 protected:
        bool __isReleased;
@@ -100,7 +100,6 @@ private:
        void* __pRenderBuffer;
        int __bufferSize;
        int __pixmapId;
-       bool __rendered;
 };
 
 }} // Tizen::Shell
index 9a3c643..13945af 100644 (file)
@@ -368,8 +368,6 @@ _AppWidgetPopup::OnDraw(void)
        {
                __pAppWidgetPopupPresenter->Draw();
        }
-
-       __pAppWidgetPopupLayer->SetRenderEnabled(true);
 }
 
 }} // Tizen::Shell
index 5252aaf..1837fc6 100644 (file)
@@ -162,6 +162,12 @@ _AppWidgetPopupView::GetBitmap(void) const
        return __pBitmap.get();
 }
 
+int
+_AppWidgetPopupView::GetPixmapId(void) const
+{
+       return __pixmap;
+}
+
 void
 _AppWidgetPopupView::SetPopupBounds(const FloatDimension& size)
 {
@@ -506,6 +512,7 @@ _AppWidgetPopupView::OnAppWidgetUpdated(int pixmap)
                evas_object_image_size_set(__pPixmapObject.get(), width, height);
                evas_object_image_colorspace_set(__pPixmapObject.get(), EVAS_COLORSPACE_ARGB8888);
                evas_object_image_alpha_set(__pPixmapObject.get(), EINA_TRUE);
+               evas_object_raise(__pPixmapObject.get());
 
                evas_object_move(__pPixmapObject.get(), 0, 0);
                evas_object_show(__pPixmapObject.get());
index fcee1bf..59e8c1a 100644 (file)
@@ -77,6 +77,7 @@ public:
        result AddAppWidgetPopupEventListener(const _IAppWidgetPopupViewEventListener& listener);
        result RemoveAppWidgetPopupEventListener(const _IAppWidgetPopupViewEventListener& listener);
        Tizen::Graphics::Bitmap* GetBitmap(void) const;
+       int GetPixmapId(void) const;
 
 protected:
        _AppWidgetPopupView(_AppWidgetView& appwidgetView);
index 8366b11..25e5793 100644 (file)
@@ -45,6 +45,12 @@ _AppWidgetPopupViewPresenter::~_AppWidgetPopupViewPresenter(void)
 void
 _AppWidgetPopupViewPresenter::Draw(void)
 {
+/*
+       if (__pAppWidgetPopupView->GetPixmapId() != -1)
+       {
+               return;
+       }
+*/
        Bitmap* pBitmap = __pAppWidgetPopupView->GetBitmap();
        SysTryReturnVoidResult(NID_SHELL, pBitmap, E_SYSTEM, "Bitmap is invalid.");
 
index cf70284..acf0d4c 100644 (file)
@@ -282,6 +282,12 @@ _AppWidgetView::CallProviderRemoved(void)
        }
 }
 
+int
+_AppWidgetView::GetPixmapId(void) const
+{
+       return __pixmap;
+}
+
 livebox*
 _AppWidgetView::GetNativeAppWidget(void) const
 {
index 45de955..45107ad 100644 (file)
@@ -89,6 +89,7 @@ public:
        bool IsUpdated(void) const;
        Tizen::Graphics::FloatDimension GetAnchorSize(void) const;
        void CallProviderRemoved(void);
+       int GetPixmapId(void) const;
 
 protected:
        _AppWidgetView(void);
index 7f6cda0..d1aa011 100644 (file)
@@ -114,6 +114,12 @@ _AppWidgetViewPresenter::GetAppIconPath(void) const
 void
 _AppWidgetViewPresenter::Draw(void)
 {
+/*
+       if (__pAppWidgetView->GetPixmapId() != -1)
+       {
+               return;
+       }
+*/
        Bitmap* pBitmap = __pAppWidgetView->GetBitmap();
        bool imageDone = false;