Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
skgpu::TAsyncReadResult< T, IDType, TransferResultType > Class Template Reference

#include <AsyncReadTypes.h>

Inheritance diagram for skgpu::TAsyncReadResult< T, IDType, TransferResultType >:
SkImage::AsyncReadResult

Public Member Functions

 TAsyncReadResult (IDType intendedRecipient)
 
 ~TAsyncReadResult () override
 
int count () const override
 
const void * data (int i) const override
 
size_t rowBytes (int i) const override
 
bool addTransferResult (const TransferResultType &result, SkISize dimensions, size_t rowBytes, TClientMappedBufferManager< T, IDType > *manager)
 
void addCpuPlane (sk_sp< SkData > data, size_t rowBytes)
 
- Public Member Functions inherited from SkImage::AsyncReadResult
 AsyncReadResult (const AsyncReadResult &)=delete
 
 AsyncReadResult (AsyncReadResult &&)=delete
 
AsyncReadResultoperator= (const AsyncReadResult &)=delete
 
AsyncReadResultoperator= (AsyncReadResult &&)=delete
 
virtual ~AsyncReadResult ()=default
 
virtual int count () const =0
 
virtual const void * data (int i) const =0
 
virtual size_t rowBytes (int i) const =0
 

Additional Inherited Members

- Protected Member Functions inherited from SkImage::AsyncReadResult
 AsyncReadResult ()=default
 

Detailed Description

template<typename T, typename IDType, typename TransferResultType>
class skgpu::TAsyncReadResult< T, IDType, TransferResultType >

Definition at line 135 of file AsyncReadTypes.h.

Constructor & Destructor Documentation

◆ TAsyncReadResult()

template<typename T , typename IDType , typename TransferResultType >
skgpu::TAsyncReadResult< T, IDType, TransferResultType >::TAsyncReadResult ( IDType  intendedRecipient)
inline

Definition at line 137 of file AsyncReadTypes.h.

138 : fIntendedRecipient(intendedRecipient) {
139 }

◆ ~TAsyncReadResult()

template<typename T , typename IDType , typename TransferResultType >
skgpu::TAsyncReadResult< T, IDType, TransferResultType >::~TAsyncReadResult ( )
inlineoverride

Definition at line 141 of file AsyncReadTypes.h.

141 {
142 for (int i = 0; i < fPlanes.size(); ++i) {
143 fPlanes[i].releaseMappedBuffer(fIntendedRecipient);
144 }
145 }
int size() const
Definition: SkTArray.h:421

Member Function Documentation

◆ addCpuPlane()

template<typename T , typename IDType , typename TransferResultType >
void skgpu::TAsyncReadResult< T, IDType, TransferResultType >::addCpuPlane ( sk_sp< SkData data,
size_t  rowBytes 
)
inline

Definition at line 172 of file AsyncReadTypes.h.

172 {
173 SkASSERT(data);
174 SkASSERT(rowBytes > 0);
175 fPlanes.emplace_back(std::move(data), rowBytes);
176 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
const void * data(int i) const override
size_t rowBytes(int i) const override
T & emplace_back(Args &&... args)
Definition: SkTArray.h:248

◆ addTransferResult()

template<typename T , typename IDType , typename TransferResultType >
bool skgpu::TAsyncReadResult< T, IDType, TransferResultType >::addTransferResult ( const TransferResultType &  result,
SkISize  dimensions,
size_t  rowBytes,
TClientMappedBufferManager< T, IDType > *  manager 
)
inline

Definition at line 151 of file AsyncReadTypes.h.

154 {
155 const void* mappedData = result.fTransferBuffer->map();
156 if (!mappedData) {
157 return false;
158 }
159 if (result.fPixelConverter) {
160 size_t size = rowBytes*dimensions.height();
162 result.fPixelConverter(data->writable_data(), mappedData);
163 this->addCpuPlane(std::move(data), rowBytes);
164 result.fTransferBuffer->unmap();
165 } else {
166 manager->insert(result.fTransferBuffer);
167 this->addMappedPlane(mappedData, rowBytes, std::move(result.fTransferBuffer));
168 }
169 return true;
170 }
static sk_sp< SkData > MakeUninitialized(size_t length)
Definition: SkData.cpp:116
void addCpuPlane(sk_sp< SkData > data, size_t rowBytes)
GAsyncResult * result
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
Definition: switches.h:218
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
Definition: switches.h:259
constexpr int32_t height() const
Definition: SkSize.h:37

◆ count()

template<typename T , typename IDType , typename TransferResultType >
int skgpu::TAsyncReadResult< T, IDType, TransferResultType >::count ( ) const
inlineoverridevirtual

Implements SkImage::AsyncReadResult.

Definition at line 147 of file AsyncReadTypes.h.

147{ return fPlanes.size(); }

◆ data()

template<typename T , typename IDType , typename TransferResultType >
const void * skgpu::TAsyncReadResult< T, IDType, TransferResultType >::data ( int  i) const
inlineoverridevirtual

Implements SkImage::AsyncReadResult.

Definition at line 148 of file AsyncReadTypes.h.

148{ return fPlanes[i].data(); }

◆ rowBytes()

template<typename T , typename IDType , typename TransferResultType >
size_t skgpu::TAsyncReadResult< T, IDType, TransferResultType >::rowBytes ( int  i) const
inlineoverridevirtual

Implements SkImage::AsyncReadResult.

Definition at line 149 of file AsyncReadTypes.h.

149{ return fPlanes[i].rowBytes(); }

The documentation for this class was generated from the following file: