protocols/wayland: use UP and rvalue refs for callbacks (#11471)
use UP and rvalue refs in CWLCallbackResource and m_callbacks.
This commit is contained in:
parent
21953ddf3d
commit
1a0ed00f74
2 changed files with 5 additions and 5 deletions
|
|
@ -27,7 +27,7 @@ class CDefaultSurfaceRole : public ISurfaceRole {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CWLCallbackResource::CWLCallbackResource(SP<CWlCallback> resource_) : m_resource(resource_) {
|
CWLCallbackResource::CWLCallbackResource(UP<CWlCallback>&& resource_) : m_resource(std::move(resource_)) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -239,7 +239,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> resource_) : m_resource(re
|
||||||
m_pending.opaque = RG->m_region;
|
m_pending.opaque = RG->m_region;
|
||||||
});
|
});
|
||||||
|
|
||||||
m_resource->setFrame([this](CWlSurface* r, uint32_t id) { m_callbacks.emplace_back(makeShared<CWLCallbackResource>(makeShared<CWlCallback>(m_client, 1, id))); });
|
m_resource->setFrame([this](CWlSurface* r, uint32_t id) { m_callbacks.emplace_back(makeUnique<CWLCallbackResource>(makeUnique<CWlCallback>(m_client, 1, id))); });
|
||||||
|
|
||||||
m_resource->setOffset([this](CWlSurface* r, int32_t x, int32_t y) {
|
m_resource->setOffset([this](CWlSurface* r, int32_t x, int32_t y) {
|
||||||
m_pending.updated.bits.offset = true;
|
m_pending.updated.bits.offset = true;
|
||||||
|
|
|
||||||
|
|
@ -35,13 +35,13 @@ class CContentType;
|
||||||
|
|
||||||
class CWLCallbackResource {
|
class CWLCallbackResource {
|
||||||
public:
|
public:
|
||||||
CWLCallbackResource(SP<CWlCallback> resource_);
|
CWLCallbackResource(UP<CWlCallback>&& resource_);
|
||||||
|
|
||||||
bool good();
|
bool good();
|
||||||
void send(const Time::steady_tp& now);
|
void send(const Time::steady_tp& now);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SP<CWlCallback> m_resource;
|
UP<CWlCallback> m_resource;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CWLRegionResource {
|
class CWLRegionResource {
|
||||||
|
|
@ -95,7 +95,7 @@ class CWLSurfaceResource {
|
||||||
SSurfaceState m_pending;
|
SSurfaceState m_pending;
|
||||||
std::queue<UP<SSurfaceState>> m_pendingStates;
|
std::queue<UP<SSurfaceState>> m_pendingStates;
|
||||||
|
|
||||||
std::vector<SP<CWLCallbackResource>> m_callbacks;
|
std::vector<UP<CWLCallbackResource>> m_callbacks;
|
||||||
WP<CWLSurfaceResource> m_self;
|
WP<CWLSurfaceResource> m_self;
|
||||||
WP<CWLSurface> m_hlSurface;
|
WP<CWLSurface> m_hlSurface;
|
||||||
std::vector<PHLMONITORREF> m_enteredOutputs;
|
std::vector<PHLMONITORREF> m_enteredOutputs;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue