void
_AppWidgetBuffer::_GemBuffer::DeleteGemBuffer(void)
{
- if (__pCompensateBuffer)\r
- {\r
- free(__pCompensateBuffer);\r
- __pCompensateBuffer = null;\r
- }\r
-\r
- if (__pTbmBo)\r
- {\r
- tbm_bo_unref(__pTbmBo);\r
- __pTbmBo = null;\r
-\r
- DRI2DestroyDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);\r
+ if (__pCompensateBuffer)
+ {
+ free(__pCompensateBuffer);
+ __pCompensateBuffer = null;
+ }
+
+ if (__pTbmBo)
+ {
+ tbm_bo_unref(__pTbmBo);
+ __pTbmBo = null;
+
+ DRI2DestroyDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);
}
}
void
_AppWidgetBuffer::_GemBuffer::OnCreateBuffer(void)
{
- SysLog(NID_SHELL, "[%f %f]", __size.width, __size.height);\r
-\r
- unsigned int pitch = 0;\r
-\r
- DRI2CreateDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);\r
-\r
- int width = static_cast<int>(__size.width);\r
- int height = static_cast<int>(__size.height);\r
-\r
- __pDri2Buffer = DRI2GetBuffers(__pAppWidgetBuffer->__pDisplay.get(), __pixmap, &width, &height, __attachments, __count, &__outCount);\r
- SysTryCatch(NID_SHELL, __pDri2Buffer && __pDri2Buffer->name, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
-\r
- __gemSize.width = width;\r
- __gemSize.height = height;\r
-\r
- SysLog(NID_SHELL, "0x%x [%d %d %d] [%d %d]", __pDri2Buffer, __outCount, __pDri2Buffer->name, __pDri2Buffer->pitch, width, height);\r
-\r
- __pTbmBo = tbm_bo_import(__pAppWidgetBuffer->__pBufMgr.get(), __pDri2Buffer->name);\r
- SysTryCatch(NID_SHELL, __pTbmBo, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
- \r
- pitch = __gemSize.width * __depth;\r
- if (__pDri2Buffer->pitch != pitch)\r
- {\r
- __pCompensateBuffer = calloc(1, pitch * __gemSize.height);\r
- SysTryCatch(NID_SHELL, __pCompensateBuffer, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");\r
-\r
- SysLog(NID_SHELL, "0x%x [%d %d %d]", __pCompensateBuffer, __depth, __gemSize.width, __gemSize.height);\r
- }\r
-\r
- return;\r
-\r
-CATCH:\r
-\r
+ SysLog(NID_SHELL, "[%f %f]", __size.width, __size.height);
+
+ unsigned int pitch = 0;
+
+ DRI2CreateDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);
+
+ int width = static_cast<int>(__size.width);
+ int height = static_cast<int>(__size.height);
+
+ __pDri2Buffer = DRI2GetBuffers(__pAppWidgetBuffer->__pDisplay.get(), __pixmap, &width, &height, __attachments, __count, &__outCount);
+ SysTryCatch(NID_SHELL, __pDri2Buffer && __pDri2Buffer->name, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+ __gemSize.width = width;
+ __gemSize.height = height;
+
+ SysLog(NID_SHELL, "0x%x [%d %d %d] [%d %d]", __pDri2Buffer, __outCount, __pDri2Buffer->name, __pDri2Buffer->pitch, width, height);
+
+ __pTbmBo = tbm_bo_import(__pAppWidgetBuffer->__pBufMgr.get(), __pDri2Buffer->name);
+ SysTryCatch(NID_SHELL, __pTbmBo, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+ pitch = __gemSize.width * __depth;
+ if (__pDri2Buffer->pitch != pitch)
+ {
+ __pCompensateBuffer = calloc(1, pitch * __gemSize.height);
+ SysTryCatch(NID_SHELL, __pCompensateBuffer, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+ SysLog(NID_SHELL, "0x%x [%d %d %d]", __pCompensateBuffer, __depth, __gemSize.width, __gemSize.height);
+ }
+
+ return;
+
+CATCH:
+
DRI2DestroyDrawable(__pAppWidgetBuffer->__pDisplay.get(), __pixmap);
}
{
if (!__pGemBuffer)
{
- tbm_bo_handle handle;\r
- handle = tbm_bo_map(__pTbmBo, TBM_DEVICE_CPU, TBM_OPTION_READ | TBM_OPTION_WRITE);\r
+ tbm_bo_handle handle;
+ handle = tbm_bo_map(__pTbmBo, TBM_DEVICE_CPU, TBM_OPTION_READ | TBM_OPTION_WRITE);
__pGemBuffer = handle.ptr;
}
void
_AppWidgetBuffer::_GemBuffer::OnUnlockBuffer(void)
{
- if (__pCompensateBuffer)\r
- {\r
- int* pPixel = (int*)__pCompensateBuffer;\r
- int* pGemPixel = (int*)__pGemBuffer;\r
- int gap = __pDri2Buffer->pitch - (__gemSize.width * __depth);\r
-\r
- for (int y = 0; y < __gemSize.height; y++)\r
- {\r
- for (int x = 0; x < __gemSize.width; x++)\r
- {\r
- *pGemPixel++ = *pPixel++;\r
- }\r
-\r
- pGemPixel = (int*)(((char*)pGemPixel) + gap);\r
- }\r
- }\r
-\r
- tbm_bo_unmap(__pTbmBo);\r
+ if (__pCompensateBuffer)
+ {
+ int* pPixel = (int*)__pCompensateBuffer;
+ int* pGemPixel = (int*)__pGemBuffer;
+ int gap = __pDri2Buffer->pitch - (__gemSize.width * __depth);
+
+ for (int y = 0; y < __gemSize.height; y++)
+ {
+ for (int x = 0; x < __gemSize.width; x++)
+ {
+ *pGemPixel++ = *pPixel++;
+ }
+
+ pGemPixel = (int*)(((char*)pGemPixel) + gap);
+ }
+ }
+
+ tbm_bo_unmap(__pTbmBo);
__pGemBuffer = null;
}
r = __pAppWidgetPopupPresenter->Initialize();
SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- r = CreateRootVisualElement();\r
- SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- FloatRectangle bounds(0.0f, 0.0f, 1.0f, 1.0f);\r
- r = SetBounds(bounds);\r
- SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- r = __pAppWidgetPopupPresenter->Initialize();\r
- SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- __pAppWidgetPopupLayer->SetLayerBounds(bounds);\r
- __pAppWidgetPopupLayer->SetShowState(false);\r
-\r
- __pAppWidgetPopupRootVisualElement->SetImplicitAnimationEnabled(false);\r
- __pAppWidgetPopupRootVisualElement->SetName(L"_AppWidgetPopup");\r
- __pAppWidgetPopupRootVisualElement->SetBounds(bounds);\r
- __pAppWidgetPopupRootVisualElement->SetShowState(false);\r
-\r
- SetBackgroundColor(Color(0, 0, 0, 0));\r
-\r
- __pEventManager->RegisterTouchEventHandler(*this);\r
- r = GetLastResult();\r
+ r = CreateRootVisualElement();
+ SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ FloatRectangle bounds(0.0f, 0.0f, 1.0f, 1.0f);
+ r = SetBounds(bounds);
+ SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = __pAppWidgetPopupPresenter->Initialize();
+ SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pAppWidgetPopupLayer->SetLayerBounds(bounds);
+ __pAppWidgetPopupLayer->SetShowState(false);
+
+ __pAppWidgetPopupRootVisualElement->SetImplicitAnimationEnabled(false);
+ __pAppWidgetPopupRootVisualElement->SetName(L"_AppWidgetPopup");
+ __pAppWidgetPopupRootVisualElement->SetBounds(bounds);
+ __pAppWidgetPopupRootVisualElement->SetShowState(false);
+
+ SetBackgroundColor(Color(0, 0, 0, 0));
+
+ __pEventManager->RegisterTouchEventHandler(*this);
+ r = GetLastResult();
SysTryReturn(NID_SHELL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;