本文整理汇总了C++中SkImageInfo::isSRGB方法的典型用法代码示例。如果您正苦于以下问题:C++ SkImageInfo::isSRGB方法的具体用法?C++ SkImageInfo::isSRGB怎么用?C++ SkImageInfo::isSRGB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkImageInfo
的用法示例。
在下文中一共展示了SkImageInfo::isSRGB方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
bool SkColorShader::ColorShaderContext::onChooseBlitProcs(const SkImageInfo& info,
BlitState* state) {
uint32_t flags = SkXfermode::kSrcIsSingle_D32Flag;
if (fPM4f.a() == 1) {
flags |= SkXfermode::kSrcIsOpaque_D32Flag;
}
switch (info.colorType()) {
case kN32_SkColorType:
if (info.isSRGB()) {
flags |= SkXfermode::kDstIsSRGB_D32Flag;
}
state->fStorage[0] = (void*)SkXfermode::GetD32Proc(state->fXfer, flags);
state->fStorage[1] = &fPM4f;
state->fBlitBW = D32_BlitBW;
state->fBlitAA = D32_BlitAA;
return true;
case kRGBA_F16_SkColorType:
flags |= SkXfermode::kDstIsFloat16_D64Flag;
state->fStorage[0] = (void*)SkXfermode::GetD64Proc(state->fXfer, flags);
state->fStorage[1] = &fPM4f;
state->fBlitBW = D64_BlitBW;
state->fBlitAA = D64_BlitAA;
return true;
default:
return false;
}
}
示例2:
State32(const SkImageInfo& info, const SkPaint& paint, const SkShader::Context* shaderContext)
: State4f(info, paint, shaderContext)
{
if (is_opaque(paint, shaderContext)) {
fFlags |= SkXfermode::kSrcIsOpaque_D32Flag;
}
if (info.isSRGB()) {
fFlags |= SkXfermode::kDstIsSRGB_D32Flag;
}
fProc1 = SkXfermode::GetD32Proc(fXfer, fFlags | SkXfermode::kSrcIsSingle_D32Flag);
fProcN = SkXfermode::GetD32Proc(fXfer, fFlags);
}
示例3: choose_linear_pipeline
static bool choose_linear_pipeline(const SkShader::ContextRec& rec, const SkImageInfo& srcInfo) {
// These src attributes are not supported in the new 4f context (yet)
//
if (srcInfo.colorType() != kRGBA_8888_SkColorType
&& srcInfo.colorType() != kBGRA_8888_SkColorType
&& srcInfo.colorType() != kIndex_8_SkColorType) {
return false;
}
#if 0 // later we may opt-in to the new code even if the client hasn't requested it...
// These src attributes are only supported in the new 4f context
//
if (srcInfo.isSRGB() ||
kUnpremul_SkAlphaType == srcInfo.alphaType() ||
(4 == srcInfo.bytesPerPixel() && kN32_SkColorType != srcInfo.colorType()))
{
return true;
}
#endif
// If we get here, we can reasonably use either context, respect the caller's preference
//
return SkShader::ContextRec::kPM4f_DstType == rec.fPreferredDstType;
}