From 12120186bf491fc5012096e1cc518bba2eedb781 Mon Sep 17 00:00:00 2001 From: yanansong Date: Sun, 17 Sep 2023 13:20:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=88=B6=E5=AD=90surface=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/core/wayland_subsurface.cpp | 27 ++++- .../framework/core/wayland_subsurface.h | 6 + .../framework/core/wayland_surface.cpp | 107 ++++++++++++++---- .../framework/core/wayland_surface.h | 19 +++- .../framework/stable/wayland_xdg_surface.cpp | 2 + .../framework/stable/wayland_xdg_toplevel.cpp | 2 +- wayland_adapter/utils/include/wayalnd_utils.h | 7 ++ 7 files changed, 144 insertions(+), 26 deletions(-) diff --git a/wayland_adapter/framework/core/wayland_subsurface.cpp b/wayland_adapter/framework/core/wayland_subsurface.cpp index 009315c..6a24f6b 100644 --- a/wayland_adapter/framework/core/wayland_subsurface.cpp +++ b/wayland_adapter/framework/core/wayland_subsurface.cpp @@ -16,6 +16,7 @@ #include "wayland_subsurface.h" #include "wayland_objects_pool.h" +#include "wayland_surface.h" namespace FT { namespace Wayland { @@ -32,7 +33,11 @@ struct wl_subsurface_interface IWaylandSubSurface::impl_ = { .set_desync = IWaylandSubSurface::SetDesync, }; -void IWaylandSubSurface::SetPosition(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y) {} +void IWaylandSubSurface::SetPosition(struct wl_client *client, struct wl_resource *resource, int32_t x, int32_t y) +{ + CAST_OBJECT_AND_CALL_FUNC(WaylandSubSurface, resource, + "IWaylandSubSurface::SetPosition: failed to find object.", SetPosition, resource, x, y); +} void IWaylandSubSurface::PlaceAbove(struct wl_client *client, struct wl_resource *resource, struct wl_resource *sibling) {} @@ -58,7 +63,25 @@ OHOS::sptr WaylandSubSurface::Create(struct wl_client *client WaylandSubSurface::WaylandSubSurface(struct wl_client *client, uint32_t version, uint32_t id, struct wl_resource *surface, struct wl_resource *parent) - : WaylandResourceObject(client, &wl_subsurface_interface, version, id, &IWaylandSubSurface::impl_) {} + : WaylandResourceObject(client, &wl_subsurface_interface, version, id, &IWaylandSubSurface::impl_) +{ + parent_ = parent; + child_ = surface; +} + +void WaylandSubSurface::SetPosition(struct wl_resource *resource, int32_t x, int32_t y) +{ + if ((positionX_ != x) || (positionY_ != y)) { + LOG_INFO("SetPosition X:%{public}d, Y:%{public}d", x, y); + auto surfaceParent = CastFromResource(parent_); + auto surfaceChild = CastFromResource(child_); + surfaceParent->AddChild(child_, x, y); + surfaceChild->AddParent(parent_); + positionX_ = x; + positionY_ = y; + } + +} WaylandSubSurface::~WaylandSubSurface() noexcept {} } // namespace Wayland diff --git a/wayland_adapter/framework/core/wayland_subsurface.h b/wayland_adapter/framework/core/wayland_subsurface.h index fffa6b4..55cbd7f 100644 --- a/wayland_adapter/framework/core/wayland_subsurface.h +++ b/wayland_adapter/framework/core/wayland_subsurface.h @@ -33,10 +33,16 @@ public: static OHOS::sptr Create(struct wl_client *client, uint32_t version, uint32_t id, struct wl_resource *surface, struct wl_resource *parent); ~WaylandSubSurface() noexcept override; + void SetPosition(struct wl_resource *resource, int32_t x, int32_t y); private: WaylandSubSurface(struct wl_client *client, uint32_t version, uint32_t id, struct wl_resource *surface, struct wl_resource *parent); + + struct wl_resource *parent_; + struct wl_resource *child_; + int32_t positionX_ = -1; + int32_t positionY_ = -1; }; } // namespace Wayland } // namespace FT diff --git a/wayland_adapter/framework/core/wayland_surface.cpp b/wayland_adapter/framework/core/wayland_surface.cpp index a077929..5777c86 100644 --- a/wayland_adapter/framework/core/wayland_surface.cpp +++ b/wayland_adapter/framework/core/wayland_surface.cpp @@ -360,16 +360,22 @@ void WaylandSurface::Commit() if (isPointerSurface_) { return; // it is pointer surface, we do not handle commit! } + LOG_DEBUG("%{public}p withTopLevel_ %{public}d", this, withTopLevel_); - if (window_ == nullptr) { + if (withTopLevel_ && (window_ == nullptr)) { CreateWindow(); + LOG_DEBUG("CreateWindow"); + } else { HandleCommit(); + LOG_DEBUG("HandleCommit withTopLevel_ %{public}d", withTopLevel_); } for (auto &cb : commitCallbacks_) { cb(); } + + } void WaylandSurface::SetBufferTransform(int32_t transform) @@ -498,11 +504,7 @@ void WaylandSurface::CreateWindow() void WaylandSurface::CopyBuffer(struct wl_shm_buffer *shm) { - if (rsSurface_ == nullptr) { - LOG_ERROR("rsSurface_ is nullptr"); - return; - } - + LOG_ERROR("%{public}p cpy withTopLevel_ %{public}d", this, withTopLevel_); SkColorType format = ShmFormatToSkia(wl_shm_buffer_get_format(shm)); if (format == SkColorType::kUnknown_SkColorType) { LOG_ERROR("unsupported format %{public}d", wl_shm_buffer_get_format(shm)); @@ -522,26 +524,22 @@ void WaylandSurface::CopyBuffer(struct wl_shm_buffer *shm) LOG_ERROR("wl_shm_buffer_get_data fail"); return; } - - auto framePtr = rsSurface_->RequestFrame(width, height); - if (framePtr == nullptr) { - LOG_ERROR("RequestFrame failed"); - return; + SkImageInfo imageInfo = SkImageInfo::Make(width, height, format, kUnpremul_SkAlphaType); + SkPixmap srcPixmap(imageInfo, data, stride); + { + std::lock_guard lg(bitmapMutex_); + srcBitmap_.installPixels(srcPixmap); } - auto canvas = framePtr->GetCanvas(); - if (canvas == nullptr) { - LOG_ERROR("GetCanvas failed"); + if (!withTopLevel_) { + auto surfaceParent = CastFromResource(parentSurfaceRes_); + if (parentSurfaceRes_ != nullptr) { + surfaceParent->TriggerInnerDraw(); + } + LOG_DEBUG("return because without toplevel"); return; } - canvas->clear(SK_ColorTRANSPARENT); - - SkImageInfo imageInfo = SkImageInfo::Make(width, height, format, kUnpremul_SkAlphaType); - SkPixmap srcPixmap(imageInfo, data, stride); - SkBitmap srcBitmap; - srcBitmap.installPixels(srcPixmap); - canvas->drawBitmap(srcBitmap, 0, 0); - rsSurface_->FlushFrame(framePtr); + TriggerInnerDraw(); } void WaylandSurface::OnSizeChange(const OHOS::Rosen::Rect& rect, OHOS::Rosen::WindowSizeChangeReason reason) @@ -664,5 +662,70 @@ void WaylandSurface::Close() } window_->Close(); } + +void WaylandSurface::WithTopLevel(bool toplevel) +{ + withTopLevel_ = toplevel; +} + +void WaylandSurface::AddChild(struct wl_resource *child, int32_t x, int32_t y) +{ + if (child == nullptr) { + LOG_ERROR("AddChild with nullptr resource"); + return; + } + SubSurfaceData data; + data.surface = child; + data.offsetX = x; + data.offsetY = y; + childs_.push_back(data); + for (auto &cb : rectCallbacks_) { + cb(rect_); + } +} + +void WaylandSurface::AddParent(struct wl_resource *parent) +{ + parentSurfaceRes_ = parent; +} + +void WaylandSurface::ProcessSrcBitmap(SkCanvas* canvas, int32_t x, int32_t y) +{ + std::lock_guard lg(bitmapMutex_); + canvas->drawBitmap(srcBitmap_, x, y); + LOG_DEBUG("draw child offsetx %{public}d, offsety %{public}d,", x, y); +} + +void WaylandSurface::TriggerInnerDraw() +{ + if (rsSurface_ == nullptr) { + LOG_ERROR("rsSurface_ is nullptr"); + return; + } + auto framePtr = rsSurface_->RequestFrame(srcBitmap_.width(), srcBitmap_.height()); + if (framePtr == nullptr) { + LOG_ERROR("RequestFrame failed"); + return; + } + + auto canvas = framePtr->GetCanvas(); + if (canvas == nullptr) { + LOG_ERROR("GetCanvas failed"); + return; + } + canvas->clear(SK_ColorTRANSPARENT); + canvas->drawBitmap(srcBitmap_, 0, 0); + LOG_DEBUG("draw drawBitmap %{public}zu", childs_.size()); + for (auto data : childs_) { + if (data.surface == nullptr) { + continue; + } + LOG_DEBUG("draw Child"); + auto surfaceChild = CastFromResource(data.surface); + surfaceChild->ProcessSrcBitmap(canvas, data.offsetX, data.offsetY); + } + rsSurface_->FlushFrame(framePtr); +} + } // namespace Wayland } // namespace FT diff --git a/wayland_adapter/framework/core/wayland_surface.h b/wayland_adapter/framework/core/wayland_surface.h index f58794b..58467cb 100644 --- a/wayland_adapter/framework/core/wayland_surface.h +++ b/wayland_adapter/framework/core/wayland_surface.h @@ -16,6 +16,8 @@ #pragma once #include +#include +#include #include #include "wayland_resource_object.h" #include "wayalnd_utils.h" @@ -45,6 +47,7 @@ struct IWaylandSurface { static struct wl_surface_interface impl_; }; + class WaylandSurface final : public WaylandResourceObject { friend struct IWaylandSurface; @@ -72,7 +75,12 @@ public: void UnSetFullscreen(); void SetMinimized(); void Close(); - + void WithTopLevel(bool toplevel); + void AddChild(struct wl_resource *child, int32_t x, int32_t y); + void AddParent(struct wl_resource *parent); + void ProcessSrcBitmap(SkCanvas* canvas, int32_t x, int32_t y); + void TriggerInnerDraw(); + private: WaylandSurface(struct wl_client *client, struct wl_resource *parent, uint32_t version, uint32_t id); @@ -109,6 +117,15 @@ private: std::shared_ptr rsSurface_; std::string windowTitle_ = "unknow"; bool maximized_ = false; + bool withTopLevel_ = false; + void *data_; + std::vector childs_; + struct wl_resource *parentSurfaceRes_ = nullptr; + std::mutex bitmapMutex_; + SkBitmap srcBitmap_; }; + + + } // namespace Wayland } // namespace FT diff --git a/wayland_adapter/framework/stable/wayland_xdg_surface.cpp b/wayland_adapter/framework/stable/wayland_xdg_surface.cpp index 2604c24..9dcb7bc 100644 --- a/wayland_adapter/framework/stable/wayland_xdg_surface.cpp +++ b/wayland_adapter/framework/stable/wayland_xdg_surface.cpp @@ -96,6 +96,7 @@ void WaylandXdgSurface::GetToplevel(uint32_t id) } role_ = SurfaceRole::XDG_TOPLEVEL; + surface_->WithTopLevel(true); } void WaylandXdgSurface::GetPopup(uint32_t id, struct wl_resource *parent, struct wl_resource *positioner) @@ -157,6 +158,7 @@ void WaylandXdgSurface::OnSurfaceRect(Rect rect) auto topLevel = toplevel_.promote(); if (topLevel != nullptr) { topLevel->SetRect(rect); + xdg_surface_send_configure(WlResource(), wl_display_next_serial(WlDisplay())); } } } diff --git a/wayland_adapter/framework/stable/wayland_xdg_toplevel.cpp b/wayland_adapter/framework/stable/wayland_xdg_toplevel.cpp index 23bab9f..f015964 100644 --- a/wayland_adapter/framework/stable/wayland_xdg_toplevel.cpp +++ b/wayland_adapter/framework/stable/wayland_xdg_toplevel.cpp @@ -147,7 +147,7 @@ OHOS::sptr WaylandXdgToplevel::Create(const OHOS::sptr &xdgSurface, uint32_t id) : WaylandResourceObject(xdgSurface->WlClient(), &xdg_toplevel_interface, xdgSurface->Version(), id, &IWaylandXdgToplevel::impl_), - xdgSurface_(xdgSurface) + xdgSurface_(xdgSurface) { LOG_DEBUG("enter"); } diff --git a/wayland_adapter/utils/include/wayalnd_utils.h b/wayland_adapter/utils/include/wayalnd_utils.h index 666aba4..7fa5215 100644 --- a/wayland_adapter/utils/include/wayalnd_utils.h +++ b/wayland_adapter/utils/include/wayalnd_utils.h @@ -93,5 +93,12 @@ static SkColorType ShmFormatToSkia(const uint32_t& shmFormat) return SkColorType::kUnknown_SkColorType; } } + +struct SubSurfaceData { + struct wl_resource *surface = nullptr; + int32_t offsetX = 0; + int32_t offsetY = 0; +}; + } // namespace Wayland } // namespace FT -- Gitee From 693aa0d8aa33e949dd355f32c90ca9e2e23754fb Mon Sep 17 00:00:00 2001 From: yanansong Date: Mon, 18 Sep 2023 10:37:59 +0800 Subject: [PATCH 2/3] enable zoom sub surface --- .../framework/core/wayland_subsurface.cpp | 1 - .../framework/core/wayland_surface.cpp | 28 ++++++++++++------- .../framework/core/wayland_surface.h | 3 +- .../framework/stable/wayland_xdg_toplevel.cpp | 5 ++-- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/wayland_adapter/framework/core/wayland_subsurface.cpp b/wayland_adapter/framework/core/wayland_subsurface.cpp index 6a24f6b..7184d0e 100644 --- a/wayland_adapter/framework/core/wayland_subsurface.cpp +++ b/wayland_adapter/framework/core/wayland_subsurface.cpp @@ -80,7 +80,6 @@ void WaylandSubSurface::SetPosition(struct wl_resource *resource, int32_t x, int positionX_ = x; positionY_ = y; } - } WaylandSubSurface::~WaylandSubSurface() noexcept {} diff --git a/wayland_adapter/framework/core/wayland_surface.cpp b/wayland_adapter/framework/core/wayland_surface.cpp index 5777c86..eabcc61 100644 --- a/wayland_adapter/framework/core/wayland_surface.cpp +++ b/wayland_adapter/framework/core/wayland_surface.cpp @@ -300,9 +300,10 @@ void WaylandSurface::Damage(int32_t x, int32_t y, int32_t width, int32_t height) void WaylandSurface::Frame(uint32_t callback) { + bool pending = false; if (new_.cb != nullptr) { + pending = true; LOG_WARN("duplicate frame request"); - return; } auto cb = FrameCallback::Create(WlClient(), WAYLAND_VERSION_MAJOR, callback); @@ -312,6 +313,10 @@ void WaylandSurface::Frame(uint32_t callback) } WaylandObjectsPool::GetInstance().AddObject(ObjectId(cb->WlClient(), cb->Id()), cb); + if (pending) { + pengindCb_.push_back(cb); + return; + } new_.cb = cb; } @@ -360,15 +365,15 @@ void WaylandSurface::Commit() if (isPointerSurface_) { return; // it is pointer surface, we do not handle commit! } - LOG_DEBUG("%{public}p withTopLevel_ %{public}d", this, withTopLevel_); if (withTopLevel_ && (window_ == nullptr)) { CreateWindow(); LOG_DEBUG("CreateWindow"); - } else { + } + { HandleCommit(); - LOG_DEBUG("HandleCommit withTopLevel_ %{public}d", withTopLevel_); + LOG_DEBUG("withTopLevel_ %{public}d", withTopLevel_); } for (auto &cb : commitCallbacks_) { @@ -423,6 +428,11 @@ void WaylandSurface::HandleCommit() { wl_callback_send_done(new_.cb->WlResource(), 0); wl_resource_destroy(new_.cb->WlResource()); new_.cb = nullptr; + for (auto &cb : pengindCb_) { + wl_callback_send_done(cb->WlResource(), 0); + wl_resource_destroy(cb->WlResource()); + } + pengindCb_.clear(); } old_ = new_; @@ -504,7 +514,6 @@ void WaylandSurface::CreateWindow() void WaylandSurface::CopyBuffer(struct wl_shm_buffer *shm) { - LOG_ERROR("%{public}p cpy withTopLevel_ %{public}d", this, withTopLevel_); SkColorType format = ShmFormatToSkia(wl_shm_buffer_get_format(shm)); if (format == SkColorType::kUnknown_SkColorType) { LOG_ERROR("unsupported format %{public}d", wl_shm_buffer_get_format(shm)); @@ -534,12 +543,12 @@ void WaylandSurface::CopyBuffer(struct wl_shm_buffer *shm) if (!withTopLevel_) { auto surfaceParent = CastFromResource(parentSurfaceRes_); if (parentSurfaceRes_ != nullptr) { - surfaceParent->TriggerInnerDraw(); + surfaceParent->TriggerInnerCompose(); } LOG_DEBUG("return because without toplevel"); return; } - TriggerInnerDraw(); + TriggerInnerCompose(); } void WaylandSurface::OnSizeChange(const OHOS::Rosen::Rect& rect, OHOS::Rosen::WindowSizeChangeReason reason) @@ -696,7 +705,7 @@ void WaylandSurface::ProcessSrcBitmap(SkCanvas* canvas, int32_t x, int32_t y) LOG_DEBUG("draw child offsetx %{public}d, offsety %{public}d,", x, y); } -void WaylandSurface::TriggerInnerDraw() +void WaylandSurface::TriggerInnerCompose() { if (rsSurface_ == nullptr) { LOG_ERROR("rsSurface_ is nullptr"); @@ -715,12 +724,11 @@ void WaylandSurface::TriggerInnerDraw() } canvas->clear(SK_ColorTRANSPARENT); canvas->drawBitmap(srcBitmap_, 0, 0); - LOG_DEBUG("draw drawBitmap %{public}zu", childs_.size()); for (auto data : childs_) { if (data.surface == nullptr) { continue; } - LOG_DEBUG("draw Child"); + LOG_DEBUG("Draw Child"); auto surfaceChild = CastFromResource(data.surface); surfaceChild->ProcessSrcBitmap(canvas, data.offsetX, data.offsetY); } diff --git a/wayland_adapter/framework/core/wayland_surface.h b/wayland_adapter/framework/core/wayland_surface.h index 58467cb..a39f107 100644 --- a/wayland_adapter/framework/core/wayland_surface.h +++ b/wayland_adapter/framework/core/wayland_surface.h @@ -79,7 +79,7 @@ public: void AddChild(struct wl_resource *child, int32_t x, int32_t y); void AddParent(struct wl_resource *parent); void ProcessSrcBitmap(SkCanvas* canvas, int32_t x, int32_t y); - void TriggerInnerDraw(); + void TriggerInnerCompose(); private: WaylandSurface(struct wl_client *client, struct wl_resource *parent, uint32_t version, uint32_t id); @@ -123,6 +123,7 @@ private: struct wl_resource *parentSurfaceRes_ = nullptr; std::mutex bitmapMutex_; SkBitmap srcBitmap_; + std::vector> pengindCb_; }; diff --git a/wayland_adapter/framework/stable/wayland_xdg_toplevel.cpp b/wayland_adapter/framework/stable/wayland_xdg_toplevel.cpp index f015964..baa6931 100644 --- a/wayland_adapter/framework/stable/wayland_xdg_toplevel.cpp +++ b/wayland_adapter/framework/stable/wayland_xdg_toplevel.cpp @@ -274,14 +274,15 @@ void WaylandXdgToplevel::HandleCommit() void WaylandXdgToplevel::SetRect(Rect rect) { - LOG_DEBUG("Window %{public}s.", windowTitle_.c_str()); rect_ = rect; - struct wl_array states; uint32_t *s; wl_array_init(&states); + wl_array_init(&states); s = static_cast(wl_array_add(&states, sizeof(uint32_t))); *s = XDG_TOPLEVEL_STATE_RESIZING; + s = static_cast(wl_array_add(&states, sizeof(uint32_t))); + *s = XDG_TOPLEVEL_STATE_ACTIVATED; xdg_toplevel_send_configure(WlResource(), rect.width, rect.height, &states); wl_array_release(&states); } -- Gitee From 78f59c5880edebbdc1e5c64a12bfe7589394d997 Mon Sep 17 00:00:00 2001 From: yanansong Date: Mon, 18 Sep 2023 17:24:17 +0800 Subject: [PATCH 3/3] code style --- .../framework/core/wayland_subsurface.cpp | 12 ++++++------ wayland_adapter/framework/core/wayland_subsurface.h | 4 ++-- wayland_adapter/framework/core/wayland_surface.cpp | 9 +++++++-- wayland_adapter/framework/core/wayland_surface.h | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/wayland_adapter/framework/core/wayland_subsurface.cpp b/wayland_adapter/framework/core/wayland_subsurface.cpp index 7184d0e..e12ce9f 100644 --- a/wayland_adapter/framework/core/wayland_subsurface.cpp +++ b/wayland_adapter/framework/core/wayland_subsurface.cpp @@ -65,18 +65,18 @@ WaylandSubSurface::WaylandSubSurface(struct wl_client *client, uint32_t version, struct wl_resource *surface, struct wl_resource *parent) : WaylandResourceObject(client, &wl_subsurface_interface, version, id, &IWaylandSubSurface::impl_) { - parent_ = parent; - child_ = surface; + parentSurfaceRes_ = parent; + childSurfaceRes_ = surface; } void WaylandSubSurface::SetPosition(struct wl_resource *resource, int32_t x, int32_t y) { if ((positionX_ != x) || (positionY_ != y)) { LOG_INFO("SetPosition X:%{public}d, Y:%{public}d", x, y); - auto surfaceParent = CastFromResource(parent_); - auto surfaceChild = CastFromResource(child_); - surfaceParent->AddChild(child_, x, y); - surfaceChild->AddParent(parent_); + auto surfaceParent = CastFromResource(parentSurfaceRes_); + auto surfaceChild = CastFromResource(childSurfaceRes_); + surfaceParent->AddChild(childSurfaceRes_, x, y); + surfaceChild->AddParent(parentSurfaceRes_); positionX_ = x; positionY_ = y; } diff --git a/wayland_adapter/framework/core/wayland_subsurface.h b/wayland_adapter/framework/core/wayland_subsurface.h index 55cbd7f..71048a2 100644 --- a/wayland_adapter/framework/core/wayland_subsurface.h +++ b/wayland_adapter/framework/core/wayland_subsurface.h @@ -39,8 +39,8 @@ private: WaylandSubSurface(struct wl_client *client, uint32_t version, uint32_t id, struct wl_resource *surface, struct wl_resource *parent); - struct wl_resource *parent_; - struct wl_resource *child_; + struct wl_resource *parentSurfaceRes_; + struct wl_resource *childSurfaceRes_; int32_t positionX_ = -1; int32_t positionY_ = -1; }; diff --git a/wayland_adapter/framework/core/wayland_surface.cpp b/wayland_adapter/framework/core/wayland_surface.cpp index eabcc61..3291c44 100644 --- a/wayland_adapter/framework/core/wayland_surface.cpp +++ b/wayland_adapter/framework/core/wayland_surface.cpp @@ -683,11 +683,16 @@ void WaylandSurface::AddChild(struct wl_resource *child, int32_t x, int32_t y) LOG_ERROR("AddChild with nullptr resource"); return; } + if (childs_.count(child) > 0) { + childs_[child].offsetX = x; + childs_[child].offsetX = y; + return; + } SubSurfaceData data; data.surface = child; data.offsetX = x; data.offsetY = y; - childs_.push_back(data); + childs_[child] = data; for (auto &cb : rectCallbacks_) { cb(rect_); } @@ -724,7 +729,7 @@ void WaylandSurface::TriggerInnerCompose() } canvas->clear(SK_ColorTRANSPARENT); canvas->drawBitmap(srcBitmap_, 0, 0); - for (auto data : childs_) { + for (auto &&[childKey, data] : childs_) { if (data.surface == nullptr) { continue; } diff --git a/wayland_adapter/framework/core/wayland_surface.h b/wayland_adapter/framework/core/wayland_surface.h index a39f107..9c385dd 100644 --- a/wayland_adapter/framework/core/wayland_surface.h +++ b/wayland_adapter/framework/core/wayland_surface.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include "wayland_resource_object.h" @@ -118,8 +119,7 @@ private: std::string windowTitle_ = "unknow"; bool maximized_ = false; bool withTopLevel_ = false; - void *data_; - std::vector childs_; + std::map childs_; struct wl_resource *parentSurfaceRes_ = nullptr; std::mutex bitmapMutex_; SkBitmap srcBitmap_; -- Gitee