early-access version 2731

This commit is contained in:
pineappleEA
2022-05-19 07:27:35 +02:00
parent c7aa528a40
commit e1efbad3be
33 changed files with 1092 additions and 1006 deletions

View File

@@ -5,11 +5,7 @@
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::Layer(u64 id, NVFlinger::BufferQueue& queue) : layer_id{id}, buffer_queue{queue} {}
Layer::~Layer() = default;

View File

@@ -3,15 +3,11 @@
#pragma once
#include <memory>
#include "common/common_types.h"
namespace Service::android {
class BufferItemConsumer;
class BufferQueueCore;
class BufferQueueProducer;
} // namespace Service::android
namespace Service::NVFlinger {
class BufferQueue;
}
namespace Service::VI {
@@ -20,13 +16,10 @@ class Layer {
public:
/// Constructs a layer with a given ID and buffer queue.
///
/// @param layer_id_ The ID to assign to this layer.
/// @param binder_id_ The binder ID to assign to this layer.
/// @param binder_ The buffer producer queue for this layer to use.
/// @param id The ID to assign to this layer.
/// @param queue The buffer queue for this layer to use.
///
Layer(u64 layer_id_, u32 binder_id_, android::BufferQueueCore& core_,
android::BufferQueueProducer& binder_,
std::shared_ptr<android::BufferItemConsumer>&& consumer_);
Layer(u64 id, NVFlinger::BufferQueue& queue);
~Layer();
Layer(const Layer&) = delete;
@@ -36,47 +29,23 @@ public:
Layer& operator=(Layer&&) = delete;
/// Gets the ID for this layer.
u64 GetLayerId() const {
u64 GetID() const {
return layer_id;
}
/// Gets the binder ID for this layer.
u32 GetBinderId() const {
return binder_id;
}
/// Gets a reference to the buffer queue this layer is using.
android::BufferQueueProducer& GetBufferQueue() {
return binder;
NVFlinger::BufferQueue& GetBufferQueue() {
return buffer_queue;
}
/// Gets a const reference to the buffer queue this layer is using.
const android::BufferQueueProducer& GetBufferQueue() const {
return binder;
}
android::BufferItemConsumer& GetConsumer() {
return *consumer;
}
const android::BufferItemConsumer& GetConsumer() const {
return *consumer;
}
android::BufferQueueCore& Core() {
return core;
}
const android::BufferQueueCore& Core() const {
return core;
const NVFlinger::BufferQueue& GetBufferQueue() const {
return buffer_queue;
}
private:
const u64 layer_id;
const u32 binder_id;
android::BufferQueueCore& core;
android::BufferQueueProducer& binder;
std::shared_ptr<android::BufferItemConsumer> consumer;
u64 layer_id;
NVFlinger::BufferQueue& buffer_queue;
};
} // namespace Service::VI