diff options
| author | Tom Englund <tomenglund26@gmail.com> | 2025-07-10 13:09:19 +0200 |
|---|---|---|
| committer | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-07-10 14:09:00 +0200 |
| commit | bcb96c553214d0938289c0fc7d79de82629ccf18 (patch) | |
| tree | ef1c8dd6224e794914af5157f9e25c147c918fff /src/protocols/PresentationTime.hpp | |
| parent | f22b5971d195e7fbb900bc20479b810a9849171c (diff) | |
presentation: move to unique ptrs
less refcounting, move by rvalue.
Diffstat (limited to 'src/protocols/PresentationTime.hpp')
| -rw-r--r-- | src/protocols/PresentationTime.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/protocols/PresentationTime.hpp b/src/protocols/PresentationTime.hpp index a7b13a77..c348c175 100644 --- a/src/protocols/PresentationTime.hpp +++ b/src/protocols/PresentationTime.hpp @@ -33,14 +33,14 @@ class CQueuedPresentationData { class CPresentationFeedback { public: - CPresentationFeedback(SP<CWpPresentationFeedback> resource_, SP<CWLSurfaceResource> surf); + CPresentationFeedback(UP<CWpPresentationFeedback>&& resource_, SP<CWLSurfaceResource> surf); bool good(); - void sendQueued(SP<CQueuedPresentationData> data, const Time::steady_tp& when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags); + void sendQueued(WP<CQueuedPresentationData> data, const Time::steady_tp& when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags); private: - SP<CWpPresentationFeedback> m_resource; + UP<CWpPresentationFeedback> m_resource; WP<CWLSurfaceResource> m_surface; bool m_done = false; @@ -54,7 +54,7 @@ class CPresentationProtocol : public IWaylandProtocol { virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id); void onPresented(PHLMONITOR pMonitor, const Time::steady_tp& when, uint32_t untilRefreshNs, uint64_t seq, uint32_t reportedFlags); - void queueData(SP<CQueuedPresentationData> data); + void queueData(UP<CQueuedPresentationData>&& data); private: void onManagerResourceDestroy(wl_resource* res); @@ -63,8 +63,8 @@ class CPresentationProtocol : public IWaylandProtocol { // std::vector<UP<CWpPresentation>> m_managers; - std::vector<SP<CPresentationFeedback>> m_feedbacks; - std::vector<SP<CQueuedPresentationData>> m_queue; + std::vector<UP<CPresentationFeedback>> m_feedbacks; + std::vector<UP<CQueuedPresentationData>> m_queue; friend class CPresentationFeedback; }; |
