aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl/GrMtlCaps.mm
diff options
context:
space:
mode:
authorGravatar Timothy Liang <timliang@google.com>2018-06-28 16:37:18 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-29 13:32:17 +0000
commit4e85e80a5a32f11b850830f7bf6ee45ca195d137 (patch)
tree1b64d8594d3836b578bf1aead7101257cb8b1117 /src/gpu/mtl/GrMtlCaps.mm
parent8664a1d7d719153e8e854ff0112519d92916cfe2 (diff)
added Metal support to GrBackendSurface
Bug: skia: Change-Id: I58c7307f41df4694b0b46014bedd681adefed265 Reviewed-on: https://skia-review.googlesource.com/137891 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Timothy Liang <timliang@google.com>
Diffstat (limited to 'src/gpu/mtl/GrMtlCaps.mm')
-rw-r--r--src/gpu/mtl/GrMtlCaps.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index a1ecf08c35..1bb3fb26bf 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -8,6 +8,7 @@
#include "GrMtlCaps.h"
#include "GrBackendSurface.h"
+#include "GrMtlUtil.h"
#include "GrShaderCaps.h"
GrMtlCaps::GrMtlCaps(const GrContextOptions& contextOptions, const id<MTLDevice> device,
@@ -319,7 +320,11 @@ void GrMtlCaps::initConfigTable() {
#ifdef GR_TEST_UTILS
GrBackendFormat GrMtlCaps::onCreateFormatFromBackendTexture(
const GrBackendTexture& backendTex) const {
- return GrBackendFormat(); // Metal BackendFormat not yet implemented.
+ GrMtlTextureInfo mtlInfo;
+ SkAssertResult(backendTex.getMtlTextureInfo(&mtlInfo));
+ id<MTLTexture> mtlTexture = GrGetMTLTexture(mtlInfo.fTexture,
+ GrWrapOwnership::kBorrow_GrWrapOwnership);
+ return GrBackendFormat::MakeMtl(mtlTexture.pixelFormat);
}
#endif