From 44b61204d9f5681b9474db017577d56f42a32d66 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Thu, 1 Mar 2018 10:49:26 -0500 Subject: Add 1010102 support to Ganesh Adds gl1010102, gles1010102, vk1010102, and mtl1010102 configs to DM. This uses the same saveLayer approach as CPU, switching to 8888 so that we have enough alpha precision. Change-Id: I9f5b63747ec01031c8db97dadfc42f77e4863ccb Reviewed-on: https://skia-review.googlesource.com/110500 Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- src/gpu/mtl/GrMtlUtil.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gpu/mtl') diff --git a/src/gpu/mtl/GrMtlUtil.mm b/src/gpu/mtl/GrMtlUtil.mm index a188afe4ad..383cc98264 100644 --- a/src/gpu/mtl/GrMtlUtil.mm +++ b/src/gpu/mtl/GrMtlUtil.mm @@ -30,9 +30,12 @@ bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format) { case kSBGRA_8888_GrPixelConfig: *format = MTLPixelFormatBGRA8Unorm_sRGB; return true; + case kRGBA_1010102_GrPixelConfig: + *format = MTLPixelFormatRGB10A2Unorm; + return true; case kRGB_565_GrPixelConfig: #ifdef SK_BUILD_FOR_IOS - *format = MTLPixelFormatR5G6B5Unorm; + *format = MTLPixelFormatB5G6R5Unorm; return true; #else return false; @@ -84,6 +87,8 @@ GrPixelConfig GrMTLFormatToPixelConfig(MTLPixelFormat format) { return kSRGBA_8888_GrPixelConfig; case MTLPixelFormatBGRA8Unorm_sRGB: return kSBGRA_8888_GrPixelConfig; + case MTLPixelFormatRGB10A2Unorm: + return kRGBA_1010102_GrPixelConfig; #ifdef SK_BUILD_FOR_IOS case MTLPixelFormatB5G6R5Unorm: return kRGB_565_GrPixelConfig; -- cgit v1.2.3