aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mtl
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-11-15 14:22:10 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-15 20:02:43 +0000
commit33d17cbb003975fff895954435183756f9893c17 (patch)
tree1317eec2ffe56bd384a592e749511abf3cbc6bf1 /src/gpu/mtl
parentd8d984ecc99d8b7fc37a742e22acbe831f315142 (diff)
Add private grpixelconfigs for alpha_8 and alpha_half
Bug: skia: Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace Reviewed-on: https://skia-review.googlesource.com/71763 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/mtl')
-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;