From: woo Date: Thu, 9 May 2013 01:00:25 +0000 (+0900) Subject: remove privacy log and unnecessarily code X-Git-Tag: submit/tizen_2.1/20130514.054411~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d4dd2c92aa73cdd315aed7de5d10046a0017e8f;p=framework%2Fosp%2Fuifw.git remove privacy log and unnecessarily code Change-Id: Iee6a79a714c230d87e7fe717d100833cdd639240 Signed-off-by: woo --- diff --git a/src/ui/controls/FUiCtrl_OverlayAgent.cpp b/src/ui/controls/FUiCtrl_OverlayAgent.cpp index d55da98..e852a4e 100644 --- a/src/ui/controls/FUiCtrl_OverlayAgent.cpp +++ b/src/ui/controls/FUiCtrl_OverlayAgent.cpp @@ -23,23 +23,6 @@ #include #include #include - -#define OVERLAY_PIXMAP_DUMP 0 - -#if OVERLAY_PIXMAP_DUMP -extern "C"{ -#include -#include -#include - -#include -#include -#include -#include -#include -} -#endif //OVERLAY_PIXMAP_DUMP - #include #include @@ -79,197 +62,6 @@ const int _ROTATION_180 = 180; const int _ROTATION_270 = 270; const int _ROTATION_360 = 360; -#if OVERLAY_PIXMAP_DUMP - -tbm_bufmgr gTbmBufmgr = null; -int gFileCount = 0; -int gDrmFd = -1; - -void -dump_bmp(const char* pFileName, const void* pData, int width, int height) -{ - FILE* pFile = null; - - 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 }; - - if (pFileName != null) - { - pFile = fopen(pFileName, "w+"); - } - - if (pFile == null) - { - SysSecureLog(NID_UI_CTRL,"Failed to open %s", pFileName); - return; - } - - 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); - - unsigned int* pBlocks = (unsigned int*)pData; - - for (int i = 0; i < (height * width); i++) - { - fwrite(&pBlocks[i], 3, 1, pFile); - } - fclose(pFile); - - return; -} - -tbm_bufmgr -bufmgr_get(Display* pDisplay, Pixmap pixmap) -{ - int screen = DefaultScreen(pDisplay); - - // DRI2 - int eventBase = 0; - int errorBase = 0; - if (!DRI2QueryExtension(pDisplay, &eventBase, &errorBase)) - { - SysSecureLog(NID_UI_CTRL, "Failed to get value of DRI2QueryExtension."); - return null; - } - - int dri2Major = 0; - int dri2Minor = 0; - if (!DRI2QueryVersion(pDisplay, &dri2Major, &dri2Minor)) - { - SysSecureLog(NID_UI_CTRL, "Failed to get value of DRI2QueryVersion."); - return null; - } - - char* pDriverName = null; - char* pDeviceName = null; - if (!DRI2Connect(pDisplay, RootWindow(pDisplay, screen), &pDriverName, &pDeviceName)) - { - SysSecureLog(NID_UI_CTRL, "Failed to get value of DRI2Connect."); - return null; - } - - SysSecureLog(NID_UI_CTRL, "The current name of open drm device is %s.", pDeviceName); - - // Get the drm_fd though opening the deviceName - gDrmFd = open(pDeviceName, O_RDWR); - if (gDrmFd < 0) - { - SysSecureLog(NID_UI_CTRL, "Failed to open drm device (%s)", pDeviceName); - return null; - } - - // Get the drm magic - drm_magic_t magic; - drmGetMagic(gDrmFd, &magic); - if (!DRI2Authenticate(pDisplay, RootWindow(pDisplay, screen), magic)) - { - SysSecureLog(NID_UI_CTRL, "Failed to get value of DRI2Authenticate."); - close(gDrmFd); - gDrmFd = -1; - return null; - } - - // tbm buffer manager init - tbm_bufmgr bufmgr = tbm_bufmgr_init(gDrmFd); - if (!bufmgr) - { - SysSecureLog(NID_UI_CTRL, "Failed to initialize buffer manager."); - close(gDrmFd); - gDrmFd = -1; - return null; - } - - DRI2CreateDrawable(pDisplay, pixmap); - - return bufmgr; -} - -static void -pixmap_update (Display* pDisplay, tbm_bufmgr bufmgr, Pixmap pixmap, int x, int y, int width, int height) -{ - int dri2_width = 0; - int dri2_height = 0; - unsigned int attachments[1] = { DRI2BufferFrontLeft }; - int dri2_count = 1; - int dri2_out_count = 0; - - int opt = TBM_OPTION_READ|TBM_OPTION_WRITE; - char imgFile[100] = {0,}; - - tbm_bo bo; - tbm_bo_handle bo_handle; - - DRI2Buffer* pDri2_buffers = DRI2GetBuffers (pDisplay, pixmap, &dri2_width, &dri2_height, attachments, dri2_count, &dri2_out_count); - SysTryLogCatch(NID_UI_CTRL, pDri2_buffers != null, , "Failed to get buffers."); - SysTryLogCatch(NID_UI_CTRL, pDri2_buffers[0].name != null, , "Failed to get a handle of the dri2 buffer."); - - SysSecureLog(NID_UI_CTRL, "The current name of Dri2_buffers[0] is %d.", pDri2_buffers[0].name); - - bo = tbm_bo_import(bufmgr, pDri2_buffers[0].name); - SysTryLogCatch(NID_UI_CTRL, bo != null, , "Failed to import bo (key : %d).", pDri2_buffers[0].name); - - bo_handle = tbm_bo_map(bo, TBM_DEVICE_CPU, opt); - SysTryLogCatch(NID_UI_CTRL, bo_handle.ptr != null, , "Failed to get map."); - - memset(imgFile, 0, sizeof(imgFile)); - sprintf(imgFile,"./dump%d.bmp", gFileCount++); - - if (gFileCount == 5 || gFileCount == 20) - { - dump_bmp(imgFile, bo_handle.ptr, dri2_width, dri2_height); - } - -CATCH: - if (bo_handle.ptr) - { - tbm_bo_unmap(bo); - } - - if (bo) - { - tbm_bo_unref(bo); - } - - if (pDri2_buffers) - { - free(pDri2_buffers); - } -} -#endif // OVERLAY_PIXMAP_DUMP - bool _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) { @@ -299,15 +91,6 @@ _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) return false; } -// SysLog(NID_UI_CTRL, "========================================"); -// SysLog(NID_UI_CTRL, "XvQueryExtension returned the following:"); -// SysLog(NID_UI_CTRL, "version : %u", version); -// SysLog(NID_UI_CTRL, "release : %u", release); -// SysLog(NID_UI_CTRL, "request_base : %u", requestBase); -// SysLog(NID_UI_CTRL, "event_base : %u", eventBase); -// SysLog(NID_UI_CTRL, "error_base : %u", errorBase); -// SysLog(NID_UI_CTRL, "========================================"); - unsigned int adaptors = 0; XvAdaptorInfo* pAdaptorInfo = null; returnValue = XvQueryAdaptors(pDisplay, DefaultRootWindow(pDisplay), &adaptors, &pAdaptorInfo); @@ -334,28 +117,11 @@ _CheckXvExtension(Display* pDisplay, int* pFirstPort, int* pCountPort) return false; } -// SysLog(NID_UI_CTRL, "XvQueryAdaptors returned the following:"); -// SysLog(NID_UI_CTRL, "%d adaptors available.", adaptors); - int port = -1; if (adaptors > 0 && pAdaptorInfo != null) { for (unsigned int i = 0; i < adaptors; i++) { - // SysLog(NID_UI_CTRL, " name: %s" - // " type: %s%s%s%s%s" - // " first port: %ld" - // " ports: %ld", - // pAdaptorInfo[i].name, - // (pAdaptorInfo[i].type & XvInputMask) ? "input | " : "", - // (pAdaptorInfo[i].type & XvOutputMask) ? "output | " : "", - // (pAdaptorInfo[i].type & XvVideoMask) ? "video | " : "", - // (pAdaptorInfo[i].type & XvStillMask) ? "still | " : "", - // (pAdaptorInfo[i].type & XvImageMask) ? "image | " : "", - // pAdaptorInfo[i].base_id, - // pAdaptorInfo[i].num_ports); - // SysLog(NID_UI_CTRL, " format list: %d", i); - for (unsigned int j = 0; j < pAdaptorInfo[i].num_formats; j++) { SysSecureLog(NID_UI_CTRL, "The current value of depth is %d and visual is %ld.", @@ -409,38 +175,6 @@ OnPixmapDamaged(void* pData, int type, void* pEvent) evas_object_image_filled_set(pImageObject, EINA_TRUE); evas_object_image_data_update_add(pImageObject, 0, 0, w, h); -#if OVERLAY_PIXMAP_DUMP - - if (gDrmFd > -1) - { - close(gDrmFd); - gDrmFd = -1; - } - - if (gTbmBufmgr) - { - tbm_bufmgr_deinit(gTbmBufmgr); - gTbmBufmgr = null; - } - - if (gTbmBufmgr == null) - { - gTbmBufmgr = bufmgr_get((Display*)ecore_x_display_get(), pixmap); - } - - if (gTbmBufmgr != null) - { - pixmap_update((Display*)ecore_x_display_get(), gTbmBufmgr, pixmap, 0, 0, w, h); - } - else - { - SysSecureLog(NID_UI_CTRL, "can't get pixmap gBufmgr"); - } - - SysSecureLog(NID_UI_CTRL, "dump pixmap[%d]", pixmap); - -#endif // OVERLAY_PIXMAP_DUMP - return ECORE_CALLBACK_DONE; } @@ -479,7 +213,7 @@ namespace Tizen { namespace Ui { namespace Controls { int _OverlayAgent::__overlayAgentXvPortCount = 0; int _OverlayAgent::__baseXvPort = 0; -bool _OverlayAgent::__isPortGrapped[]={false,}; +bool _OverlayAgent::__isPortGrabbed[]={false,}; int _OverlayAgent::__overlayAgentcount = 0; int _OverlayAgent::__dstRectMinWidth = -1; @@ -628,22 +362,6 @@ _OverlayAgent::~_OverlayAgent(void) __pVisualElement = null; } -#if OVERLAY_PIXMAP_DUMP - - if (gDrmFd > -1) - { - close(gDrmFd); - gDrmFd = -1; - } - - if (gTbmBufmgr) - { - tbm_bufmgr_deinit(gTbmBufmgr); - gTbmBufmgr = null; - } - -#endif //OVERLAY_PIXMAP_DUMP - } result @@ -1172,7 +890,7 @@ _OverlayAgent::GrabXvPort(void) int i, tempPort = 0; for (i = 0; i < portCount; i++) { - if(!__isPortGrapped[i]) + if(!__isPortGrabbed[i]) { tempPort = firstXvPort + i; if (XvGrabPort(pDisplay, tempPort, 0) != Success) @@ -1183,7 +901,7 @@ _OverlayAgent::GrabXvPort(void) { __xvPort = tempPort; __grabXvPort = true; - __isPortGrapped[i] = true; + __isPortGrabbed[i] = true; break; } } @@ -1405,7 +1123,7 @@ _OverlayAgent::UngrabXvPort(void) SysSecureLog(NID_UI_CTRL, "The current value of UngrabXvPort port is %d, pixmap is %d and style is %d", __xvPort, __pixmap, __style); - __isPortGrapped[__xvPort-__baseXvPort] = false; + __isPortGrabbed[__xvPort-__baseXvPort] = false; __xvPort = -1; __grabXvPort = false; __overlayAgentXvPortCount--; diff --git a/src/ui/inc/FUiCtrl_OverlayAgent.h b/src/ui/inc/FUiCtrl_OverlayAgent.h index 1dfca3f..515d6e6 100644 --- a/src/ui/inc/FUiCtrl_OverlayAgent.h +++ b/src/ui/inc/FUiCtrl_OverlayAgent.h @@ -195,7 +195,7 @@ private: static int __overlayAgentcount; static int __overlayAgentXvPortCount; static int __baseXvPort; - static bool __isPortGrapped[_OVERLAYAGENT_XV_PORT]; + static bool __isPortGrabbed[_OVERLAYAGENT_XV_PORT]; // staticutil variable static int __dstRectMinWidth;