7#ifndef skgpu_AsyncReadTypes_DEFINED
8#define skgpu_AsyncReadTypes_DEFINED
20#include <forward_list>
33template <
typename T,
typename IDType>
42 IDType intendedRecipient)
45 fBuffer = std::move(other.fBuffer);
47 other.fIntendedRecipient.makeInvalid();
57 : fFinishedBufferInbox(
ownerID) {}
67 for (
auto&
b : fClientHeldBuffers) {
80 return fFinishedBufferInbox.
uniqueID();
90 fClientHeldBuffers.emplace_front(std::move(
b));
96 fFinishedBufferInbox.
poll(&messages);
98 for (
auto&
m : messages) {
99 this->remove(
m.fBuffer);
108 fClientHeldBuffers.clear();
112 typename BufferFinishedMessageBus::Inbox fFinishedBufferInbox;
113 std::forward_list<sk_sp<T>> fClientHeldBuffers;
114 bool fAbandoned =
false;
119 auto prev = fClientHeldBuffers.before_begin();
120 auto end = fClientHeldBuffers.end();
122 for (
auto cur = fClientHeldBuffers.begin(); cur != end;
prev = cur++) {
124 fClientHeldBuffers.erase_after(
prev);
134template <
typename T,
typename IDType,
typename TransferResultType>
138 : fIntendedRecipient(intendedRecipient) {
142 for (
int i = 0;
i < fPlanes.
size(); ++
i) {
143 fPlanes[
i].releaseMappedBuffer(fIntendedRecipient);
148 const void*
data(
int i)
const override {
return fPlanes[
i].
data(); }
149 size_t rowBytes(
int i)
const override {
return fPlanes[
i].rowBytes(); }
155 const void* mappedData =
result.fTransferBuffer->map();
159 if (
result.fPixelConverter) {
162 result.fPixelConverter(
data->writable_data(), mappedData);
164 result.fTransferBuffer->unmap();
167 this->addMappedPlane(mappedData,
rowBytes, std::move(
result.fTransferBuffer));
193 Plane(Plane&&) =
default;
195 ~Plane() {
SkASSERT(!fMappedBuffer); }
200 void releaseMappedBuffer(IDType intendedRecipient) {
203 {std::move(fMappedBuffer), intendedRecipient});
207 const void*
data()
const {
210 SkASSERT(fMappedBuffer->isMapped());
211 return fMappedBuffer->map();
214 return fData->data();
217 size_t rowBytes()
const {
return fRowBytes; }
225 IDType fIntendedRecipient;
static float prev(float f)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
int find(T *array, int N, T item)
static sk_sp< SkData > MakeUninitialized(size_t length)
AsyncReadResult & operator=(const AsyncReadResult &)=delete
void poll(skia_private::TArray< Message > *out)
static void Post(Message m)
TAsyncReadResult(IDType intendedRecipient)
bool addTransferResult(const TransferResultType &result, SkISize dimensions, size_t rowBytes, TClientMappedBufferManager< T, IDType > *manager)
const void * data(int i) const override
~TAsyncReadResult() override
size_t rowBytes(int i) const override
int count() const override
void addCpuPlane(sk_sp< SkData > data, size_t rowBytes)
TClientMappedBufferManager & operator=(const TClientMappedBufferManager &)=delete
TClientMappedBufferManager(TClientMappedBufferManager &&)=delete
TClientMappedBufferManager(const TClientMappedBufferManager &)=delete
void insert(sk_sp< T > b)
TClientMappedBufferManager(IDType ownerID)
TClientMappedBufferManager & operator=(TClientMappedBufferManager &&)=delete
~TClientMappedBufferManager()
T & emplace_back(Args &&... args)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font manager
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
constexpr int32_t height() const
IDType fIntendedRecipient
BufferFinishedMessage(BufferFinishedMessage &&other)
BufferFinishedMessage(sk_sp< T > buffer, IDType intendedRecipient)