From 86b5907be305f2396681f0e39d4dfc2c3cbc74ce Mon Sep 17 00:00:00 2001 From: jiangwenyu Date: Wed, 5 Jul 2023 19:04:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- etc/icon/Default.png | Bin 0 -> 522 bytes window_manager/ft_pointer_draw/BUILD.gn | 50 +++ .../ft_pointer_draw_manager_adapter.cpp | 102 ++++++ .../i_pointer_drawing_manager.h | 70 ++++ .../ft_pointer_draw/pointer_draw_manager.cpp | 315 ++++++++++++++++++ .../ft_pointer_draw/pointer_draw_manager.h | 115 +++++++ 6 files changed, 652 insertions(+) create mode 100644 etc/icon/Default.png create mode 100644 window_manager/ft_pointer_draw/BUILD.gn create mode 100644 window_manager/ft_pointer_draw/ft_pointer_draw_manager_adapter.cpp create mode 100644 window_manager/ft_pointer_draw/i_pointer_drawing_manager.h create mode 100644 window_manager/ft_pointer_draw/pointer_draw_manager.cpp create mode 100644 window_manager/ft_pointer_draw/pointer_draw_manager.h diff --git a/etc/icon/Default.png b/etc/icon/Default.png new file mode 100644 index 0000000000000000000000000000000000000000..6308171fe9d612050376f6a5dfdc870e51bc92db GIT binary patch literal 522 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dEjKx9jP7LeL$-D$|Tv8)E(|mmy zw18|52FCVG1{RPKAeI7R1_tH@j10^`nh_+nfC(&7aK09DS?;h@)n>(w zU77zQXSuG~_Vy8v33K!P7bm_yUcX@Svdm|xk@w1C%MBhDGF)SI{17H`RCu}vlS{!L zCCv%ZDe@;&i#VR}{gj=c{lwoPZ^G?{7=?OfBlmYqDP4C&Pw@N{f1qB}ng3n(RpBwS z1-ZAMe3~8@dbLJIcGrY=PaKx7dp$d9(h@!2%S_RI?##T>UmN=#ueoO!5_(r*V$$sA zKd*k+ck!CYi(Prm<=TgT>F^w8Wyn_fEW&x=`(M?6?DGTV65l;mFI%YLPBzD z8Qv=8{5Pi9nO#{PC}JC=;A!Y7^hs~t1zVqfm808ojeRc{b(#21UQ%&Z#m1>zOkKJ?!T{$GzTFckq`?ald5N4T%|&a;7<7S+i;@V%NAb rDKSoL@NiI35E9_*U~yskZ`a75v-6BzVow+-o)|n`{an^LB{Ts5(G +#include +#include "i_pointer_drawing_manager.h" +#include "display_info.h" + +namespace OHOS { +namespace MMI { + +#if defined(__cplusplus) +extern "C" { +#endif // __cplusplus + +using PointerDrawPtr = std::shared_ptr; +std::map g_pointerDrawMap; +constexpr uint32_t MAX_PTRDRAW_NUMS = 64; + +static PointerDrawPtr FindPointerDraw(const uintptr_t instanceHdl) +{ + auto it = g_pointerDrawMap.find(instanceHdl); + if (it == g_pointerDrawMap.end()) { + return nullptr; + } + return it->second; +} + +uintptr_t FTPtrDrawMgrGetInstance() +{ + if (g_pointerDrawMap.size() > MAX_PTRDRAW_NUMS) { + return 0; + } + + PointerDrawPtr instance = IPointerDrawingManager::GetInstance(); + if (instance == nullptr) { + return 0; + } + + uintptr_t instanceHdl = reinterpret_cast(instance.get()); + g_pointerDrawMap[instanceHdl] = instance; + return instanceHdl; +} + +void FTPtrDrawMgrFreeInstance(const uintptr_t instanceHdl) +{ + if (g_pointerDrawMap.size() == 0) { + return; + } + g_pointerDrawMap.erase(instanceHdl); +} + +bool FTPtrDrawMgrInit(const uintptr_t instanceHdl) +{ + PointerDrawPtr instance = FindPointerDraw(instanceHdl); + if (instance == nullptr) { + return false; + } + + instance->Init(); + return true; +} + +bool FTPtrDrawMgrUpdataDispInfo(const uintptr_t instanceHdl, const DisplayInfo& displayInfo) +{ + PointerDrawPtr instance = FindPointerDraw(instanceHdl); + if (instance == nullptr) { + return false; + } + + instance->UpdateDisplayInfo(displayInfo); + return true; +} + +bool FTPtrDrawMgrDrawPointer(const uintptr_t instanceHdl, int32_t displayId, int32_t physicalX, int32_t physicalY) +{ + PointerDrawPtr instance = FindPointerDraw(instanceHdl); + if (instance == nullptr) { + return false; + } + + instance->DrawPointer(displayId, physicalX, physicalY); + return true; +} + +#if defined(__cplusplus) +} +#endif // __cplusplus + +} // MMI +} // OHOS \ No newline at end of file diff --git a/window_manager/ft_pointer_draw/i_pointer_drawing_manager.h b/window_manager/ft_pointer_draw/i_pointer_drawing_manager.h new file mode 100644 index 0000000..385d003 --- /dev/null +++ b/window_manager/ft_pointer_draw/i_pointer_drawing_manager.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef I_POINTER_DRAWING_MANAGER_H +#define I_POINTER_DRAWING_MANAGER_H + +#include + +#include "display_info.h" +#include "struct_multimodal.h" + +namespace OHOS { +namespace MMI { +class IPointerDrawingManager { +public: + IPointerDrawingManager() = default; + virtual ~IPointerDrawingManager() = default; + + static std::shared_ptr GetInstance(); + virtual void DrawPointer(int32_t displayId, int32_t physicalX, int32_t physicalY, + const MOUSE_ICON mouseStyle = MOUSE_ICON::DEFAULT) {} + virtual void UpdateDisplayInfo(const DisplayInfo& displayInfo) {} + virtual void OnDisplayInfo(const DisplayGroupInfo& displayGroupInfo) {} + virtual void OnWindowInfo(const WinInfo &info) {} + virtual bool Init() + { + return true; + } + virtual void DeletePointerVisible(int32_t pid) {} + virtual int32_t SetPointerVisible(int32_t pid, bool visible) + { + return 0; + } + virtual int32_t SetPointerStyle(int32_t pid, int32_t windowId, int32_t pointerStyle) + { + return 0; + } + virtual int32_t GetPointerStyle(int32_t pid, int32_t windowId, int32_t &pointerStyle) + { + return 0; + } + virtual void DrawPointerStyle() {} + virtual bool IsPointerVisible() + { + return false; + } + virtual void SetMouseDisplayState(bool state) {} + virtual bool GetMouseDisplayState() const + { + return true; + } + virtual void SetPointerLocation(int32_t pid, int32_t x, int32_t y) {} +public: + static inline std::shared_ptr iPointDrawMgr_ { nullptr }; +}; +} // namespace MMI +} // namespace OHOS +#endif // I_POINTER_DRAWING_MANAGER_H \ No newline at end of file diff --git a/window_manager/ft_pointer_draw/pointer_draw_manager.cpp b/window_manager/ft_pointer_draw/pointer_draw_manager.cpp new file mode 100644 index 0000000..63ade54 --- /dev/null +++ b/window_manager/ft_pointer_draw/pointer_draw_manager.cpp @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2023 Huawei Technologies Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "pointer_draw_manager.h" + +#include "unistd.h" +#include + +#include "ui/rs_surface_extractor.h" +#include "transaction/rs_transaction.h" +#include "image_source.h" + +namespace OHOS { +namespace MMI { +namespace { + constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "PointerDrawingManager"}; + constexpr int32_t PATH_MAX = 200; + const std::string POINTER_PIXEL_PATH = "/usr/local/share/ft/icon/"; + constexpr int32_t FILE_SIZE_MAX = 0X5000; + constexpr int32_t ICON_WIDTH = 40; + constexpr int32_t ICON_HEIGHT = 40; +} + +std::shared_ptr IPointerDrawingManager::GetInstance() +{ + if (iPointDrawMgr_ == nullptr) { + iPointDrawMgr_ = std::make_shared(); + } + return iPointDrawMgr_; +} + +bool PointerDrawingManager::Init() +{ + if (InitIconPixel() != WMError::WM_OK) { + WLOGFE("InitIconPixel fail"); + return false; + } + + runner_ = AppExecFwk::EventRunner::Create("PointerDrawingManager"); + handler_ = std::make_shared(runner_); + + return true; +} + +void PointerDrawingManager::DrawPointer(int32_t displayId, int32_t physicalX, int32_t physicalY, + const MOUSE_ICON mouseStyle) +{ + if (!isDrawing_) { + if (InitLayerNode(physicalX, physicalY) != WMError::WM_OK) { + WLOGFE("InitLayerNode fail"); + return; + } + + if (InitDisplayNode() != WMError::WM_OK) { + WLOGFE("InitDisplayNode fail"); + return; + } + isDrawing_ = true; + return; + } + + if (handler_ == nullptr) { + WLOGFE("EventHandler is nullptr"); + return; + } + + std::function task = [this, physicalX, physicalY]() -> void { + MoveTo(physicalX, physicalY); + }; + + bool ret = handler_->PostTask(task); + if (ret == false) { + WLOGFE("EventHandler PostTask Failed"); + } +} + +void PointerDrawingManager::SetPointerLocation(int32_t pid, int32_t x, int32_t y) +{ + if (!isDrawing_) { + WLOGFE("need to invoke DrawPointer before SetPointerLocation"); + return; + } + + if (handler_ == nullptr) { + WLOGFE("EventHandler is nullptr"); + return; + } + + std::function task = [this, x, y]() -> void { + MoveTo(x, y); + }; + + bool ret = handler_->PostTask(task); + if (ret == false) { + WLOGFE("EventHandler PostTask Failed"); + } +} + +void PointerDrawingManager::UpdateDisplayInfo(const DisplayInfo& displayInfo) +{ + displayWidth_ = displayInfo.width; + displayHeight_ = displayInfo.height; + displayId_ = displayInfo.id; + + if (displayWidth_ <= 0 || displayHeight_ <= 0) { + WLOGFE("Invalid DisplayInfo"); + } +} + +WMError PointerDrawingManager::MoveTo(int32_t x, int32_t y) +{ + if (surfaceNode_ == nullptr) { + WLOGFE("surfaceNode_ is nullptr"); + return WMError::WM_ERROR_NULLPTR; + } + + surfaceNode_->SetBounds(x, y, ICON_WIDTH, ICON_HEIGHT); + Rosen::RSTransaction::FlushImplicitTransaction(); + + return WMError::WM_OK; +} + +WMError PointerDrawingManager::InitLayerNode(int32_t x, int32_t y) +{ + Rosen::RSSurfaceNodeConfig config; + surfaceNode_ = Rosen::RSSurfaceNode::Create(config); + if (surfaceNode_ == nullptr) { + WLOGFE("RSSurfaceNode::Create fail"); + return WMError::WM_ERROR_NULLPTR; + } + + surfaceNode_->SetBounds(x, y, ICON_WIDTH, ICON_HEIGHT); + rsSurface_ = Rosen::RSSurfaceExtractor::ExtractRSSurface(surfaceNode_); + if (rsSurface_ == nullptr) { + WLOGFE("ExtractRSSurface fail"); + return WMError::WM_ERROR_NULLPTR; + } + + auto framePtr = rsSurface_->RequestFrame(ICON_WIDTH, ICON_HEIGHT); + if (framePtr == nullptr) { + WLOGFE("RequestFrame fail"); + return WMError::WM_ERROR_NULLPTR; + } + + auto canvas = framePtr->GetCanvas(); + canvas->clear(SK_ColorTRANSPARENT); + +#ifdef USE_IMITATE_POINTER + SkPaint paint; + paint.setAntiAlias(true); + paint.setStyle(SkPaint::kFill_Style); + paint.setStrokeJoin(SkPaint::kRound_Join); + paint.setColor(SK_ColorBLUE); + canvas->drawRect(SkRect::MakeXYWH(0, 0, ICON_WIDTH, ICON_HEIGHT), paint); +#else + if (mouseIcons_.size() == 0) { + WLOGFE("can not find icon pixel file"); + return WMError::WM_ERROR_NULLPTR; + } + auto pixelmap = DecodeImageToPixelMap(mouseIcons_[DEFAULT].iconPath); + if (pixelmap == nullptr) { + WLOGFE("DecodeImageToPixelMap fail"); + return WMError::WM_ERROR_NULLPTR; + } + + SkImageInfo imageInfo = SkImageInfo::Make(pixelmap->GetWidth(), pixelmap->GetHeight(), + PixelFormatConvert(pixelmap->GetPixelFormat()), + static_cast(pixelmap->GetAlphaType())); + SkPixmap srcPixmap(imageInfo, pixelmap->GetPixels(), pixelmap->GetRowBytes()); + SkBitmap srcBitmap; + srcBitmap.installPixels(srcPixmap); + canvas->drawBitmap(srcBitmap, 0, 0); +#endif + framePtr->SetDamageRegion(0, 0, ICON_WIDTH, ICON_HEIGHT); + rsSurface_->FlushFrame(framePtr); + + return WMError::WM_OK; +} + +WMError PointerDrawingManager::InitDisplayNode() +{ + Rosen::RSDisplayNodeConfig config; + displayNode_ = Rosen::RSDisplayNode::Create(config); + if (displayNode_ == nullptr) { + WLOGFE("RSDisplayNode::Create fail"); + return WMError::WM_ERROR_NULLPTR; + } + + displayNode_->SetScreenId(displayId_); + displayNode_->SetBounds(0, 0, displayWidth_, displayHeight_); + displayNode_->AddChild(surfaceNode_, -1); + Rosen::RSTransaction::FlushImplicitTransaction(); + + return WMError::WM_OK; +} + +WMError PointerDrawingManager::InitIconPixel() +{ + mouseIcons_ = { + {DEFAULT, {ANGLE_NW, POINTER_PIXEL_PATH + "Default.png"}}, + }; + for (auto iter = mouseIcons_.begin(); iter != mouseIcons_.end();) { + if (CheckPixelFile(iter->second.iconPath) != WMError::WM_OK) { + iter = mouseIcons_.erase(iter); + continue; + } + ++iter; + } + + if (mouseIcons_.size() == 0) { + WLOGFE("InitStyle fail"); + return WMError::WM_ERROR_NULLPTR; + } + + return WMError::WM_OK; +} + +WMError PointerDrawingManager::CheckPixelFile(const std::string &filePath) +{ + if (filePath.empty()) { + WLOGFE("Empty path"); + return WMError::WM_ERROR_NULLPTR; + } + + if (access(filePath.c_str(), F_OK) != 0) { + WLOGFE("Unreachable path"); + return WMError::WM_ERROR_NULLPTR; + } + + char realPath[PATH_MAX] = {}; + if (realpath(filePath.c_str(), realPath) == nullptr) { + WLOGFE("Invalid path"); + return WMError::WM_ERROR_NULLPTR; + } + + struct stat statbuf = {0}; + if (stat(filePath.c_str(), &statbuf) != 0) { + WLOGFE("Failed to get size"); + return WMError::WM_ERROR_NULLPTR; + } + if (statbuf.st_size <= 0 || statbuf.st_size > FILE_SIZE_MAX) { + WLOGFE("Invalid size"); + return WMError::WM_ERROR_NULLPTR; + } + + return WMError::WM_OK; +} + +std::unique_ptr PointerDrawingManager::DecodeImageToPixelMap(const std::string &imagePath) +{ + OHOS::Media::SourceOptions opts; + opts.formatHint = "image/png"; + uint32_t ret = 0; + auto imageSource = OHOS::Media::ImageSource::CreateImageSource(imagePath, opts, ret); + if (ret != 0) { + WLOGFE("CreateImageSource fail"); + return nullptr; + } + + std::set formats; + ret = imageSource->GetSupportedFormats(formats); + if (ret != 0) { + WLOGFE("GetSupportedFormats fail"); + return nullptr; + } + + OHOS::Media::DecodeOptions decodeOpts; + decodeOpts.desiredSize = { + .width = ICON_WIDTH, + .height = ICON_HEIGHT + }; + std::unique_ptr pixelMap = imageSource->CreatePixelMap(decodeOpts, ret); + if (pixelMap == nullptr) { + WLOGFE("CreatePixelMap fail"); + return nullptr; + } + return pixelMap; +} + +SkColorType PointerDrawingManager::PixelFormatConvert(const Media::PixelFormat& pixelFormat) +{ + SkColorType colorType; + switch (pixelFormat) { + case Media::PixelFormat::BGRA_8888: + colorType = SkColorType::kBGRA_8888_SkColorType; + break; + case Media::PixelFormat::RGBA_8888: + colorType = SkColorType::kRGBA_8888_SkColorType; + break; + case Media::PixelFormat::RGB_565: + colorType = SkColorType::kRGB_565_SkColorType; + break; + case Media::PixelFormat::ALPHA_8: + colorType = SkColorType::kAlpha_8_SkColorType; + break; + default: + colorType = SkColorType::kUnknown_SkColorType; + break; + } + return colorType; +} +} // namespace MMI +} // namespace OHOS diff --git a/window_manager/ft_pointer_draw/pointer_draw_manager.h b/window_manager/ft_pointer_draw/pointer_draw_manager.h new file mode 100644 index 0000000..f2a9933 --- /dev/null +++ b/window_manager/ft_pointer_draw/pointer_draw_manager.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2023 Huawei Technologies Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef POINTER_DRAW_H +#define POINTER_DRAW_H + +#include "i_pointer_drawing_manager.h" +#include "hilog/log.h" +#include "nocopyable.h" +#include "ui/rs_display_node.h" +#include "ui/rs_surface_node.h" +#include "pixel_map.h" +#include "event_handler.h" + +namespace OHOS { +namespace MMI { +static constexpr unsigned int HILOG_DOMAIN_WINDOW = 0xD004200; + +#define _W_DFUNC HiviewDFX::HiLog::Debug +#define _W_IFUNC HiviewDFX::HiLog::Info +#define _W_WFUNC HiviewDFX::HiLog::Warn +#define _W_EFUNC HiviewDFX::HiLog::Error + +#define _W_CPRINTF(func, fmt, ...) func(LABEL, "<%{public}d>" fmt, __LINE__, ##__VA_ARGS__) + +#define WLOGD(fmt, ...) _W_CPRINTF(_W_DFUNC, fmt, ##__VA_ARGS__) +#define WLOGI(fmt, ...) _W_CPRINTF(_W_IFUNC, fmt, ##__VA_ARGS__) +#define WLOGW(fmt, ...) _W_CPRINTF(_W_WFUNC, fmt, ##__VA_ARGS__) +#define WLOGE(fmt, ...) _W_CPRINTF(_W_EFUNC, fmt, ##__VA_ARGS__) + +#define _W_FUNC __func__ + +#define WLOGFD(fmt, ...) WLOGD("%{public}s: " fmt, _W_FUNC, ##__VA_ARGS__) +#define WLOGFI(fmt, ...) WLOGI("%{public}s: " fmt, _W_FUNC, ##__VA_ARGS__) +#define WLOGFW(fmt, ...) WLOGW("%{public}s: " fmt, _W_FUNC, ##__VA_ARGS__) +#define WLOGFE(fmt, ...) WLOGE("%{public}s: " fmt, _W_FUNC, ##__VA_ARGS__) + +class PointerDrawingManager : public IPointerDrawingManager { +public: + DISALLOW_COPY_AND_MOVE(PointerDrawingManager); + PointerDrawingManager() = default; + ~PointerDrawingManager() = default; + + bool Init() override; + void DrawPointer(int32_t displayId, int32_t physicalX, int32_t physicalY, + const MOUSE_ICON mouseStyle = MOUSE_ICON::DEFAULT) override; + void UpdateDisplayInfo(const DisplayInfo& displayInfo) override; + void SetPointerLocation(int32_t pid, int32_t x, int32_t y) override; + void OnDisplayInfo(const DisplayGroupInfo& displayGroupInfo) override {} + void OnWindowInfo(const WinInfo &info) override {} + void DeletePointerVisible(int32_t pid) override {} + void SetMouseDisplayState(bool state) override {} + void DrawPointerStyle() override {} + int32_t SetPointerVisible(int32_t pid, bool visible) override + { + return WMError::WM_OK; + } + int32_t SetPointerStyle(int32_t pid, int32_t windowId, int32_t pointerStyle) override + { + return WMError::WM_OK; + } + int32_t GetPointerStyle(int32_t pid, int32_t windowId, int32_t &pointerStyle) override + { + return WMError::WM_OK; + } + bool IsPointerVisible() override + { + return true; + } + bool GetMouseDisplayState() const override + { + return true; + } + +private: + using Task = std::function; + struct IconStyle { + ICON_TYPE type; + std::string iconPath; + }; + + OHOS::WMError InitLayerNode(int32_t x, int32_t y); + OHOS::WMError InitDisplayNode(); + OHOS::WMError InitIconPixel(); + OHOS::WMError CheckPixelFile(const std::string &filePath); + OHOS::WMError MoveTo(int32_t x, int32_t y); + std::unique_ptr DecodeImageToPixelMap(const std::string &imagePath); + SkColorType PixelFormatConvert(const OHOS::Media::PixelFormat& pixelFormat); + + bool isDrawing_ = false; + int32_t displayWidth_ = 0; + int32_t displayHeight_ = 0; + int32_t displayId_ = 0; + std::map mouseIcons_; + OHOS::Rosen::RSDisplayNode::SharedPtr displayNode_ = nullptr; + OHOS::Rosen::RSSurfaceNode::SharedPtr surfaceNode_ = nullptr; + std::shared_ptr rsSurface_ = nullptr; + std::shared_ptr runner_ = nullptr; + std::shared_ptr handler_ = nullptr; +}; +} // namespace MMI +} // namespace OHOS +#endif // POINTER_DRAW_H -- Gitee From c077a3815e8faafde4f0e7aae3593a4f977d331a Mon Sep 17 00:00:00 2001 From: root Date: Thu, 6 Jul 2023 17:06:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BC=80=E5=90=AF=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E6=A8=A1=E5=9D=97=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/gn/BUILD.gn | 1 + window_manager/ft_pointer_draw/pointer_draw_manager.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/build/gn/BUILD.gn b/build/gn/BUILD.gn index 0da0214..22e2e28 100644 --- a/build/gn/BUILD.gn +++ b/build/gn/BUILD.gn @@ -22,6 +22,7 @@ group("ft_display_server") { group("ft_window_manager") { deps = [ "//window_manager/wmserver/ft_build:libwms", + "//window_manager/ft_pointer_draw:libpointerdraw", ] } diff --git a/window_manager/ft_pointer_draw/pointer_draw_manager.cpp b/window_manager/ft_pointer_draw/pointer_draw_manager.cpp index 63ade54..a3ac259 100644 --- a/window_manager/ft_pointer_draw/pointer_draw_manager.cpp +++ b/window_manager/ft_pointer_draw/pointer_draw_manager.cpp @@ -43,10 +43,12 @@ std::shared_ptr IPointerDrawingManager::GetInstance() bool PointerDrawingManager::Init() { +#ifndef USE_IMITATE_POINTER if (InitIconPixel() != WMError::WM_OK) { WLOGFE("InitIconPixel fail"); return false; } +#endif runner_ = AppExecFwk::EventRunner::Create("PointerDrawingManager"); handler_ = std::make_shared(runner_); -- Gitee From 0feed3174c111aa77bb08850c002f56c0538b619 Mon Sep 17 00:00:00 2001 From: jiangwenyu Date: Thu, 6 Jul 2023 09:25:40 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jiangwenyu --- .../ft_pointer_draw/ft_pointer_draw_manager_adapter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/window_manager/ft_pointer_draw/ft_pointer_draw_manager_adapter.cpp b/window_manager/ft_pointer_draw/ft_pointer_draw_manager_adapter.cpp index 9962963..d4f3b7e 100644 --- a/window_manager/ft_pointer_draw/ft_pointer_draw_manager_adapter.cpp +++ b/window_manager/ft_pointer_draw/ft_pointer_draw_manager_adapter.cpp @@ -98,5 +98,5 @@ bool FTPtrDrawMgrDrawPointer(const uintptr_t instanceHdl, int32_t displayId, int } #endif // __cplusplus -} // MMI -} // OHOS \ No newline at end of file +} // namespace MMI +} // namespace OHOS \ No newline at end of file -- Gitee