mirror of
https://git.suyu.dev/suyu/suyu
synced 2026-07-10 09:39:03 +00:00
core: support offline web applet
This commit is contained in:
@@ -53,7 +53,7 @@ Display::~Display() {
|
||||
Layer& Display::GetLayer(std::size_t index) {
|
||||
size_t i = 0;
|
||||
for (auto& layer : layers) {
|
||||
if (!layer->IsOpen()) {
|
||||
if (!layer->IsOpen() || !layer->IsVisible()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ Layer& Display::GetLayer(std::size_t index) {
|
||||
}
|
||||
|
||||
size_t Display::GetNumLayers() const {
|
||||
return std::ranges::count_if(layers, [](auto& l) { return l->IsOpen(); });
|
||||
return std::ranges::count_if(layers, [](auto& l) { return l->IsOpen() && l->IsVisible(); });
|
||||
}
|
||||
|
||||
Kernel::KReadableEvent* Display::GetVSyncEvent() {
|
||||
|
||||
@@ -9,7 +9,7 @@ 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_)}, open{false} {}
|
||||
consumer{std::move(consumer_)}, open{false}, visible{true} {}
|
||||
|
||||
Layer::~Layer() = default;
|
||||
|
||||
|
||||
@@ -72,6 +72,14 @@ public:
|
||||
return core;
|
||||
}
|
||||
|
||||
bool IsVisible() const {
|
||||
return visible;
|
||||
}
|
||||
|
||||
void SetVisibility(bool v) {
|
||||
visible = v;
|
||||
}
|
||||
|
||||
bool IsOpen() const {
|
||||
return open;
|
||||
}
|
||||
@@ -91,6 +99,7 @@ private:
|
||||
android::BufferQueueProducer& binder;
|
||||
std::shared_ptr<android::BufferItemConsumer> consumer;
|
||||
bool open;
|
||||
bool visible;
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
Reference in New Issue
Block a user