diff options
Diffstat (limited to 'src/core/hle/service/vi/display')
-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 |