hle: kernel: Migrate KEvent to KAutoObject.
This commit is contained in:
parent
086db71e94
commit
addc0bf037
37 changed files with 269 additions and 266 deletions
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue