Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
skgpu::graphite::MtlBlitCommandEncoder Class Reference

#include <MtlBlitCommandEncoder.h>

Inheritance diagram for skgpu::graphite::MtlBlitCommandEncoder:
skgpu::graphite::Resource

Public Member Functions

const char * getResourceType () const override
 
void pushDebugGroup (NSString *string)
 
void popDebugGroup ()
 
void fillBuffer (id< MTLBuffer > buffer, size_t bufferOffset, size_t bytes, uint8_t value)
 
void copyFromTexture (id< MTLTexture > texture, SkIRect srcRect, id< MTLBuffer > buffer, size_t bufferOffset, size_t bufferRowBytes)
 
void copyFromBuffer (id< MTLBuffer > buffer, size_t bufferOffset, size_t bufferRowBytes, id< MTLTexture > texture, SkIRect dstRect, unsigned int dstLevel)
 
void copyTextureToTexture (id< MTLTexture > srcTexture, SkIRect srcRect, id< MTLTexture > dstTexture, SkIPoint dstPoint, int mipLevel)
 
void copyBufferToBuffer (id< MTLBuffer > srcBuffer, size_t srcOffset, id< MTLBuffer > dstBuffer, size_t dstOffset, size_t size)
 
void endEncoding ()
 
- Public Member Functions inherited from skgpu::graphite::Resource
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
Resourceoperator= (const Resource &)=delete
 
Resourceoperator= (Resource &&)=delete
 
void ref () const
 
void unref () const
 
void refCommandBuffer () const
 
void unrefCommandBuffer () const
 
Ownership ownership () const
 
skgpu::Budgeted budgeted () const
 
size_t gpuMemorySize () const
 
UniqueID uniqueID () const
 
virtual const char * getResourceType () const =0
 
std::string getLabel () const
 
void setLabel (std::string_view label)
 
bool wasDestroyed () const
 
const GraphiteResourceKeykey () const
 
void setKey (const GraphiteResourceKey &key)
 
void dumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump) const
 
virtual void prepareForReturnToCache (const std::function< void()> &takeRef)
 

Static Public Member Functions

static sk_sp< MtlBlitCommandEncoderMake (const SharedContext *sharedContext, id< MTLCommandBuffer > commandBuffer)
 

Additional Inherited Members

- Protected Member Functions inherited from skgpu::graphite::Resource
 Resource (const SharedContext *, Ownership, skgpu::Budgeted, size_t gpuMemorySize, bool commandBufferRefsAsUsageRefs=false)
 
virtual ~Resource ()
 
const SharedContextsharedContext () const
 
virtual void onDumpMemoryStatistics (SkTraceMemoryDump *traceMemoryDump, const char *dumpName) const
 
void setDeleteASAP ()
 

Detailed Description

Wraps a MTLMtlBlitCommandEncoder object

Definition at line 23 of file MtlBlitCommandEncoder.h.

Member Function Documentation

◆ copyBufferToBuffer()

void skgpu::graphite::MtlBlitCommandEncoder::copyBufferToBuffer ( id< MTLBuffer >  srcBuffer,
size_t  srcOffset,
id< MTLBuffer >  dstBuffer,
size_t  dstOffset,
size_t  size 
)
inline

Definition at line 105 of file MtlBlitCommandEncoder.h.

109 {
110 [(*fCommandEncoder) copyFromBuffer: srcBuffer
111 sourceOffset: srcOffset
112 toBuffer: dstBuffer
113 destinationOffset: dstOffset
114 size: size];
115 }
void copyFromBuffer(id< MTLBuffer > buffer, size_t bufferOffset, size_t bufferRowBytes, id< MTLTexture > texture, SkIRect dstRect, unsigned int dstLevel)
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

◆ copyFromBuffer()

void skgpu::graphite::MtlBlitCommandEncoder::copyFromBuffer ( id< MTLBuffer >  buffer,
size_t  bufferOffset,
size_t  bufferRowBytes,
id< MTLTexture >  texture,
SkIRect  dstRect,
unsigned int  dstLevel 
)
inline

Definition at line 72 of file MtlBlitCommandEncoder.h.

77 {
78 [(*fCommandEncoder) copyFromBuffer: buffer
79 sourceOffset: bufferOffset
80 sourceBytesPerRow: bufferRowBytes
81 sourceBytesPerImage: bufferRowBytes * dstRect.height()
82 sourceSize: MTLSizeMake(dstRect.width(), dstRect.height(), 1)
83 toTexture: texture
84 destinationSlice: 0
85 destinationLevel: dstLevel
86 destinationOrigin: MTLOriginMake(dstRect.left(), dstRect.top(), 0)];
87 }
FlTexture * texture
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
Definition: switches.h:126
constexpr int32_t height() const
Definition: SkRect.h:165
constexpr int32_t width() const
Definition: SkRect.h:158

◆ copyFromTexture()

void skgpu::graphite::MtlBlitCommandEncoder::copyFromTexture ( id< MTLTexture >  texture,
SkIRect  srcRect,
id< MTLBuffer >  buffer,
size_t  bufferOffset,
size_t  bufferRowBytes 
)
inline

Definition at line 56 of file MtlBlitCommandEncoder.h.

60 {
61 [(*fCommandEncoder) copyFromTexture: texture
62 sourceSlice: 0
63 sourceLevel: 0
64 sourceOrigin: MTLOriginMake(srcRect.left(), srcRect.top(), 0)
65 sourceSize: MTLSizeMake(srcRect.width(), srcRect.height(), 1)
66 toBuffer: buffer
67 destinationOffset: bufferOffset
68 destinationBytesPerRow: bufferRowBytes
69 destinationBytesPerImage: bufferRowBytes * srcRect.height()];
70 }
void copyFromTexture(id< MTLTexture > texture, SkIRect srcRect, id< MTLBuffer > buffer, size_t bufferOffset, size_t bufferRowBytes)
int32_t height
int32_t width
constexpr int32_t top() const
Definition: SkRect.h:120
constexpr int32_t left() const
Definition: SkRect.h:113

◆ copyTextureToTexture()

void skgpu::graphite::MtlBlitCommandEncoder::copyTextureToTexture ( id< MTLTexture >  srcTexture,
SkIRect  srcRect,
id< MTLTexture >  dstTexture,
SkIPoint  dstPoint,
int  mipLevel 
)
inline

Definition at line 89 of file MtlBlitCommandEncoder.h.

93 {
94 [(*fCommandEncoder) copyFromTexture: srcTexture
95 sourceSlice: 0
96 sourceLevel: 0
97 sourceOrigin: MTLOriginMake(srcRect.x(), srcRect.y(), 0)
98 sourceSize: MTLSizeMake(srcRect.width(), srcRect.height(), 1)
99 toTexture: dstTexture
100 destinationSlice: 0
101 destinationLevel: mipLevel
102 destinationOrigin: MTLOriginMake(dstPoint.fX, dstPoint.fY, 0)];
103 }
constexpr int32_t x() const
Definition: SkRect.h:141
constexpr int32_t y() const
Definition: SkRect.h:148

◆ endEncoding()

void skgpu::graphite::MtlBlitCommandEncoder::endEncoding ( )
inline

Definition at line 117 of file MtlBlitCommandEncoder.h.

117 {
118 [(*fCommandEncoder) endEncoding];
119 }

◆ fillBuffer()

void skgpu::graphite::MtlBlitCommandEncoder::fillBuffer ( id< MTLBuffer >  buffer,
size_t  bufferOffset,
size_t  bytes,
uint8_t  value 
)
inline

Definition at line 50 of file MtlBlitCommandEncoder.h.

50 {
51 [(*fCommandEncoder) fillBuffer:buffer
52 range:NSMakeRange(bufferOffset, bytes)
53 value:value];
54 }
void fillBuffer(id< MTLBuffer > buffer, size_t bufferOffset, size_t bytes, uint8_t value)
uint8_t value

◆ getResourceType()

const char * skgpu::graphite::MtlBlitCommandEncoder::getResourceType ( ) const
inlineoverridevirtual

Implements skgpu::graphite::Resource.

Definition at line 36 of file MtlBlitCommandEncoder.h.

36{ return "Metal Blit Command Encoder"; }

◆ Make()

static sk_sp< MtlBlitCommandEncoder > skgpu::graphite::MtlBlitCommandEncoder::Make ( const SharedContext sharedContext,
id< MTLCommandBuffer >  commandBuffer 
)
inlinestatic

Definition at line 25 of file MtlBlitCommandEncoder.h.

26 {
27 @autoreleasepool {
28 // Adding a retain here to keep our own ref separate from the autorelease pool
29 sk_cfp<id<MTLBlitCommandEncoder>> encoder =
30 sk_ret_cfp<id<MTLBlitCommandEncoder>>([commandBuffer blitCommandEncoder]);
31 return sk_sp<MtlBlitCommandEncoder>(new MtlBlitCommandEncoder(sharedContext,
32 std::move(encoder)));
33 }
34 }
const SharedContext * sharedContext() const
Definition: Resource.h:189

◆ popDebugGroup()

void skgpu::graphite::MtlBlitCommandEncoder::popDebugGroup ( )
inline

Definition at line 41 of file MtlBlitCommandEncoder.h.

41 {
42 [(*fCommandEncoder) popDebugGroup];
43 }

◆ pushDebugGroup()

void skgpu::graphite::MtlBlitCommandEncoder::pushDebugGroup ( NSString *  string)
inline

Definition at line 38 of file MtlBlitCommandEncoder.h.

38 {
39 [(*fCommandEncoder) pushDebugGroup:string];
40 }

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