From e30739a1e1d90183bc6bf7414e409e89016881f5 Mon Sep 17 00:00:00 2001 From: Timothy Liang Date: Tue, 31 Jul 2018 10:51:17 -0400 Subject: implemented copy surface as draw for metal gpu backend Bug: skia: Change-Id: Ie61bd6ad9f288b8a025d44f887a0954101a7d710 Reviewed-on: https://skia-review.googlesource.com/142687 Commit-Queue: Timothy Liang Reviewed-by: Greg Daniel --- src/gpu/mtl/GrMtlGpu.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/gpu/mtl/GrMtlGpu.h') diff --git a/src/gpu/mtl/GrMtlGpu.h b/src/gpu/mtl/GrMtlGpu.h index 98132fa725..4ba07205e4 100644 --- a/src/gpu/mtl/GrMtlGpu.h +++ b/src/gpu/mtl/GrMtlGpu.h @@ -14,6 +14,8 @@ #include "GrTexture.h" #include "GrMtlCaps.h" +#include "GrMtlCopyManager.h" +#include "GrMtlResourceProvider.h" #import @@ -21,12 +23,16 @@ class GrMtlTexture; class GrSemaphore; struct GrMtlBackendContext; +namespace SkSL { + class Compiler; +} + class GrMtlGpu : public GrGpu { public: static sk_sp Make(GrContext* context, const GrContextOptions& options, id device, id queue); - ~GrMtlGpu() override {} + ~GrMtlGpu() override = default; const GrMtlCaps& mtlCaps() const { return *fMtlCaps.get(); } @@ -34,6 +40,8 @@ public: id commandBuffer() const { return fCmdBuffer; } + GrMtlResourceProvider& resourceProvider() { return fResourceProvider; } + enum SyncQueue { kForce_SyncQueue, kSkip_SyncQueue @@ -73,6 +81,8 @@ public: GrGpuTextureCommandBuffer* createCommandBuffer(GrTexture*, GrSurfaceOrigin) override; + SkSL::Compiler* shaderCompiler() const { return fCompiler.get(); } + GrFence SK_WARN_UNUSED_RESULT insertFence() override { return 0; } bool waitFence(GrFence, uint64_t) override { return true; } void deleteFence(GrFence) const override {} @@ -162,6 +172,10 @@ private: id fCmdBuffer; + std::unique_ptr fCompiler; + GrMtlCopyManager fCopyManager; + GrMtlResourceProvider fResourceProvider; + typedef GrGpu INHERITED; }; -- cgit v1.2.3