Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skgpu::TextureUploadWriter Struct Reference

#include <BufferWriter.h>

Inheritance diagram for skgpu::TextureUploadWriter:
skgpu::BufferWriter

Public Member Functions

 TextureUploadWriter ()=default
 
 TextureUploadWriter (void *ptr, size_t size)
 
 TextureUploadWriter (const TextureUploadWriter &)=delete
 
 TextureUploadWriter (TextureUploadWriter &&that)
 
TextureUploadWriteroperator= (const TextureUploadWriter &)=delete
 
TextureUploadWriteroperator= (TextureUploadWriter &&that)
 
void write (size_t offset, const void *src, size_t srcRowBytes, size_t dstRowBytes, size_t trimRowBytes, int rowCount)
 
void convertAndWrite (size_t offset, const SkImageInfo &srcInfo, const void *src, size_t srcRowBytes, const SkImageInfo &dstInfo, size_t dstRowBytes)
 
void writeRGBFromRGBx (size_t offset, const void *src, size_t srcRowBytes, size_t dstRowBytes, int rowPixels, int rowCount)
 
- Public Member Functions inherited from skgpu::BufferWriter
 operator bool () const
 
Mark mark (size_t offset=0) const
 

Additional Inherited Members

- Protected Member Functions inherited from skgpu::BufferWriter
 BufferWriter ()=default
 
 BufferWriter (void *ptr, size_t size)
 
 BufferWriter (void *ptr, Mark end={})
 
BufferWriteroperator= (const BufferWriter &)=delete
 
BufferWriteroperator= (BufferWriter &&that)
 
template<typename W >
W makeOffset (size_t offsetInBytes) const
 
void validate (size_t bytesToWrite) const
 
- Protected Attributes inherited from skgpu::BufferWriter
void * fPtr = nullptr
 

Detailed Description

Definition at line 452 of file BufferWriter.h.

Constructor & Destructor Documentation

◆ TextureUploadWriter() [1/4]

skgpu::TextureUploadWriter::TextureUploadWriter ( )
default

◆ TextureUploadWriter() [2/4]

skgpu::TextureUploadWriter::TextureUploadWriter ( void *  ptr,
size_t  size 
)
inline

Definition at line 455 of file BufferWriter.h.

455: BufferWriter(ptr, size) {}
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
BufferWriter()=default

◆ TextureUploadWriter() [3/4]

skgpu::TextureUploadWriter::TextureUploadWriter ( const TextureUploadWriter )
delete

◆ TextureUploadWriter() [4/4]

skgpu::TextureUploadWriter::TextureUploadWriter ( TextureUploadWriter &&  that)
inline

Definition at line 458 of file BufferWriter.h.

458{ *this = std::move(that); }

Member Function Documentation

◆ convertAndWrite()

void skgpu::TextureUploadWriter::convertAndWrite ( size_t  offset,
const SkImageInfo srcInfo,
const void *  src,
size_t  srcRowBytes,
const SkImageInfo dstInfo,
size_t  dstRowBytes 
)
inline

Definition at line 475 of file BufferWriter.h.

477 {
478 SkASSERT(srcInfo.width() == dstInfo.width() && srcInfo.height() == dstInfo.height());
479 this->validate(offset + dstRowBytes * dstInfo.height());
480 void* dst = SkTAddOffset<void>(fPtr, offset);
481 SkAssertResult(SkConvertPixels(dstInfo, dst, dstRowBytes, srcInfo, src, srcRowBytes));
482 }
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool SkConvertPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRB, const SkImageInfo &srcInfo, const void *srcPixels, size_t srcRB)
dst
Definition: cp.py:12
SeparatedVector2 offset
int width() const
Definition: SkImageInfo.h:365
int height() const
Definition: SkImageInfo.h:371
void validate(size_t bytesToWrite) const
Definition: BufferWriter.h:102

◆ operator=() [1/2]

TextureUploadWriter & skgpu::TextureUploadWriter::operator= ( const TextureUploadWriter )
delete

◆ operator=() [2/2]

TextureUploadWriter & skgpu::TextureUploadWriter::operator= ( TextureUploadWriter &&  that)
inline

Definition at line 461 of file BufferWriter.h.

461 {
462 BufferWriter::operator=(std::move(that));
463 return *this;
464 }
BufferWriter & operator=(const BufferWriter &)=delete

◆ write()

void skgpu::TextureUploadWriter::write ( size_t  offset,
const void *  src,
size_t  srcRowBytes,
size_t  dstRowBytes,
size_t  trimRowBytes,
int  rowCount 
)
inline

Definition at line 468 of file BufferWriter.h.

469 {
470 this->validate(offset + dstRowBytes * rowCount);
471 void* dst = SkTAddOffset<void>(fPtr, offset);
472 SkRectMemcpy(dst, dstRowBytes, src, srcRowBytes, trimRowBytes, rowCount);
473 }
static void SkRectMemcpy(void *dst, size_t dstRB, const void *src, size_t srcRB, size_t trimRowBytes, int rowCount)
Definition: SkRectMemcpy.h:16

◆ writeRGBFromRGBx()

void skgpu::TextureUploadWriter::writeRGBFromRGBx ( size_t  offset,
const void *  src,
size_t  srcRowBytes,
size_t  dstRowBytes,
int  rowPixels,
int  rowCount 
)
inline

Definition at line 486 of file BufferWriter.h.

487 {
488 this->validate(offset + dstRowBytes * rowCount);
489 void* dst = SkTAddOffset<void>(fPtr, offset);
490 auto* sRow = reinterpret_cast<const char*>(src);
491 auto* dRow = reinterpret_cast<char*>(dst);
492
493 for (int y = 0; y < rowCount; ++y) {
494 for (int x = 0; x < rowPixels; ++x) {
495 memcpy(dRow + 3*x, sRow+4*x, 3);
496 }
497 sRow += srcRowBytes;
498 dRow += dstRowBytes;
499 }
500 }
double y
double x

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