本文整理汇总了C++中GrCaps::srgbSupport方法的典型用法代码示例。如果您正苦于以下问题:C++ GrCaps::srgbSupport方法的具体用法?C++ GrCaps::srgbSupport怎么用?C++ GrCaps::srgbSupport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrCaps
的用法示例。
在下文中一共展示了GrCaps::srgbSupport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkImageInfo2GrPixelConfig
GrPixelConfig SkImageInfo2GrPixelConfig(const SkColorType type, SkColorSpace* cs,
const GrCaps& caps) {
switch (type) {
case kUnknown_SkColorType:
return kUnknown_GrPixelConfig;
case kAlpha_8_SkColorType:
return kAlpha_8_GrPixelConfig;
case kRGB_565_SkColorType:
return kRGB_565_GrPixelConfig;
case kARGB_4444_SkColorType:
return kRGBA_4444_GrPixelConfig;
case kRGBA_8888_SkColorType:
return (caps.srgbSupport() && cs && cs->gammaCloseToSRGB())
? kSRGBA_8888_GrPixelConfig : kRGBA_8888_GrPixelConfig;
// TODO: We're checking for srgbSupport, but we can then end up picking sBGRA as our pixel
// config (which may not be supported). We need a better test here.
case kRGB_888x_SkColorType:
return kUnknown_GrPixelConfig;
case kBGRA_8888_SkColorType:
return (caps.srgbSupport() && cs && cs->gammaCloseToSRGB())
? kSBGRA_8888_GrPixelConfig : kBGRA_8888_GrPixelConfig;
case kRGBA_1010102_SkColorType:
return kRGBA_1010102_GrPixelConfig;
case kRGB_101010x_SkColorType:
return kUnknown_GrPixelConfig;
case kGray_8_SkColorType:
return kGray_8_GrPixelConfig;
case kRGBA_F16_SkColorType:
return kRGBA_half_GrPixelConfig;
}
SkASSERT(0); // shouldn't get here
return kUnknown_GrPixelConfig;
}