diff options
author | bunnei <bunneidev@gmail.com> | 2021-04-04 09:56:09 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-05-06 01:40:50 +0200 |
commit | addc0bf0379e075786048921bede6e089552a6db (patch) | |
tree | 7fa8819b52db29e1b354410441dd8f2438e2ed4a /src/core/hle/service/vi | |
parent | hle: kernel: Migrate KSharedMemory to KAutoObject. (diff) | |
download | yuzu-addc0bf0379e075786048921bede6e089552a6db.tar yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.gz yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.bz2 yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.lz yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.xz yuzu-addc0bf0379e075786048921bede6e089552a6db.tar.zst yuzu-addc0bf0379e075786048921bede6e089552a6db.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/vi/display/vi_display.cpp | 11 | ||||
-rw-r--r-- | src/core/hle/service/vi/display/vi_display.h | 12 |
2 files changed, 10 insertions, 13 deletions
diff --git a/src/core/hle/service/vi/display/vi_display.cpp b/src/core/hle/service/vi/display/vi_display.cpp index 9ffa71352..ebaacaa6b 100644 --- a/src/core/hle/service/vi/display/vi_display.cpp +++ b/src/core/hle/service/vi/display/vi_display.cpp @@ -17,10 +17,9 @@ namespace Service::VI { -Display::Display(u64 id, std::string name, Core::System& system) : id{id}, name{std::move(name)} { - auto& kernel = system.Kernel(); - vsync_event = Kernel::KEvent::Create(kernel, fmt::format("Display VSync Event {}", id)); - vsync_event->Initialize(); +Display::Display(u64 id, std::string name, Core::System& system) + : id{id}, name{std::move(name)}, vsync_event{system.Kernel()} { + vsync_event.Initialize(fmt::format("Display VSync Event {}", id)); } Display::~Display() = default; @@ -34,11 +33,11 @@ const Layer& Display::GetLayer(std::size_t index) const { } std::shared_ptr<Kernel::KReadableEvent> Display::GetVSyncEvent() const { - return SharedFrom(vsync_event->GetReadableEvent()); + return vsync_event.GetReadableEvent(); } void Display::SignalVSyncEvent() { - vsync_event->GetWritableEvent()->Signal(); + vsync_event.GetWritableEvent()->Signal(); } void Display::CreateLayer(u64 layer_id, NVFlinger::BufferQueue& buffer_queue) { diff --git a/src/core/hle/service/vi/display/vi_display.h b/src/core/hle/service/vi/display/vi_display.h index 8340059de..e990d6809 100644 --- a/src/core/hle/service/vi/display/vi_display.h +++ b/src/core/hle/service/vi/display/vi_display.h @@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "common/common_funcs.h" #include "common/common_types.h" namespace Kernel { @@ -24,6 +25,9 @@ class Layer; /// Represents a single display type class Display { + NON_COPYABLE(Display); + NON_MOVEABLE(Display); + public: /// Constructs a display with a given unique ID and name. /// @@ -33,12 +37,6 @@ public: Display(u64 id, std::string name, Core::System& system); ~Display(); - Display(const Display&) = delete; - Display& operator=(const Display&) = delete; - - Display(Display&&) = default; - Display& operator=(Display&&) = default; - /// Gets the unique ID assigned to this display. u64 GetID() const { return id; @@ -102,7 +100,7 @@ private: std::string name; std::vector<std::shared_ptr<Layer>> layers; - std::shared_ptr<Kernel::KEvent> vsync_event; + Kernel::KEvent vsync_event; }; } // namespace Service::VI |