Add RG format to Metal
Bug: skia:8243 Change-Id: I2140a558afeacaca26c81355c906cf6ae16a2df4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206917 Auto-Submit: Jim Van Verth <jvanverth@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
9816878163
commit
46431bf9d0
@ -400,6 +400,10 @@ void GrMtlCaps::initConfigTable() {
|
||||
info = &fConfigTable[kRGB_888_GrPixelConfig];
|
||||
info->fFlags = ConfigInfo::kTextureable_Flag;
|
||||
|
||||
// RG_88 uses RG8Unorm
|
||||
info = &fConfigTable[kRG_88_GrPixelConfig];
|
||||
info->fFlags = ConfigInfo::kTextureable_Flag;
|
||||
|
||||
// BGRA_8888 uses BGRA8Unorm
|
||||
info = &fConfigTable[kBGRA_8888_GrPixelConfig];
|
||||
info->fFlags = ConfigInfo::kAllFlags;
|
||||
@ -561,7 +565,9 @@ static GrPixelConfig get_yuva_config(GrMTLPixelFormat grFormat) {
|
||||
case MTLPixelFormatR8Unorm:
|
||||
return kAlpha_8_as_Red_GrPixelConfig;
|
||||
break;
|
||||
// TODO: Add RG_88 format here
|
||||
case MTLPixelFormatRG8Unorm:
|
||||
return kRG_88_GrPixelConfig;
|
||||
break;
|
||||
case MTLPixelFormatRGBA8Unorm:
|
||||
return kRGBA_8888_GrPixelConfig;
|
||||
break;
|
||||
|
@ -37,8 +37,8 @@ bool GrPixelConfigToMTLFormat(GrPixelConfig config, MTLPixelFormat* format) {
|
||||
*format = MTLPixelFormatRGBA8Unorm;
|
||||
return true;
|
||||
case kRG_88_GrPixelConfig:
|
||||
// TODO: MTLPixelFormatRG8Unorm
|
||||
return false;
|
||||
*format = MTLPixelFormatRG8Unorm;
|
||||
return true;
|
||||
case kBGRA_8888_GrPixelConfig:
|
||||
*format = MTLPixelFormatBGRA8Unorm;
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user