Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private 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
 
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)
 

Private Member Functions

void freeGpuData () override
 

Additional Inherited Members

- Protected Member Functions inherited from skgpu::graphite::Resource
 Resource (const SharedContext *, Ownership, skgpu::Budgeted, size_t gpuMemorySize, std::string_view label, bool commandBufferRefsAsUsageRefs=false)
 
virtual ~Resource ()
 
const SharedContextsharedContext () const
 
virtual void invokeReleaseProc ()
 
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 }
static bool left(const SkPoint &p0, const SkPoint &p1)
static const uint8_t buffer[]
FlTexture * texture
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

◆ freeGpuData()

void skgpu::graphite::MtlBlitCommandEncoder::freeGpuData ( )
inlineoverrideprivatevirtual

Implements skgpu::graphite::Resource.

Definition at line 131 of file MtlBlitCommandEncoder.h.

131 {
132 fCommandEncoder.reset();
133 }

◆ 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:187

◆ 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: