diff options
Diffstat (limited to 'src/gpu/mtl/GrMtlResourceProvider.h')
-rw-r--r-- | src/gpu/mtl/GrMtlResourceProvider.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/gpu/mtl/GrMtlResourceProvider.h b/src/gpu/mtl/GrMtlResourceProvider.h new file mode 100644 index 0000000000..d5b66ede66 --- /dev/null +++ b/src/gpu/mtl/GrMtlResourceProvider.h @@ -0,0 +1,33 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. +*/ + +#ifndef GrMtlResourceProvider_DEFINED +#define GrMtlResourceProvider_DEFINED + +#include "GrMtlCopyPipelineState.h" +#include "SkTArray.h" + +#import <metal/metal.h> + +class GrMtlGpu; + +class GrMtlResourceProvider { +public: + GrMtlResourceProvider(GrMtlGpu* gpu) : fGpu(gpu) {} + + GrMtlCopyPipelineState* findOrCreateCopyPipelineState(MTLPixelFormat dstPixelFormat, + id<MTLFunction> vertexFunction, + id<MTLFunction> fragmentFunction, + MTLVertexDescriptor* vertexDescriptor); + +private: + SkTArray<std::unique_ptr<GrMtlCopyPipelineState>> fCopyPipelineStateCache; + + GrMtlGpu* fGpu; +}; + +#endif |