aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl/GrMtlCopyPipelineState.h
diff options
context:
space:
mode:
authorGravatar Timothy Liang <timliang@google.com>2018-07-31 10:51:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-31 16:25:55 +0000
commite30739a1e1d90183bc6bf7414e409e89016881f5 (patch)
tree4b84aeadee82fde5b45ec75aa1782897e2c9625f /src/gpu/mtl/GrMtlCopyPipelineState.h
parentc8ece3d5f877d67114dfda51a336dfdf7838095a (diff)
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 <timliang@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/mtl/GrMtlCopyPipelineState.h')
-rw-r--r--src/gpu/mtl/GrMtlCopyPipelineState.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/gpu/mtl/GrMtlCopyPipelineState.h b/src/gpu/mtl/GrMtlCopyPipelineState.h
new file mode 100644
index 0000000000..ce4cbb2bf7
--- /dev/null
+++ b/src/gpu/mtl/GrMtlCopyPipelineState.h
@@ -0,0 +1,37 @@
+/*
+ * 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 GrMtlCopyPipelineState_DEFINED
+#define GrMtlCopyPipelineState_DEFINED
+
+#import <metal/metal.h>
+
+class GrMtlGpu;
+
+class GrMtlCopyPipelineState {
+public:
+ static GrMtlCopyPipelineState* CreateCopyPipelineState(GrMtlGpu* gpu,
+ MTLPixelFormat dstPixelFormat,
+ id<MTLFunction> vertexFunction,
+ id<MTLFunction> fragmentFunction,
+ MTLVertexDescriptor* vertexDescriptor);
+
+ id<MTLRenderPipelineState> mtlCopyPipelineState() { return fPipelineState; }
+
+private:
+ GrMtlCopyPipelineState(id<MTLRenderPipelineState> pipelineState,
+ MTLPixelFormat pixelFormat)
+ : fPipelineState(pipelineState)
+ , fPixelFormat(pixelFormat) {}
+
+ id<MTLRenderPipelineState> fPipelineState;
+ MTLPixelFormat fPixelFormat;
+
+ friend class GrMtlCopyManager;
+};
+
+#endif