aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl/GrMtlUtil.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/mtl/GrMtlUtil.mm')
-rw-r--r--src/gpu/mtl/GrMtlUtil.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gpu/mtl/GrMtlUtil.mm b/src/gpu/mtl/GrMtlUtil.mm
index 24643669ea..9e6c632638 100644
--- a/src/gpu/mtl/GrMtlUtil.mm
+++ b/src/gpu/mtl/GrMtlUtil.mm
@@ -7,6 +7,8 @@
#include "GrMtlUtil.h"
+#include "GrTypesPriv.h"
+
bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format) {
MTLPixelFormat dontCare;
if (!format) {
@@ -45,9 +47,12 @@ bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format) {
#else
return false;
#endif
- case kAlpha_8_GrPixelConfig:
+ case kAlpha_8_GrPixelConfig: // fall through
+ case kAlpha_8_as_Red_GrPixelConfig:
*format = MTLPixelFormatR8Unorm;
return true;
+ case kAlpha_8_as_Alpha_GrPixelConfig:
+ return false;
case kGray_8_GrPixelConfig:
*format = MTLPixelFormatR8Unorm;
return true;
@@ -60,9 +65,12 @@ bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format) {
case kRGBA_half_GrPixelConfig:
*format = MTLPixelFormatRGBA16Float;
return true;
- case kAlpha_half_GrPixelConfig:
+ case kAlpha_half_GrPixelConfig: // fall through
+ case kAlpha_half_as_Red_GrPixelConfig:
*format = MTLPixelFormatR16Float;
return true;
+ case kAlpha_half_as_Alpha_GrPixelConfig:
+ return false;
}
SK_ABORT("Unexpected config");
return false;