vi: fix confusion between closing and destroying layers

This commit is contained in:
Liam
2023-12-10 12:32:44 -05:00
parent 875568bb3e
commit adc3079613
8 changed files with 74 additions and 42 deletions

View File

@@ -8,8 +8,8 @@ namespace Service::VI {
Layer::Layer(u64 layer_id_, u32 binder_id_, android::BufferQueueCore& core_,
android::BufferQueueProducer& binder_,
std::shared_ptr<android::BufferItemConsumer>&& consumer_)
: layer_id{layer_id_}, binder_id{binder_id_}, core{core_}, binder{binder_}, consumer{std::move(
consumer_)} {}
: layer_id{layer_id_}, binder_id{binder_id_}, core{core_}, binder{binder_},
consumer{std::move(consumer_)}, open{false} {}
Layer::~Layer() = default;

View File

@@ -71,12 +71,25 @@ public:
return core;
}
bool IsOpen() const {
return open;
}
void Close() {
open = false;
}
void Open() {
open = true;
}
private:
const u64 layer_id;
const u32 binder_id;
android::BufferQueueCore& core;
android::BufferQueueProducer& binder;
std::shared_ptr<android::BufferItemConsumer> consumer;
bool open;
};
} // namespace Service::VI