service/vi/vi_layer: Convert Layer struct into a class

Like the previous changes made to the Display struct, this prepares the
Layer struct for changes to its interface. Given Layer will be given
more invariants in the future, we convert it into a class to better
signify that.
This commit is contained in:
Lioncash
2019-02-21 10:56:20 -05:00
parent fa4dc2cf42
commit fd15730767
6 changed files with 43 additions and 10 deletions

View File

@@ -48,7 +48,7 @@ void Display::CreateLayer(u64 id, std::shared_ptr<NVFlinger::BufferQueue> buffer
Layer* Display::FindLayer(u64 id) {
const auto itr = std::find_if(layers.begin(), layers.end(),
[id](const VI::Layer& layer) { return layer.id == id; });
[id](const VI::Layer& layer) { return layer.GetID() == id; });
if (itr == layers.end()) {
return nullptr;
@@ -59,7 +59,7 @@ Layer* Display::FindLayer(u64 id) {
const Layer* Display::FindLayer(u64 id) const {
const auto itr = std::find_if(layers.begin(), layers.end(),
[id](const VI::Layer& layer) { return layer.id == id; });
[id](const VI::Layer& layer) { return layer.GetID() == id; });
if (itr == layers.end()) {
return nullptr;

View File

@@ -16,7 +16,7 @@ class BufferQueue;
namespace Service::VI {
struct Layer;
class Layer;
/// Represents a single display type
class Display {