Commented pixmap
authorHeeJu Kang <mobum.kang@samsung.com>
Tue, 1 Jan 2013 04:25:14 +0000 (13:25 +0900)
committerHeeJu Kang <mobum.kang@samsung.com>
Tue, 1 Jan 2013 04:25:14 +0000 (13:25 +0900)
Change-Id: I2f1570a9276fa2fd163bca10a263efbc6c187bfe
Signed-off-by: HeeJu Kang <mobum.kang@samsung.com>
packaging/osp-shell.spec
src/CMakeLists.txt
src/FShell_LiveboxPopupView.cpp
src/FShell_LiveboxPopupView.h
src/FShell_LiveboxView.cpp
src/FShell_LiveboxView.h
src/FShell_LiveboxViewManager.cpp

index f0218c1..5b80f40 100644 (file)
@@ -23,10 +23,14 @@ BuildRequires:  pkgconfig(pkgmgr)
 BuildRequires:         pkgconfig(minicontrol-provider)
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(xext)
+BuildRequires:  pkgconfig(xfixes)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(provider)
 BuildRequires:  pkgconfig(livebox-viewer)
 BuildRequires:  pkgconfig(livebox-service)
+BuildRequires:  pkgconfig(libdri2)
+BuildRequires:  pkgconfig(libdrm)
+BuildRequires:  pkgconfig(libdrm_slp)
 BuildRequires:  pkgconfig(shortcut)
 BuildRequires:  pkgconfig(osp-image-core)
 BuildRequires:  pkgconfig(osp-media)
index 4658b6a..77394ea 100644 (file)
@@ -131,6 +131,11 @@ TARGET_LINK_LIBRARIES(${this_target} "-llivebox-viewer" )
 TARGET_LINK_LIBRARIES(${this_target} "-llivebox-service" )
 TARGET_LINK_LIBRARIES(${this_target} "-lprovider" )
 TARGET_LINK_LIBRARIES(${this_target} "-lshortcut" )
+IF (NOT OSP_EMUL)
+TARGET_LINK_LIBRARIES(${this_target} "-ldri2" )
+TARGET_LINK_LIBRARIES(${this_target} "-ldrm" )
+TARGET_LINK_LIBRARIES(${this_target} "-ldrm_slp" )
+ENDIF (NOT OSP_EMUL)
 
 SET_TARGET_PROPERTIES(${this_target} 
        PROPERTIES 
index 0fdeb4d..22c9794 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <new>
+#include <Ecore.h>
 #include <Ecore_X.h>
 #include <livebox.h>
 #include <FBaseSysLog.h>
@@ -91,6 +92,11 @@ _LiveboxPopupView::CreateLiveboxPopupN(_LiveboxView& liveBoxView)
        result r = GetLastResult();
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
+#if defined(MULTI_WINDOW)
+       r = pLiveboxPopup->CreateRootVisualElement();
+       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+#endif // MULTI_WINDOW
+
        pLiveboxPopup->AcquireHandle();
 
        SetLastResult(E_SUCCESS);
@@ -229,13 +235,14 @@ _LiveboxPopupView::PlayAnimation(bool open)
        VisualElementAnimationGroup animationGroup;
        animationGroup.SetVisualElementAnimationStatusEventListener(this);
 
-       FloatRectangle bounds = pVisualElement->GetBounds();
-       FloatRectangle startBounds(0.0f, bounds.y, bounds.width, 0.0f);
-       FloatRectangle endBounds(bounds);
+       Rectangle bounds = GetBounds();
+       FloatRectangle boundsf(0.0f, 0.0f, static_cast<float>(bounds.width), static_cast<float>(bounds.height));
+       FloatRectangle startBounds(0.0f, boundsf.y, boundsf.width, 0.0f);
+       FloatRectangle endBounds(boundsf);
        if (!open)
        {
-               startBounds = bounds;
-               endBounds = FloatRectangle(0.0f, bounds.y, bounds.width, 0.0f);
+               startBounds = boundsf;
+               endBounds = FloatRectangle(0.0f, boundsf.y, boundsf.width, 0.0f);
        }
 
        VisualElementPropertyAnimation animation1;
@@ -421,12 +428,14 @@ _LiveboxPopupView::OnLiveboxUpdated(int pixmap)
        int height = 0;\r
 \r
        ecore_x_pixmap_geometry_get(pixmap, &x, &y, &width, &height);
+       SysTryReturnVoidResult(NID_UI_CTRL, (width > 0) && (height > 0), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid [0x%x %d %d].", pixmap, width , height);
 
        if (__pixmap != pixmap )
        {
-               SetBackgroundColor(Color(0, 0, 0, 0));
+//             SetBackgroundColor(Color(0, 0, 0, 0));
 
                _VisualElement* pVisualElement = GetVisualElement();
+//             _VisualElement* pVisualElement = __pLiveboxView->GetVisualElement();
                SysTryReturnVoidResult(NID_UI_CTRL, pVisualElement, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
                _EflNode* pEflNode = dynamic_cast<_EflNode*>(pVisualElement->GetNativeNode());
@@ -461,6 +470,12 @@ _LiveboxPopupView::OnLiveboxUpdated(int pixmap)
 
                evas_object_image_native_surface_set(__pPixmapObject.get(), &surface);
 
+               __pixmapDamage.reset(ecore_x_damage_new(pixmap, ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES));
+               SysTryReturnVoidResult(NID_UI_CTRL, __pixmapDamage.get() != 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+               __pPixmapEventHandler.reset(ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY, OnPixmapDamaged, (void*)this));
+               SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapEventHandler, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
                SysLog(NID_UI_CTRL, "[0x%x]", surface.data.x11.pixmap);
        }
 
@@ -507,4 +522,36 @@ _LiveboxPopupView::OnLiveboxPopupDestroyed(struct livebox *pLivebox, int ret, vo
        SysTryReturnVoidResult(NID_UI_CTRL, pLiveboxViewManager, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
 }
 
+Eina_Bool
+_LiveboxPopupView::OnPixmapDamaged(void* pData, int type, void* pEvent)
+{
+       _LiveboxPopupView* pPopupView = static_cast<_LiveboxPopupView*>(pData);
+       SysTryReturn(NID_UI_CTRL, pPopupView != null, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[[E_INVALID_ARG] The argument is invalid.");
+
+       Ecore_X_Event_Damage* pDamageEvent = static_cast<Ecore_X_Event_Damage*>(pEvent);
+       SysTryReturn(NID_UI_CTRL, pDamageEvent != null, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+
+       int pixmap = pPopupView->__pixmap;
+       SysTryReturn(NID_UI_CTRL, pDamageEvent->drawable == pixmap, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid [%d %d].", pDamageEvent->drawable, pixmap);
+
+       int x = 0;\r
+       int y = 0;\r
+       int width = 0;\r
+       int height = 0;\r
+\r
+       ecore_x_pixmap_geometry_get(pixmap, &x, &y, &width, &height);
+       SysTryReturn(NID_UI_CTRL, (width > 0) && (height > 0), ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid [0x%x %d %d].", pixmap, width , height);
+
+       Evas_Object* pPixmapObject = pPopupView->__pPixmapObject.get();
+       SysTryReturn(NID_UI_CTRL, pPixmapObject, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+
+       evas_object_image_pixels_dirty_set(pPixmapObject, EINA_TRUE);
+       evas_object_image_fill_set(pPixmapObject, 0, 0, width, height);
+       evas_object_image_data_update_add(pPixmapObject, 0, 0, width, height);
+
+       SysLog(NID_UI_CTRL, "[%d %d %d]", pixmap, width, height);
+
+       return ECORE_CALLBACK_DONE;
+}
+
 }} // Tizen::Shell
index 11a9cfa..ae82117 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <unique_ptr.h>
 #include <Evas.h>
+#include <Ecore.h>
+#include <Ecore_X.h>
 #include <FUiAnimIVisualElementAnimationStatusEventListener.h>
 #include "FUi_Window.h"
 
@@ -102,6 +104,7 @@ private:
 
        static void OnLiveboxPopupCreated(struct livebox *pLivebox, int ret, void* pData);
        static void OnLiveboxPopupDestroyed(struct livebox *pLivebox, int ret, void* pData);
+       static Eina_Bool OnPixmapDamaged(void* pData, int type, void* pEvent);
 
 private:
        friend class _LiveboxViewManager;
@@ -110,6 +113,7 @@ private:
        _LiveboxView* __pLiveboxView;
        std::unique_ptr<_LiveboxPopupViewEvent> __pLiveboxPopupViewEvent;
        bool __firstUpdated;
+       int __pixmap;
 
        struct _EvasObjectDeleter
        {
@@ -118,9 +122,27 @@ private:
                        evas_object_del(pEvasObject);
                }
        };
-
        std::unique_ptr<Evas_Object, _EvasObjectDeleter> __pPixmapObject;
-       int __pixmap;
+
+       struct _EcoreXDamageDeleter
+       {
+               typedef Ecore_X_Damage pointer;
+
+               void operator()(Ecore_X_Damage ecoreXDamage)
+               {
+                       ecore_x_damage_free(ecoreXDamage);
+               }
+       };
+       std::unique_ptr<Ecore_X_Damage, _EcoreXDamageDeleter> __pixmapDamage;
+
+       struct _EcoreEventHandlerDeleter
+       {
+               void operator()(Ecore_Event_Handler* pEcoreEventHandler)
+               {
+                       ecore_event_handler_del(pEcoreEventHandler);
+               }
+       };
+       std::unique_ptr<Ecore_Event_Handler, _EcoreEventHandlerDeleter> __pPixmapEventHandler;
 }; // _LiveboxPopupView
 
 }} // Tizen::Shell
index d4b901d..a2b607f 100644 (file)
@@ -20,7 +20,6 @@
  */
 
 #include <new>
-#include <Ecore_X.h>
 #include <livebox.h>
 #include <FBaseSysLog.h>
 #include <FBaseString.h>
@@ -415,6 +414,7 @@ _LiveboxView::OnLiveboxUpdated(int pixmap)
        int height = 0;\r
 \r
        ecore_x_pixmap_geometry_get(pixmap, &x, &y, &width, &height);
+       SysTryReturnVoidResult(NID_UI_CTRL, (width > 0) && (height > 0), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid [0x%x %d %d].", pixmap, width , height);
 
        if (__pixmap != pixmap )
        {
@@ -433,13 +433,14 @@ _LiveboxView::OnLiveboxUpdated(int pixmap)
                SysTryReturnVoidResult(NID_UI_CTRL, pEvas, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
                __pPixmapObject.reset(evas_object_image_filled_add(pEvas));
-               SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapObject.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+               SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapObject, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
 
                pEflNode->AddNativeSmartObject(*pVisualElement, __pPixmapObject.get());
 
                evas_object_image_size_set(__pPixmapObject.get(), width, height);
                evas_object_image_colorspace_set(__pPixmapObject.get(), EVAS_COLORSPACE_ARGB8888);\r
                evas_object_image_alpha_set(__pPixmapObject.get(), EINA_TRUE);\r
+               evas_object_raise(__pPixmapObject.get());\r
 \r
                Rectangle absoluteBounds = GetAbsoluteBounds();\r
 \r
@@ -455,6 +456,12 @@ _LiveboxView::OnLiveboxUpdated(int pixmap)
 
                evas_object_image_native_surface_set(__pPixmapObject.get(), &surface);
 
+               __pixmapDamage.reset(ecore_x_damage_new(pixmap, ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES));
+               SysTryReturnVoidResult(NID_UI_CTRL, __pixmapDamage.get() != 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+               __pPixmapEventHandler.reset(ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY, OnPixmapDamaged, (void*)this));
+               SysTryReturnVoidResult(NID_UI_CTRL, __pPixmapEventHandler, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
                SysLog(NID_UI_CTRL, "[0x%x]", surface.data.x11.pixmap);
        }
 
@@ -474,4 +481,36 @@ _LiveboxView::OnLiveboxUpdated(int pixmap)
        __pixmap = pixmap;
 }
 
+Eina_Bool
+_LiveboxView::OnPixmapDamaged(void* pData, int type, void* pEvent)
+{
+       _LiveboxView* pLiveboxView = static_cast<_LiveboxView*>(pData);
+       SysTryReturn(NID_UI_CTRL, pLiveboxView != null, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[[E_INVALID_ARG] The argument is invalid.");
+
+       Ecore_X_Event_Damage* pDamageEvent = static_cast<Ecore_X_Event_Damage*>(pEvent);
+       SysTryReturn(NID_UI_CTRL, pDamageEvent != null, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+
+       int pixmap = pLiveboxView->__pixmap;
+       SysTryReturn(NID_UI_CTRL, pDamageEvent->drawable == pixmap, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid [%d %d].", pDamageEvent->drawable, pixmap);
+
+       int x = 0;\r
+       int y = 0;\r
+       int width = 0;\r
+       int height = 0;\r
+\r
+       ecore_x_pixmap_geometry_get(pixmap, &x, &y, &width, &height);
+       SysTryReturn(NID_UI_CTRL, (width > 0) && (height > 0), ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid [0x%x %d %d].", pixmap, width , height);
+
+       Evas_Object* pPixmapObject = pLiveboxView->__pPixmapObject.get();
+       SysTryReturn(NID_UI_CTRL, pPixmapObject, ECORE_CALLBACK_PASS_ON, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
+
+       evas_object_image_pixels_dirty_set(pPixmapObject, EINA_TRUE);
+       evas_object_image_fill_set(pPixmapObject, 0, 0, width, height);
+       evas_object_image_data_update_add(pPixmapObject, 0, 0, width, height);
+
+       SysLog(NID_UI_CTRL, "[%d %d %d]", pixmap, width, height);
+
+       return ECORE_CALLBACK_DONE;
+}
+
 }} // Tizen::Shell
index 0eb36e4..6867f1c 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <unique_ptr.h>
 #include <Evas.h>
+#include <Ecore.h>
+#include <Ecore_X.h>
 #include "FUi_Control.h"
 #include "FUi_ITouchFlickGestureEventListener.h"
 #include "FUiAnim_VisualElement.h"
@@ -102,6 +104,8 @@ private:
        void OnLiveboxUpdated(const Tizen::Graphics::Bitmap& bitmap, const Tizen::Graphics::Dimension& size);
        void OnLiveboxUpdated(int pixmap);
 
+       static Eina_Bool OnPixmapDamaged(void* pData, int type, void* pEvent);
+
 private:
        std::unique_ptr<_LiveboxViewPresenter> __pLiveboxViewPresenter;
        std::unique_ptr<Tizen::Graphics::Bitmap> __pBitmap;
@@ -114,6 +118,7 @@ private:
        std::unique_ptr<Tizen::Ui::_TouchFlickGestureDetector> __pTouchFlickGestureDetector;
        bool __resizeFromRemote;
        bool __updated;
+       int __pixmap;
 
        struct _EvasObjectDeleter
        {
@@ -122,10 +127,27 @@ private:
                        evas_object_del(pEvasObject);
                }
        };
-
        std::unique_ptr<Evas_Object, _EvasObjectDeleter> __pPixmapObject;
 
-       int __pixmap;
+       struct _EcoreXDamageDeleter
+       {
+               typedef Ecore_X_Damage pointer;
+
+               void operator()(Ecore_X_Damage ecoreXDamage)
+               {
+                       ecore_x_damage_free(ecoreXDamage);
+               }
+       };
+       std::unique_ptr<Ecore_X_Damage, _EcoreXDamageDeleter> __pixmapDamage;
+
+       struct _EcoreEventHandlerDeleter
+       {
+               void operator()(Ecore_Event_Handler* pEcoreEventHandler)
+               {
+                       ecore_event_handler_del(pEcoreEventHandler);
+               }
+       };
+       std::unique_ptr<Ecore_Event_Handler, _EcoreEventHandlerDeleter> __pPixmapEventHandler;
 }; // _LiveboxView
 
 }} // Tizen::Shell
index 1e6c437..c3e0842 100644 (file)
@@ -47,12 +47,265 @@ extern "C"
 #include "FShell_LiveboxView.h"
 #include "FShell_LiveboxPopupView.h"
 
+//#define _PIXMAP_TEST
+
+#if defined(_PIXMAP_TEST)
+extern "C"
+{
+#include <stdio.h>
+#include <stdlib.h>
+#include <X11/Xproto.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <dri2.h>
+#define virtual UICTRL_INTERNAL_VIRTUAL_REDEFINE
+#define private UICTRL_INTERNAL_PRIVATE_REDEFINE
+#include <libdrm/drm_slp_bufmgr.h>
+#undef virtual
+#undef private
+}
+#endif // _PIXMAP_TEST
+
 using namespace std;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Graphics;
 using namespace Tizen::Media;
 
+namespace
+{
+
+#if defined(_PIXMAP_TEST)
+
+drm_slp_bufmgr __bufMgr = null;
+int __FileCount = 0;
+
+void
+dump_bmp(const char* pFileName, const void* pData, int width, int height)
+{
+       int i = 0;
+
+       struct
+       {
+               unsigned char magic[2];
+       } bmpfile_magic = { {'B', 'M'} };
+
+       struct
+       {
+               unsigned int filesz;
+               unsigned short creator1;
+               unsigned short creator2;
+               unsigned int bmp_offset;
+       } bmpfile_header = { 0, 0, 0, 0x36 };
+
+       struct
+       {
+               unsigned int header_sz;
+               unsigned int width;
+               unsigned int height;
+               unsigned short nplanes;
+               unsigned short bitspp;
+               unsigned int compress_type;
+               unsigned int bmp_bytesz;
+               unsigned int hres;
+               unsigned int vres;
+               unsigned int ncolors;
+               unsigned int nimpcolors;
+       } bmp_dib_v3_header_t = { 0x28, 0, 0, 1, 24, 0, 0, 0, 0, 0, 0 };
+
+       unsigned int* pBlocks = null;
+
+       FILE* pFile = fopen(pFileName, "w+");
+       if (pFile == null)
+       {
+               SysLog(NID_UI_CTRL, "failed to fopen [%s]", pFileName);
+               return;
+       }
+       else
+       {
+               bmpfile_header.filesz = sizeof(bmpfile_magic) + sizeof(bmpfile_header) + sizeof(bmp_dib_v3_header_t) + width * height * 3;
+               bmp_dib_v3_header_t.header_sz = sizeof(bmp_dib_v3_header_t);
+               bmp_dib_v3_header_t.width = width;
+               bmp_dib_v3_header_t.height = -height;
+               bmp_dib_v3_header_t.nplanes = 1;
+               bmp_dib_v3_header_t.bmp_bytesz = width * height * 3;
+
+               fwrite(&bmpfile_magic, sizeof(bmpfile_magic), 1, pFile);
+               fwrite(&bmpfile_header, sizeof(bmpfile_header), 1, pFile);
+               fwrite(&bmp_dib_v3_header_t, sizeof(bmp_dib_v3_header_t), 1, pFile);
+
+               pBlocks = (unsigned int*)pData;
+               for (i = 0; i < (height * width); i++)
+                       fwrite(&pBlocks[i], 3, 1, pFile);
+
+               fclose(pFile);
+       }
+
+       return;
+}
+
+drm_slp_bufmgr
+bufmgr_get(Display* pDisplay, Pixmap pixmap)
+{
+       int screen;
+       int drm_fd;
+       drm_slp_bufmgr bufmgr;
+       int eventBase, errorBase;
+       int dri2Major, dri2Minor;
+       char* pDriverName, *pDeviceName;
+       drm_magic_t magic;
+
+       screen = DefaultScreen(pDisplay);
+
+       /* DRI2 */
+       if (!DRI2QueryExtension (pDisplay, &eventBase, &errorBase))
+       {
+               SysLog(NID_UI_CTRL, "!!Error : DRI2QueryExtension !!\n");
+               return null;
+       }
+
+       if (!DRI2QueryVersion (pDisplay, &dri2Major, &dri2Minor))
+       {
+               SysLog(NID_UI_CTRL, "!!Error : DRI2QueryVersion !!\n");
+               return null;
+       }
+
+       if (!DRI2Connect (pDisplay, RootWindow(pDisplay, screen), &pDriverName, &pDeviceName))
+       {
+               SysLog(NID_UI_CTRL, "!!Error : DRI2Connect !!\n");
+               return null;
+       }
+
+       SysLog(NID_UI_CTRL, "Open drm device : %s\n", pDeviceName);
+
+       /* get the drm_fd though opening the deviceName */
+       drm_fd = open (pDeviceName, O_RDWR);
+       if (drm_fd < 0)
+       {
+               SysLog(NID_UI_CTRL, "!!Error : cannot open drm device (%s)\n", pDeviceName);
+               return null;
+       }
+
+       /* get the drm magic */
+       drmGetMagic(drm_fd, &magic);
+       printf("drm magic = %d \n", magic);
+
+       if (!DRI2Authenticate(pDisplay, RootWindow(pDisplay, screen), magic))
+       {
+               SysLog(NID_UI_CTRL, "!!Error : DRI2Authenticate !!\n");
+               close (drm_fd);
+               return null;
+       }
+
+       /* drm slp buffer manager init */
+       bufmgr = drm_slp_bufmgr_init (drm_fd, null);
+       if (!bufmgr)
+       {
+               SysLog(NID_UI_CTRL, "!!Error : failed to init buffer manager \n");
+               close (drm_fd);
+               return null;
+       }
+
+       DRI2CreateDrawable (pDisplay, pixmap);
+
+       return bufmgr;
+}
+
+void
+pixmap_update(Display* pDisplay, drm_slp_bufmgr bufmgr, Pixmap pixmap, int x, int y, int width, int height)
+{
+       DRI2Buffer* pDri2_buffers = null;
+       unsigned int attachments[1];
+       int dri2_count, dri2_out_count;
+       int dri2_width, dri2_height, dri2_stride;
+       drm_slp_bo bo;
+       int opt;
+       void* pVirtualBuf = null;
+       char imgFile[100] = {0,};
+
+       attachments[0] = DRI2BufferFrontLeft;
+       dri2_count = 1;
+       pDri2_buffers = DRI2GetBuffers (pDisplay, pixmap, &dri2_width, &dri2_height,
+               attachments, dri2_count, &dri2_out_count);
+
+       if (!pDri2_buffers)
+       {
+               SysLog(NID_UI_CTRL, "[Error] : failed to get buffers\n");
+               goto update_done;
+       }
+
+       if (!pDri2_buffers[0].name)
+       {
+               SysLog(NID_UI_CTRL, "[Error] : a handle of the dri2 buffer is null \n ");
+               goto update_done;
+       }
+
+       SysLog(NID_UI_CTRL, "pDri2_buffers[0].name : %d", pDri2_buffers[0].name);
+
+       bo = drm_slp_bo_import(bufmgr, pDri2_buffers[0].name);
+       if (!bo)
+       {
+               SysLog(NID_UI_CTRL, "[Error] : cannot import bo (key:%d)\n", pDri2_buffers[0].name);
+               goto update_done;
+       }
+
+       dri2_stride = pDri2_buffers[0].pitch;
+
+       opt = DRM_SLP_OPTION_READ|DRM_SLP_OPTION_WRITE;
+       pVirtualBuf = (void*)drm_slp_bo_map (bo, DRM_SLP_DEVICE_CPU, opt);
+       if (!pVirtualBuf)
+       {
+               SysLog(NID_UI_CTRL, "[Error] : failed to map \n");
+               goto update_done;
+       }
+
+       memset(imgFile, 0, sizeof(imgFile));
+       sprintf(imgFile,"./dump%d.bmp", __FileCount++);
+       dump_bmp(imgFile, pVirtualBuf, dri2_width, dri2_height);
+
+update_done:
+       if (pVirtualBuf)
+               drm_slp_bo_unmap(bo, DRM_SLP_DEVICE_CPU);
+       if (bo)
+               drm_slp_bo_unref(bo);
+       if (pDri2_buffers)
+               free(pDri2_buffers);
+}
+
+void
+DumpPixmap(int pixmap)
+{
+       int x = 0;\r
+       int y = 0;\r
+       int width = 0;\r
+       int height = 0;\r
+\r
+       ecore_x_pixmap_geometry_get(pixmap, &x, &y, &width, &height);
+       SysTryReturnVoidResult(NID_UI_CTRL, (width > 0) && (height > 0), E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid [0x%x %d %d].", pixmap, width , height);
+
+       if (__bufMgr)
+       {
+               drm_slp_bufmgr_destroy(__bufMgr);
+               __bufMgr = null;
+       }
+
+       if (__bufMgr == null)
+               __bufMgr = bufmgr_get((Display*)ecore_x_display_get(), pixmap);
+
+       if (__bufMgr != null)
+       {
+               pixmap_update((Display*)ecore_x_display_get(), __bufMgr, pixmap, 0, 0, width, height);
+       }
+       else
+               SysLog(NID_UI_CTRL, "can't get pixmap __bufMgr");
+
+       SysLog(NID_UI_CTRL, "dump pixmap [%d]", pixmap);
+}
+
+#endif // _PIXMAP_TEST
+
+}
+
 namespace Tizen { namespace Graphics
 {
 result _CreateCoordinateTransformer(_ICoordinateSystemTransformer*&, _LogicalResolution, _BaseScreenSize, _PhysicalResolution, _BaseScreenSize);
@@ -200,7 +453,7 @@ _LiveboxViewManager::_LiveboxViewManager(void)
        SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
        __pViewMap = move(pViewMap);
-       __glMode = IsGlMode();
+//     __glMode = IsGlMode();
 
 //     r = _CreateCoordinateTransformer(__pCoordinateTransformer, sourceResolution, BASE_SCREEN_SIZE_NORMAL, destResolution, BASE_SCREEN_SIZE_NORMAL);
 //     SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
@@ -373,6 +626,10 @@ _LiveboxViewManager::OnLiveboxUpdated(livebox* pLivebox)
                if (__glMode)
                {
                        pLiveboxView->OnLiveboxUpdated(livebox_lb_pixmap(pLivebox));
+
+#if defined(_PIXMAP_TEST)
+                       DumpPixmap(livebox_lb_pixmap(pLivebox));
+#endif // _PIXMAP_TEST
                }
                else
                {
@@ -441,6 +698,9 @@ _LiveboxViewManager::OnLiveboxPopupUpdated(livebox* pLivebox)
                if (__glMode)
                {
                        pLiveboxPopupView->OnLiveboxUpdated(livebox_pd_pixmap(pLivebox));
+#if defined(_PIXMAP_TEST)
+                       DumpPixmap(livebox_pd_pixmap(pLivebox));
+#endif // _PIXMAP_TEST
                }
                else
                {