summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/vi/layer.h
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2024-02-19 06:36:53 +0100
committerGitHub <noreply@github.com>2024-02-19 06:36:53 +0100
commit8615509c4054f497fbd6ed9a7adee5a998597905 (patch)
tree293bff8e944c2ca632524e39bbfba33d6475af16 /src/core/hle/service/vi/layer.h
parentMerge pull request #13048 from liamwhite/new-shell (diff)
parentnvnflinger: check for layers before compose (diff)
downloadyuzu-8615509c4054f497fbd6ed9a7adee5a998597905.tar
yuzu-8615509c4054f497fbd6ed9a7adee5a998597905.tar.gz
yuzu-8615509c4054f497fbd6ed9a7adee5a998597905.tar.bz2
yuzu-8615509c4054f497fbd6ed9a7adee5a998597905.tar.lz
yuzu-8615509c4054f497fbd6ed9a7adee5a998597905.tar.xz
yuzu-8615509c4054f497fbd6ed9a7adee5a998597905.tar.zst
yuzu-8615509c4054f497fbd6ed9a7adee5a998597905.zip
Diffstat (limited to 'src/core/hle/service/vi/layer.h')
-rw-r--r--src/core/hle/service/vi/layer.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/core/hle/service/vi/layer.h b/src/core/hle/service/vi/layer.h
new file mode 100644
index 000000000..b85c8df61
--- /dev/null
+++ b/src/core/hle/service/vi/layer.h
@@ -0,0 +1,79 @@
+// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "common/common_types.h"
+
+namespace Service::VI {
+
+class Display;
+
+class Layer {
+public:
+ constexpr Layer() = default;
+
+ void Initialize(u64 id, u64 owner_aruid, Display* display) {
+ m_id = id;
+ m_owner_aruid = owner_aruid;
+ m_display = display;
+ m_is_initialized = true;
+ }
+
+ void Finalize() {
+ m_id = {};
+ m_display = {};
+ m_is_initialized = {};
+ }
+
+ void Open(s32 consumer_binder_id, s32 producer_binder_id) {
+ m_consumer_binder_id = consumer_binder_id;
+ m_producer_binder_id = producer_binder_id;
+ m_is_open = true;
+ }
+
+ void Close() {
+ m_producer_binder_id = {};
+ m_consumer_binder_id = {};
+ m_is_open = {};
+ }
+
+ u64 GetId() const {
+ return m_id;
+ }
+
+ u64 GetOwnerAruid() const {
+ return m_owner_aruid;
+ }
+
+ Display* GetDisplay() const {
+ return m_display;
+ }
+
+ s32 GetConsumerBinderId() const {
+ return m_consumer_binder_id;
+ }
+
+ s32 GetProducerBinderId() const {
+ return m_producer_binder_id;
+ }
+
+ bool IsInitialized() const {
+ return m_is_initialized;
+ }
+
+ bool IsOpen() const {
+ return m_is_open;
+ }
+
+private:
+ u64 m_id{};
+ u64 m_owner_aruid{};
+ Display* m_display{};
+ s32 m_consumer_binder_id{};
+ s32 m_producer_binder_id{};
+ bool m_is_initialized{};
+ bool m_is_open{};
+};
+
+} // namespace Service::VI