From 94d23a0aac38996a21dc7a4569bc585568793593 Mon Sep 17 00:00:00 2001 From: dengzhihao Date: Fri, 18 Jun 2021 11:07:16 +0800 Subject: [PATCH] IssueNo:#I3W2Fn Description:add hilog Sig:graphic Feature or Bugfix:Feature Binary Source:No Signed-off-by: dengzhihao Change-Id: Ib45717c8b700184d823c022da89a008cebd5c0db Change-Id: Idbdfac40cf9a599a5fc80efe9769c6bb52d5ba63 --- frameworks/ims/input_event_listener_proxy.cpp | 14 ++++---- frameworks/wms/lite_proxy_surface.cpp | 8 ++--- frameworks/wms/lite_proxy_windows_manager.cpp | 2 +- frameworks/wms/lite_win_requestor.cpp | 20 +++++------ frameworks/wms/lite_wm_requestor.cpp | 20 +++++------ frameworks/wms/lite_wms_client.cpp | 4 +-- services/ims/input_event_client_proxy.cpp | 6 ++-- services/ims/input_event_hub.cpp | 16 ++++----- services/ims/input_manager_service.cpp | 2 +- services/ims/samgr_ims.cpp | 8 ++--- services/wms/lite_win.cpp | 19 +++++----- services/wms/lite_wm.cpp | 35 ++++++++++--------- services/wms/lite_wms.cpp | 30 ++++++++-------- services/wms/samgr_wms.cpp | 4 +-- test/sample_ui.cpp | 2 +- test/sample_window.cpp | 4 +-- 16 files changed, 99 insertions(+), 95 deletions(-) diff --git a/frameworks/ims/input_event_listener_proxy.cpp b/frameworks/ims/input_event_listener_proxy.cpp index 6807dc5..6004c6b 100755 --- a/frameworks/ims/input_event_listener_proxy.cpp +++ b/frameworks/ims/input_event_listener_proxy.cpp @@ -38,12 +38,12 @@ bool InputEventListenerProxy::GetIClientProxy() if (proxy_ == nullptr) { IUnknown *iUnknown = SAMGR_GetInstance()->GetDefaultFeatureApi(IMS_SERVICE_NAME); if (iUnknown == nullptr) { - GRAPHIC_LOGE("iUnknown is NULL"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "iUnknown is NULL"); return false; } (void)iUnknown->QueryInterface(iUnknown, CLIENT_PROXY_VER, (void **)&proxy_); if (proxy_ == nullptr) { - GRAPHIC_LOGE("QueryInterface failed, IClientProxy is empty!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "QueryInterface failed, IClientProxy is empty!"); return false; } } @@ -58,7 +58,7 @@ int32_t InputEventListenerProxy::ReceiveMsgHandler(const IpcContext* context, vo uint32_t size; RawEvent* eventTemp = static_cast(IpcIoPopFlatObj(io, &size)); if (eventTemp == nullptr) { - GRAPHIC_LOGE("pop raw event failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "pop raw event failed."); return -1; } RawEvent event = *eventTemp; @@ -70,12 +70,12 @@ int32_t InputEventListenerProxy::ReceiveMsgHandler(const IpcContext* context, vo bool InputEventListenerProxy::RegisterInputEventListener(RawEventListener* listener) { if (listener == nullptr) { - GRAPHIC_LOGE("Input event listener is empty."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Input event listener is empty."); return false; } if (!GetIClientProxy()) { - GRAPHIC_LOGE("Get input event client proxy failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Get input event client proxy failed."); return false; } IpcIo io; @@ -83,14 +83,14 @@ bool InputEventListenerProxy::RegisterInputEventListener(RawEventListener* liste IpcIoInit(&io, tmpData, IMS_DEFAULT_IPC_SIZE, 1); SvcIdentity svc; if (RegisterIpcCallback(ReceiveMsgHandler, 0, IPC_WAIT_FOREVER, &svc, NULL) != LITEIPC_OK) { - GRAPHIC_LOGE("RegisterIpcCallback failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "RegisterIpcCallback failed."); return false; } IpcIoPushSvc(&io, &svc); IpcIoPushBool(&io, listener->IsAlwaysInvoke()); int32_t ret = proxy_->Invoke(proxy_, LITEIMS_CLIENT_REGISTER, &io, NULL, NULL); if (ret != 0) { - GRAPHIC_LOGE("Client register failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Client register failed, ret=%d", ret); return false; } listener_ = listener; diff --git a/frameworks/wms/lite_proxy_surface.cpp b/frameworks/wms/lite_proxy_surface.cpp index 7b26da8..b27290a 100755 --- a/frameworks/wms/lite_proxy_surface.cpp +++ b/frameworks/wms/lite_proxy_surface.cpp @@ -28,7 +28,7 @@ LiteProxySurface::~LiteProxySurface() void LiteProxySurface::Lock(void** buf, void** phyMem, uint32_t* strideLen) { - GRAPHIC_LOGI("Lock"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Lock"); if (surface_ == nullptr) { return; } @@ -36,7 +36,7 @@ void LiteProxySurface::Lock(void** buf, void** phyMem, uint32_t* strideLen) if (buffer_ == nullptr) { buffer_ = surface_->RequestBuffer(); if (buffer_ == nullptr) { - GRAPHIC_LOGE("buffer_ is null!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "buffer_ is null!"); *buf = nullptr; *phyMem = nullptr; *strideLen = 0; @@ -47,7 +47,7 @@ void LiteProxySurface::Lock(void** buf, void** phyMem, uint32_t* strideLen) uintptr_t phyAddr = buffer_->GetPhyAddr(); *phyMem = (void*)phyAddr; *strideLen = surface_->GetStride(); - GRAPHIC_LOGI("strideLen=%d", *strideLen); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "strideLen=%d", *strideLen); } void LiteProxySurface::Unlock() @@ -56,7 +56,7 @@ void LiteProxySurface::Unlock() return; } - GRAPHIC_LOGI("Unlock"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Unlock"); surface_->FlushBuffer(buffer_); buffer_ = nullptr; } diff --git a/frameworks/wms/lite_proxy_windows_manager.cpp b/frameworks/wms/lite_proxy_windows_manager.cpp index 7e1fe2e..7269f1c 100755 --- a/frameworks/wms/lite_proxy_windows_manager.cpp +++ b/frameworks/wms/lite_proxy_windows_manager.cpp @@ -23,7 +23,7 @@ namespace OHOS { int LiteProxyWindowsManager::Init() { - GRAPHIC_LOGI("Init"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Init"); LiteWMSClient::GetInstance()->InitLiteWMSClient(); LiteWMRequestor::GetInstance()->ClientRegister(); LiteWMRequestor::GetInstance()->GetLayerInfo(); diff --git a/frameworks/wms/lite_win_requestor.cpp b/frameworks/wms/lite_win_requestor.cpp index e5a732f..629e48c 100755 --- a/frameworks/wms/lite_win_requestor.cpp +++ b/frameworks/wms/lite_win_requestor.cpp @@ -36,7 +36,7 @@ LiteWinRequestor::~LiteWinRequestor() int LiteWinRequestor::Callback(void* owner, int code, IpcIo* reply) { if (code != 0) { - GRAPHIC_LOGE("callback error, code = %d", code); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "callback error, code = %d", code); return -1; } @@ -45,7 +45,7 @@ int LiteWinRequestor::Callback(void* owner, int code, IpcIo* reply) } CallBackPara* para = (CallBackPara*)owner; - GRAPHIC_LOGD("Callback, funcId = %d", para->funcId); + HILOG_DEBUG(HILOG_MODULE_GRAPHIC, "Callback, funcId = %d", para->funcId); switch (para->funcId) { case LiteWMS_GetSurface: { LiteWinRequestor* requestor = (LiteWinRequestor*)(para->data); @@ -79,7 +79,7 @@ Surface* LiteWinRequestor::GetSurface() para.data = this; int32_t ret = proxy_->Invoke(proxy_, LiteWMS_GetSurface, &io, ¶, Callback); if (ret != 0) { - GRAPHIC_LOGE("GetSurface failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "GetSurface failed, ret=%d", ret); } } return surface_; @@ -94,7 +94,7 @@ void LiteWinRequestor::Show() int32_t ret = proxy_->Invoke(proxy_, LiteWMS_Show, &io, NULL, NULL); if (ret != 0) { - GRAPHIC_LOGE("Show failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Show failed, ret=%d", ret); } } @@ -107,7 +107,7 @@ void LiteWinRequestor::Hide() int32_t ret = proxy_->Invoke(proxy_, LiteWMS_Hide, &io, NULL, NULL); if (ret != 0) { - GRAPHIC_LOGE("Hide failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Hide failed, ret=%d", ret); } } @@ -120,7 +120,7 @@ void LiteWinRequestor::RaiseToTop() int32_t ret = proxy_->Invoke(proxy_, LiteWMS_RaiseToTop, &io, NULL, NULL); if (ret != 0) { - GRAPHIC_LOGE("RaiseToTop failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "RaiseToTop failed, ret=%d", ret); } } @@ -133,7 +133,7 @@ void LiteWinRequestor::LowerToBottom() int32_t ret = proxy_->Invoke(proxy_, LiteWMS_LowerToBottom, &io, NULL, NULL); if (ret != 0) { - GRAPHIC_LOGE("LowerToBottom failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "LowerToBottom failed, ret=%d", ret); } } @@ -148,7 +148,7 @@ void LiteWinRequestor::MoveTo(int16_t x, int16_t y) int32_t ret = proxy_->Invoke(proxy_, LiteWMS_MoveTo, &io, NULL, NULL); if (ret != 0) { - GRAPHIC_LOGE("MoveTo failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "MoveTo failed, ret=%d", ret); } } @@ -163,7 +163,7 @@ void LiteWinRequestor::Resize(int16_t width, int16_t height) int32_t ret = proxy_->Invoke(proxy_, LiteWMS_Resize, &io, NULL, Callback); if (ret != 0) { - GRAPHIC_LOGE("Resize failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Resize failed, ret=%d", ret); } } @@ -176,7 +176,7 @@ void LiteWinRequestor::Update() int32_t ret = proxy_->Invoke(proxy_, LiteWMS_Update, &io, NULL, NULL); if (ret != 0) { - GRAPHIC_LOGE("Update failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Update failed, ret=%d", ret); } } } // namespace OHOS diff --git a/frameworks/wms/lite_wm_requestor.cpp b/frameworks/wms/lite_wm_requestor.cpp index a652c41..40c6774 100755 --- a/frameworks/wms/lite_wm_requestor.cpp +++ b/frameworks/wms/lite_wm_requestor.cpp @@ -46,7 +46,7 @@ int LiteWMRequestor::Callback(void* owner, int code, IpcIo* reply) break; } int32_t id = IpcIoPopInt32(reply); - GRAPHIC_LOGI("CreateWindow, id=%d", id); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "CreateWindow, id=%d", id); if (id == INVALID_WINDOW_ID) { *requestor = nullptr; } else { @@ -66,7 +66,7 @@ int LiteWMRequestor::Callback(void* owner, int code, IpcIo* reply) case LiteWMS_Screenshot: { int32_t ret = IpcIoPopInt32(reply); if (ret != LiteWMS_EOK) { - GRAPHIC_LOGW("Screenshot busy!"); + HILOG_WARN(HILOG_MODULE_GRAPHIC, "Screenshot busy!"); LiteWMRequestor::GetInstance()->ScreenShotClearup(); } break; @@ -100,13 +100,13 @@ void LiteWMRequestor::ClientRegister() SvcIdentity svc; if (RegisterIpcCallback(WmsMsgHandler, 0, IPC_WAIT_FOREVER, &svc, NULL) != LITEIPC_OK) { - GRAPHIC_LOGE("RegisterIpcCallback failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "RegisterIpcCallback failed."); return; } IpcIoPushSvc(&io, &svc); int32_t ret = proxy_->Invoke(proxy_, LiteWMS_ClientRegister, &io, NULL, Callback); if (ret != 0) { - GRAPHIC_LOGE("ClientRegister failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "ClientRegister failed, ret=%d", ret); } } @@ -121,7 +121,7 @@ void LiteWMRequestor::GetLayerInfo() para.data = &layerInfo_; int32_t ret = proxy_->Invoke(proxy_, LiteWMS_GetLayerInfo, &io, ¶, Callback); if (ret != 0) { - GRAPHIC_LOGE("GetLayerInfo failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "GetLayerInfo failed, ret=%d", ret); } } @@ -138,7 +138,7 @@ LiteWinRequestor* LiteWMRequestor::CreateWindow(const LiteWinConfig& config) para.data = &requestor; int32_t ret = proxy_->Invoke(proxy_, LiteWMS_CreateWindow, &io, ¶, Callback); if (ret != 0) { - GRAPHIC_LOGE("CreateWindow failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "CreateWindow failed, ret=%d", ret); } return requestor; @@ -153,7 +153,7 @@ void LiteWMRequestor::RemoveWindow(int32_t id) int32_t ret = proxy_->Invoke(proxy_, LiteWMS_RemoveWindow, &io, NULL, Callback); if (ret != 0) { - GRAPHIC_LOGE("RemoveWindow failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "RemoveWindow failed, ret=%d", ret); } } @@ -190,7 +190,7 @@ void LiteWMRequestor::ScreenShotClearup() void LiteWMRequestor::OnBufferAvailable() { - GRAPHIC_LOGD("OnBufferAvailable"); + HILOG_DEBUG(HILOG_MODULE_GRAPHIC, "OnBufferAvailable"); if (surface_ != nullptr) { SurfaceBuffer* buffer = surface_->AcquireBuffer(); if (buffer != nullptr) { @@ -226,7 +226,7 @@ void LiteWMRequestor::Screenshot() int32_t ret = RegisterIpcCallback(SurfaceRequestHandler, 0, IPC_WAIT_FOREVER, &sid_, surface_); if (ret != LITEIPC_OK) { - GRAPHIC_LOGE("RegisterIpcCallback failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "RegisterIpcCallback failed."); delete surface_; surface_ = nullptr; return; @@ -240,7 +240,7 @@ void LiteWMRequestor::Screenshot() para.funcId = LiteWMS_Screenshot; ret = proxy_->Invoke(proxy_, LiteWMS_Screenshot, &io, ¶, Callback); if (ret != 0) { - GRAPHIC_LOGE("Screenshot failed, ret=%d", ret); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Screenshot failed, ret=%d", ret); } } } // namespace OHOS \ No newline at end of file diff --git a/frameworks/wms/lite_wms_client.cpp b/frameworks/wms/lite_wms_client.cpp index 0448978..7c69bb3 100755 --- a/frameworks/wms/lite_wms_client.cpp +++ b/frameworks/wms/lite_wms_client.cpp @@ -38,12 +38,12 @@ bool LiteWMSClient::InitLiteWMSClient() if (proxy_ == nullptr) { IUnknown* iUnknown = SAMGR_GetInstance()->GetDefaultFeatureApi(SERVICE_NAME); if (iUnknown == nullptr) { - GRAPHIC_LOGE("iUnknown is NULL"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "iUnknown is NULL"); return false; } (void)iUnknown->QueryInterface(iUnknown, CLIENT_PROXY_VER, (void**)&proxy_); if (proxy_ == nullptr) { - GRAPHIC_LOGE("QueryInterface failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "QueryInterface failed!"); return false; } } diff --git a/services/ims/input_event_client_proxy.cpp b/services/ims/input_event_client_proxy.cpp index ce3a5bf..33e95c1 100755 --- a/services/ims/input_event_client_proxy.cpp +++ b/services/ims/input_event_client_proxy.cpp @@ -45,14 +45,14 @@ void InputEventClientProxy::ClientRequestHandle(int funcId, void* origin, IpcIo* void InputEventClientProxy::AddListener(const void* origin, IpcIo* req, IpcIo* reply) { if (clientInfoMap_.size() >= MAX_CLIENT_SIZE) { - GRAPHIC_LOGE("Exceeded the maximum number!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Exceeded the maximum number!"); return; } pid_t pid = GetCallingPid(origin); SvcIdentity* sid = IpcIoPopSvc(req); bool alwaysInvoke = IpcIoPopBool(req); if (sid == nullptr) { - GRAPHIC_LOGE("Pop Svc failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Pop Svc failed."); return; } SvcIdentity svc = *sid; @@ -63,7 +63,7 @@ void InputEventClientProxy::AddListener(const void* origin, IpcIo* req, IpcIo* r #endif uint32_t cbId = 0; if (RegisterDeathCallback(NULL, svc, DeathCallback, const_cast(origin), &cbId) != LITEIPC_OK) { - GRAPHIC_LOGE("Register death callback failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Register death callback failed!"); return; } struct ClientInfo clientInfo = { svc, cbId, alwaysInvoke }; diff --git a/services/ims/input_event_hub.cpp b/services/ims/input_event_hub.cpp index d5af90b..726861d 100644 --- a/services/ims/input_event_hub.cpp +++ b/services/ims/input_event_hub.cpp @@ -51,17 +51,17 @@ void InputEventHub::SetUp() { int32_t ret = GetInputInterface(&inputInterface_); if (ret != INPUT_SUCCESS) { - GRAPHIC_LOGE("get input driver interface failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "get input driver interface failed!"); return; } uint8_t num = ScanInputDevice(); if (num == 0) { - GRAPHIC_LOGE("There is no device!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "There is no device!"); return; } for (uint8_t i = 0; i < num; i++) { if (inputInterface_ == nullptr || inputInterface_->iInputManager == nullptr) { - GRAPHIC_LOGE("input interface or input manager is nullptr, open device failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "input interface or input manager is nullptr, open device failed!"); return; } ret = inputInterface_->iInputManager->OpenInputDevice(mountDevIndex_[i]); @@ -69,7 +69,7 @@ void InputEventHub::SetUp() callback_.ReportEventPkgCallback = EventCallback; ret = inputInterface_->iInputReporter->RegisterReportCallback(mountDevIndex_[i], &callback_); if (ret != INPUT_SUCCESS) { - GRAPHIC_LOGE("device dose not exist, can't register callback to it!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "device dose not exist, can't register callback to it!"); return; } openDev_ = openDev_ | (1 << i); @@ -85,20 +85,20 @@ void InputEventHub::TearDown() continue; } if (inputInterface_ == nullptr) { - GRAPHIC_LOGE("input interface point is nullptr!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "input interface point is nullptr!"); return; } if (inputInterface_->iInputReporter == nullptr || inputInterface_->iInputManager == nullptr) { - GRAPHIC_LOGE("input interface or input manager is nullptr, open device failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "input interface or input manager is nullptr, open device failed!"); return; } ret = inputInterface_->iInputReporter->UnregisterReportCallback(mountDevIndex_[i]); if (ret != INPUT_SUCCESS) { - GRAPHIC_LOGE("Unregister callback failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Unregister callback failed!"); } ret = inputInterface_->iInputManager->CloseInputDevice(mountDevIndex_[i]); if (ret != INPUT_SUCCESS) { - GRAPHIC_LOGE("Unmount device failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Unmount device failed!"); } openDev_ = openDev_ & ~(1 << i); } diff --git a/services/ims/input_manager_service.cpp b/services/ims/input_manager_service.cpp index 7d647a3..b8f72bf 100755 --- a/services/ims/input_manager_service.cpp +++ b/services/ims/input_manager_service.cpp @@ -74,7 +74,7 @@ void InputManagerService::ReadCallback(const RawEvent* event) void* InputManagerService::Distribute(void* args) { - GRAPHIC_LOGI("InputManagerService::Distribute Ready to read distribute!"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "InputManagerService::Distribute Ready to read distribute!"); while (true) { pthread_mutex_lock(&lock_); while (eventQueue_.size() == 0) { diff --git a/services/ims/samgr_ims.cpp b/services/ims/samgr_ims.cpp index 3995aad..955d4cc 100755 --- a/services/ims/samgr_ims.cpp +++ b/services/ims/samgr_ims.cpp @@ -46,14 +46,14 @@ static BOOL Initialize(Service* service, Identity identity) { IMSService* example = reinterpret_cast(service); example->identity = identity; - GRAPHIC_LOGI("Initialize(%s)! Identity<%d, %d, %p>", IMS_SERVICE_NAME, + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Initialize(%s)! Identity<%d, %d, %p>", IMS_SERVICE_NAME, identity.serviceId, identity.featureId, identity.queueId); return TRUE; } static BOOL MessageHandle(Service* service, Request* msg) { - GRAPHIC_LOGI("MessageHandle(%s)! Request<%d, %d, %p>", + HILOG_INFO(HILOG_MODULE_GRAPHIC, "MessageHandle(%s)! Request<%d, %d, %p>", service->GetName(service), msg->msgId, msg->msgValue, msg->data); return FALSE; } @@ -85,12 +85,12 @@ static void Init(void) { BOOL ret = SAMGR_GetInstance()->RegisterService(reinterpret_cast(&g_example)); if (ret != TRUE) { - GRAPHIC_LOGE("regist service failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "regist service failed."); return; } ret = SAMGR_GetInstance()->RegisterDefaultFeatureApi(IMS_SERVICE_NAME, GET_IUNKNOWN(g_example)); if (ret != TRUE) { - GRAPHIC_LOGE("regist feature failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "regist feature failed."); return; } } diff --git a/services/wms/lite_win.cpp b/services/wms/lite_win.cpp index d8b842c..06ad58f 100644 --- a/services/wms/lite_win.cpp +++ b/services/wms/lite_win.cpp @@ -57,7 +57,7 @@ LiteWindow::LiteWindow(const LiteWinConfig& config) LiteWindow::~LiteWindow() { if (needUnregister_) { - GRAPHIC_LOGI("UnregisterIpcCallback"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "UnregisterIpcCallback"); UnregisterIpcCallback(sid_); } @@ -77,7 +77,7 @@ bool LiteWindow::CreateSurface() if (surface_ == nullptr) { surface_ = Surface::CreateSurface(); if (surface_ == nullptr) { - GRAPHIC_LOGE("CreateSurface failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "CreateSurface failed!"); return false; } surface_->SetWidthAndHeight(config_.rect.GetWidth(), config_.rect.GetHeight()); @@ -127,7 +127,7 @@ void LiteWindow::UpdateBackBuf() void* acquireBufVirAddr = acquireBuffer->GetVirAddr(); void* backBufVirAddr = backBuf_->GetVirAddr(); if (acquireBufVirAddr != nullptr && backBufVirAddr != nullptr) { - GRAPHIC_LOGI("memcpy, backBuf size=%d, acquireBuffer size=%d", + HILOG_INFO(HILOG_MODULE_GRAPHIC, "memcpy, backBuf size=%d, acquireBuffer size=%d", backBuf_->GetSize(), acquireBuffer->GetSize()); #ifdef ARM_NEON_OPT { @@ -139,11 +139,11 @@ void LiteWindow::UpdateBackBuf() DEBUG_PERFORMANCE_TRACE("UpdateBackBuf"); if (memcpy_s(backBufVirAddr, backBuf_->GetSize(), acquireBufVirAddr, acquireBuffer->GetSize()) != EOK) { - GRAPHIC_LOGE("memcpy_s error!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "memcpy_s error!"); } } #endif - GRAPHIC_LOGI("memcpy end"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "memcpy end"); } surface_->ReleaseBuffer(acquireBuffer); } @@ -169,7 +169,7 @@ void LiteWindow::FlushWithModeCopy(const Rect& srcRect, const LiteSurfaceData* l } #elif defined LAYER_PF_ARGB8888 if (memcpy_s(dstBuf, lineSize, srcBuf, lineSize) != EOK) { - GRAPHIC_LOGE("memcpy_s error!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "memcpy_s error!"); } #endif srcBuf += stride; @@ -239,7 +239,7 @@ void LiteWindow::Flush(const Rect& srcRect, const LiteSurfaceData* layerData, in srcData.pixelFormat = (ImagePixelFormat)surface_->GetFormat(); srcData.stride = surface_->GetStride(); srcData.phyAddr = reinterpret_cast(phyaddr); - GRAPHIC_LOGD("Hardware composite, width=%d, height=%d, pixelFormat=%d, stride=%d", + HILOG_DEBUG(HILOG_MODULE_GRAPHIC, "Hardware composite, width=%d, height=%d, pixelFormat=%d, stride=%d", srcData.width, srcData.height, srcData.pixelFormat, srcData.stride); if (GfxEngines::GetInstance()->GfxBlit(srcData, srcRect, *layerData, dx, dy)) { return; @@ -261,7 +261,7 @@ Surface* LiteWindow::GetSurface() void LiteWindow::MoveTo(int16_t x, int16_t y) { - GRAPHIC_LOGI("{%d,%d}=>{%d,%d}", config_.rect.GetLeft(), config_.rect.GetTop(), x, y); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "{%d,%d}=>{%d,%d}", config_.rect.GetLeft(), config_.rect.GetTop(), x, y); LiteWM::GetInstance()->UpdateWindowRegion(this, config_.rect); config_.rect.SetPosition(x, y); LiteWM::GetInstance()->UpdateWindowRegion(this, config_.rect); @@ -269,7 +269,8 @@ void LiteWindow::MoveTo(int16_t x, int16_t y) void LiteWindow::Resize(int16_t width, int16_t height) { - GRAPHIC_LOGI("{%d,%d}=>{%d,%d}", config_.rect.GetWidth(), config_.rect.GetHeight(), width, height); + HILOG_INFO(HILOG_MODULE_GRAPHIC, + "{%d,%d}=>{%d,%d}", config_.rect.GetWidth(), config_.rect.GetHeight(), width, height); config_.rect.Resize(width, height); ResizeSurface(width, height); } diff --git a/services/wms/lite_wm.cpp b/services/wms/lite_wm.cpp index bafc3d5..ce62e55 100755 --- a/services/wms/lite_wm.cpp +++ b/services/wms/lite_wm.cpp @@ -111,12 +111,12 @@ LiteWM::LiteWM() layerData_ = GetDevSurfaceData(); if (layerData_ != nullptr) { if (layerData_->virAddr == nullptr) { - GRAPHIC_LOGE("LayerInfo addr is null!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "LayerInfo addr is null!"); } - GRAPHIC_LOGI("LayerInfo, width=%d, height=%d, stride=%d", + HILOG_INFO(HILOG_MODULE_GRAPHIC, "LayerInfo, width=%d, height=%d, stride=%d", layerData_->width, layerData_->height, layerData_->stride); } else { - GRAPHIC_LOGE("LayerInfo is null!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "LayerInfo is null!"); } } @@ -274,7 +274,7 @@ void LiteWM::Resize(int32_t id, int16_t width, int16_t height) void LiteWM::UpdateWindow(int32_t id) { - GRAPHIC_LOGI("UpdateWindow, id=%d", id); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "UpdateWindow, id=%d", id); LiteWindow* window = GetWindowById(id); if (window != nullptr) { UpdateWindowRegion(window, window->config_.rect); @@ -319,7 +319,7 @@ ListNode* LiteWM::GetWindowNodeById(int32_t id) void LiteWM::InitMouseCursor() { - GRAPHIC_LOGI("InitMouseCursor"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "InitMouseCursor"); cursorInfo_.rect.SetRect(0, 0, CURSOR_WIDTH - 1, CURSOR_HEIGHT - 1); cursorInfo_.needRedraw = false; cursorInfo_.enableCursor = false; @@ -362,7 +362,7 @@ void LiteWM::RemoveWindow(int32_t id) bool LiteWM::CheckWinIdIsAvailable() { if (winIdStorage == WINDOW_ID_FULL_STORAGE) { - GRAPHIC_LOGE("reach max window num!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "reach max window num!"); return false; } return true; @@ -426,7 +426,8 @@ void LiteWM::CalculateUpdateRegion(const ListNode* winNode, int16_t if ((window != nullptr) && window->isShow_ && window->IsCoverMode()) { Rect& winRect = window->config_.rect; Rect mask; - GRAPHIC_LOGD("winRect={%d,%d,%d,%d}, rect={%d,%d,%d,%d}", EXPAND_RECT(winRect), EXPAND_RECT(rect)); + HILOG_DEBUG(HILOG_MODULE_GRAPHIC, + "winRect={%d,%d,%d,%d}, rect={%d,%d,%d,%d}", EXPAND_RECT(winRect), EXPAND_RECT(rect)); if (mask.Intersect(winRect, rect)) { if (x1 != mask.GetLeft()) { CalculateUpdateRegion(winNode->prev_, x1, y1, mask.GetLeft() - 1, y2); @@ -452,7 +453,7 @@ void LiteWM::CalculateUpdateRegion(const ListNode* winNode, int16_t void LiteWM::AddUpdateRegion(const Rect& rect) { GraphicLocker lock(stackLock_); - GRAPHIC_LOGD("AddUpdateRegion, rect={%d,%d,%d,%d}", EXPAND_RECT(rect)); + HILOG_DEBUG(HILOG_MODULE_GRAPHIC, "AddUpdateRegion, rect={%d,%d,%d,%d}", EXPAND_RECT(rect)); if (updates_.num == 0) { updates_.updates[updates_.num++] = rect; updates_.bound = rect; @@ -527,7 +528,8 @@ void LiteWM::DrawRegion(const ListNode* winNode, int16_t x1, int16_ Rect mask; if (!window->isShow_ || window->NoNeedToDraw() || window->backBuf_ == nullptr || !mask.Intersect(winRect, rect)) { - GRAPHIC_LOGI("winRect={%d,%d,%d,%d}, rect={%d,%d,%d,%d}", EXPAND_RECT(winRect), EXPAND_RECT(rect)); + HILOG_INFO(HILOG_MODULE_GRAPHIC, + "winRect={%d,%d,%d,%d}, rect={%d,%d,%d,%d}", EXPAND_RECT(winRect), EXPAND_RECT(rect)); DrawRegion(winNode->next_, x1, y1, x2, y2); return; } @@ -541,9 +543,10 @@ void LiteWM::DrawRegion(const ListNode* winNode, int16_t x1, int16_ Rect srcRect = mask; srcRect.SetPosition(mask.GetLeft() - winRect.GetLeft(), mask.GetTop() - winRect.GetTop()); - GRAPHIC_LOGD("Blit, id=%d, srcRect={%d,%d,%d,%d}, x=%d, y=%d", window->id_, EXPAND_RECT(srcRect), x, y); + HILOG_DEBUG(HILOG_MODULE_GRAPHIC, + "Blit, id=%d, srcRect={%d,%d,%d,%d}, x=%d, y=%d", window->id_, EXPAND_RECT(srcRect), x, y); window->Flush(srcRect, layerData_, x, y); - GRAPHIC_LOGD("Blit finish"); + HILOG_DEBUG(HILOG_MODULE_GRAPHIC, "Blit finish"); if (x1 != mask.GetLeft()) { DrawRegion(winNode->next_, x1, y1, mask.GetLeft() - 1, y2); @@ -575,12 +578,12 @@ void LiteWM::DrawBackground(int16_t x1, int16_t y1, int16_t x2, int16_t y2) y1 = rect.GetTop(); y2 = rect.GetBottom(); - GRAPHIC_LOGD("DrawBackground, {%d,%d,%d,%d}", x1, y1, x2, y2); + HILOG_DEBUG(HILOG_MODULE_GRAPHIC, "DrawBackground, {%d,%d,%d,%d}", x1, y1, x2, y2); int32_t len = static_cast(x2 - x1 + 1) * layerData_->bytePerPixel; for (int16_t y = y1; y <= y2; y++) { LayerColorType* buf1 = reinterpret_cast(layerData_->virAddr + y * layerData_->stride); if (memset_s(buf1 + x1, len, 0, len) != EOK) { - GRAPHIC_LOGE("memset_s error!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "memset_s error!"); } } } @@ -738,7 +741,7 @@ void LiteWM::Screenshot() if (dstAddr != nullptr && srcAddr != nullptr) { for (uint32_t i = 0; i < height; i++) { if (memcpy_s(dstAddr, lineSize, srcAddr, lineSize) != EOK) { - GRAPHIC_LOGE("memcpy_s error!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "memcpy_s error!"); } dstAddr += lineSize; srcAddr += layerData_->stride; @@ -753,14 +756,14 @@ end2: void LiteWM::OnClientDeathNotify(pid_t pid) { - GRAPHIC_LOGI("OnClientDeathNotify"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "OnClientDeathNotify"); GraphicLocker lock(stackLock_); auto node = winList_.Begin(); while (node != winList_.End()) { auto tmp = node; node = node->next_; LiteWindow* window = tmp->data_; - GRAPHIC_LOGI("window->GetPid() = %d,pid = %d", window->GetPid(), pid); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "window->GetPid() = %d,pid = %d", window->GetPid(), pid); if (window->GetPid() == pid) { winList_.Remove(tmp); AddUpdateRegion(window->config_.rect); diff --git a/services/wms/lite_wms.cpp b/services/wms/lite_wms.cpp index 83452dd..be5653a 100755 --- a/services/wms/lite_wms.cpp +++ b/services/wms/lite_wms.cpp @@ -73,7 +73,7 @@ void LiteWMS::WMSRequestHandle(int funcId, void* origin, IpcIo* req, IpcIo* repl LiteWMS::GetInstance()->GetLayerInfo(req, reply); break; default: - GRAPHIC_LOGW("code not support:%d!", funcId); + HILOG_WARN(HILOG_MODULE_GRAPHIC, "code not support:%d!", funcId); break; } } @@ -84,7 +84,7 @@ int32_t LiteWMS::SurfaceRequestHandler(const IpcContext* context, void* ipcMsg, (void)GetCode(ipcMsg, &code); LiteWindow* window = reinterpret_cast(arg); if (code == 0) { - GRAPHIC_LOGI("requestBuffer"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "requestBuffer"); window->UpdateBackBuf(); } @@ -97,17 +97,17 @@ int32_t LiteWMS::SurfaceRequestHandler(const IpcContext* context, void* ipcMsg, void LiteWMS::GetSurface(IpcIo* req, IpcIo* reply) { int32_t id = IpcIoPopInt32(req); - GRAPHIC_LOGI("GetSurface,id=%d", id); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "GetSurface,id=%d", id); LiteWindow* window = LiteWM::GetInstance()->GetWindowById(id); if (window == nullptr) { - GRAPHIC_LOGE("window not found, id = %d", id); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "window not found, id = %d", id); return; } SvcIdentity svc; int32_t ret = RegisterIpcCallback(SurfaceRequestHandler, 0, IPC_WAIT_FOREVER, &svc, window); IpcIoPushInt32(reply, ret); if (ret != LITEIPC_OK) { - GRAPHIC_LOGE("RegisterIpcCallback failed."); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "RegisterIpcCallback failed."); return; } window->SetSid(svc); @@ -116,35 +116,35 @@ void LiteWMS::GetSurface(IpcIo* req, IpcIo* reply) void LiteWMS::Show(IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("Show"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Show"); int32_t id = IpcIoPopInt32(req); LiteWM::GetInstance()->Show(id); } void LiteWMS::Hide(IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("Hide"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Hide"); int32_t id = IpcIoPopInt32(req); LiteWM::GetInstance()->Hide(id); } void LiteWMS::RaiseToTop(IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("RaiseToTop"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "RaiseToTop"); int32_t id = IpcIoPopInt32(req); LiteWM::GetInstance()->RaiseToTop(id); } void LiteWMS::LowerToBottom(IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("LowerToBottom"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "LowerToBottom"); int32_t id = IpcIoPopInt32(req); LiteWM::GetInstance()->LowerToBottom(id); } void LiteWMS::MoveTo(IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("MoveTo"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "MoveTo"); int32_t id = IpcIoPopInt32(req); uint32_t x = IpcIoPopUint32(req); uint32_t y = IpcIoPopUint32(req); @@ -153,7 +153,7 @@ void LiteWMS::MoveTo(IpcIo* req, IpcIo* reply) void LiteWMS::Resize(IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("Resize"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Resize"); int32_t id = IpcIoPopInt32(req); uint32_t width = IpcIoPopUint32(req); uint32_t height = IpcIoPopUint32(req); @@ -162,14 +162,14 @@ void LiteWMS::Resize(IpcIo* req, IpcIo* reply) void LiteWMS::Update(IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("Update"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Update"); int32_t id = IpcIoPopInt32(req); LiteWM::GetInstance()->UpdateWindow(id); } void LiteWMS::CreateWindow(const void* origin, IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("CreateWindow"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "CreateWindow"); uint32_t size; LiteWinConfig* config = static_cast(IpcIoPopFlatObj(req, &size)); if (config != nullptr) { @@ -185,7 +185,7 @@ void LiteWMS::CreateWindow(const void* origin, IpcIo* req, IpcIo* reply) void LiteWMS::RemoveWindow(IpcIo* req, IpcIo* reply) { - GRAPHIC_LOGI("RemoveWindow"); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "RemoveWindow"); int32_t id = IpcIoPopInt32(req); LiteWM::GetInstance()->RemoveWindow(id); } @@ -222,7 +222,7 @@ void LiteWMS::ClientRegister(const void* origin, IpcIo* req, IpcIo* reply) sid = nullptr; #endif if (RegisterDeathCallback(NULL, arg->sid, DeathCallback, arg, &cbId) != LITEIPC_OK) { - GRAPHIC_LOGE("RegisterDeathCallback failed!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "RegisterDeathCallback failed!"); } } diff --git a/services/wms/samgr_wms.cpp b/services/wms/samgr_wms.cpp index cdbf7f0..7357f0c 100755 --- a/services/wms/samgr_wms.cpp +++ b/services/wms/samgr_wms.cpp @@ -47,14 +47,14 @@ static BOOL Initialize(Service* service, Identity identity) { WMSService* example = reinterpret_cast(service); example->identity = identity; - GRAPHIC_LOGI("Initialize(%s)! Identity<%d, %d, %p>", SERVICE_NAME, + HILOG_INFO(HILOG_MODULE_GRAPHIC, "Initialize(%s)! Identity<%d, %d, %p>", SERVICE_NAME, identity.serviceId, identity.featureId, identity.queueId); return TRUE; } static BOOL MessageHandle(Service* service, Request* msg) { - GRAPHIC_LOGI("MessageHandle(%s)! Request<%d, %d, %p>", + HILOG_INFO(HILOG_MODULE_GRAPHIC, "MessageHandle(%s)! Request<%d, %d, %p>", service->GetName(service), msg->msgId, msg->msgValue, msg->data); return FALSE; } diff --git a/test/sample_ui.cpp b/test/sample_ui.cpp index 29cd4bc..480e814 100755 --- a/test/sample_ui.cpp +++ b/test/sample_ui.cpp @@ -38,7 +38,7 @@ void TestAPP() config.rect.SetRect(0, 0, Screen::GetInstance().GetWidth() - 1, Screen::GetInstance().GetHeight() - 1); Window* window = Window::CreateWindow(config); if (window == nullptr) { - GRAPHIC_LOGE("Create window false!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Create window false!"); return; } window->BindRootView(RootView::GetInstance()); diff --git a/test/sample_window.cpp b/test/sample_window.cpp index 32a78a8..4332f25 100755 --- a/test/sample_window.cpp +++ b/test/sample_window.cpp @@ -53,7 +53,7 @@ void CreateDefaultWindow(RootView* rootView, int x, int y) window->BindRootView(rootView); window->Show(); } else { - GRAPHIC_LOGE("Create window false!"); + HILOG_ERROR(HILOG_MODULE_GRAPHIC, "Create window false!"); } } } @@ -236,7 +236,7 @@ RootView* g_rootViewList[MAX_LIST_NUM]; void TestWindowNumLimit() { for (int i = 0; i < MAX_LIST_NUM; i++) { - GRAPHIC_LOGI("CreateDefaultWindow, i = %d", i); + HILOG_INFO(HILOG_MODULE_GRAPHIC, "CreateDefaultWindow, i = %d", i); if (i == 10) { // 10, 9: Delete the tenth window in the 11th loop. Window* window = g_rootViewList[9]->GetBoundWindow(); Window::DestoryWindow(window); -- Gitee