diff options
Diffstat (limited to 'src/gpu/mtl/GrMtlGpu.h')
-rw-r--r-- | src/gpu/mtl/GrMtlGpu.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/gpu/mtl/GrMtlGpu.h b/src/gpu/mtl/GrMtlGpu.h index 7ec9907675..b63f9080be 100644 --- a/src/gpu/mtl/GrMtlGpu.h +++ b/src/gpu/mtl/GrMtlGpu.h @@ -16,11 +16,12 @@ #import <Metal/Metal.h> class GrSemaphore; +struct GrMtlBackendContext; class GrMtlGpu : public GrGpu { public: - static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions& options, - GrContext* context); + static GrGpu* Create(GrContext* context, const GrContextOptions& options, + id<MTLDevice> device, id<MTLCommandQueue> queue); ~GrMtlGpu() override {} @@ -59,19 +60,8 @@ public: sk_sp<GrSemaphore> prepareTextureForCrossContextUsage(GrTexture*) override { return nullptr; } private: - GrMtlGpu(GrContext* context, const GrContextOptions& options) : INHERITED(context) { - id<MTLDevice> device = MTLCreateSystemDefaultDevice(); - - MTLTextureDescriptor* txDesc = [[MTLTextureDescriptor alloc] init]; - txDesc.textureType = MTLTextureType3D; - txDesc.height = 64; - txDesc.width = 64; - txDesc.depth = 64; - txDesc.pixelFormat = MTLPixelFormatBGRA8Unorm; - txDesc.arrayLength = 1; - txDesc.mipmapLevelCount = 1; - fTestHeaderTexture = [device newTextureWithDescriptor:txDesc]; - } + GrMtlGpu(GrContext* context, const GrContextOptions& options, + id<MTLDevice> device, id<MTLCommandQueue> queue); void onResetContext(uint32_t resetBits) override {} @@ -146,7 +136,9 @@ private: bool isTestingOnlyBackendTexture(GrBackendObject ) const override { return false; } void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) override {} - id<MTLTexture> fTestHeaderTexture; + id<MTLDevice> fDevice; + id<MTLCommandQueue> fQueue; + typedef GrGpu INHERITED; }; |