8#ifndef GrMtlGpu_DEFINED
9#define GrMtlGpu_DEFINED
28#import <Metal/Metal.h>
49 id<MTLDevice>
device()
const {
return fDevice; }
68#if defined(GR_TEST_UTILS)
77 void resetShaderCacheForTesting()
const override {
78 fResourceProvider.resetShaderCacheForTesting();
94 [[nodiscard]] std::unique_ptr<GrSemaphore>
makeSemaphore(
bool isOwned)
override;
107 MTLRenderPassStencilAttachmentDescriptor*);
123 void destroyResources();
134 std::string_view label)
override;
138 std::array<float, 4>
color)
override;
148 size_t size)
override;
153 int renderTargetSampleCnt,
157 uint32_t levelClearMask,
158 std::string_view label)
override;
165 size_t dataSize)
override;
190 size_t rowBytes)
override;
196 size_t size)
override;
204 bool prepForTexSampling)
override;
212 size_t rowBytes)
override;
221 bool onRegenerateMipMapLevels(
GrTexture*)
override;
242 bool onSubmitToGpu(
GrSyncCpu sync)
override;
247 bool submitCommandBuffer(
SyncQueue sync);
249 void checkForFinishedCommandBuffers();
259 bool clearTexture(
GrMtlTexture*,
size_t bbp, uint32_t levelMask);
264 id<MTLBuffer> transferBuffer,
270 SkISize dimensions,
int numStencilSamples)
override;
282 bool createMtlTextureForBackendSurface(MTLPixelFormat,
290#if defined(GR_TEST_UTILS)
291 void testingOnly_startCapture()
override;
292 void testingOnly_stopCapture()
override;
295#ifdef SK_ENABLE_DUMP_GPU
301 id<MTLDevice> fDevice;
302 id<MTLCommandQueue> fQueue;
307 SkDeque fOutstandingCommandBuffers;
315 using INHERITED =
GrGpu;
void * GrGpuFinishedContext
void(* GrGpuFinishedProc)(GrGpuFinishedContext finishedContext)
void didWriteToSurface(GrSurface *surface, GrSurfaceOrigin origin, const SkIRect *bounds, uint32_t mipLevels=1) const
GrGpu(GrDirectContext *direct)
bool onCopySurface(GrSurface *dst, const SkIRect &dstRect, GrSurface *src, const SkIRect &srcRect, GrSamplerState::Filter) override
sk_sp< GrThreadSafePipelineBuilder > refPipelineBuilder() override
std::unique_ptr< GrSemaphore > wrapBackendSemaphore(const GrBackendSemaphore &, GrSemaphoreWrapType, GrWrapOwnership) override
GrRingBuffer * uniformsRingBuffer() override
bool precompileShader(const SkData &key, const SkData &data) override
GrMtlRenderCommandEncoder * loadMSAAFromResolve(GrAttachment *dst, GrMtlAttachment *src, const SkIRect &srcRect, MTLRenderPassStencilAttachmentDescriptor *)
void insertSemaphore(GrSemaphore *semaphore) override
static std::unique_ptr< GrGpu > Make(const GrMtlBackendContext &, const GrContextOptions &, GrDirectContext *)
void copySurfaceAsBlit(GrSurface *dst, GrSurface *src, GrMtlAttachment *dstAttachment, GrMtlAttachment *srcAttachment, const SkIRect &srcRect, const SkIPoint &dstPoint)
GrMtlCommandBuffer * commandBuffer()
bool compile(const GrProgramDesc &, const GrProgramInfo &) override
void disconnect(DisconnectType) override
const GrMtlCaps & mtlCaps() const
void checkFinishProcs() override
void copySurfaceAsResolve(GrSurface *dst, GrSurface *src)
void deleteBackendTexture(const GrBackendTexture &) override
std::unique_ptr< GrSemaphore > prepareTextureForCrossContextUsage(GrTexture *) override
void waitSemaphore(GrSemaphore *semaphore) override
id< MTLDevice > device() const
GrStagingBufferManager * stagingBufferManager() override
void finishOutstandingGpuWork() override
GrMtlResourceProvider & resourceProvider()
GrThreadSafePipelineBuilder * pipelineBuilder() override
void submit(GrOpsRenderPass *renderPass) override
void submitIndirectCommandBuffer(GrSurface *surface, GrSurfaceOrigin origin, const SkIRect *bounds)
std::unique_ptr< GrSemaphore > makeSemaphore(bool isOwned) override
uint32_t uint32_t * format
Optional< SkRect > bounds
sk_sp< SkBlender > blender SkRect rect
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
std::shared_ptr< const fml::Mapping > data