本文整理汇总了C++中BlendFormula::hasSecondaryOutput方法的典型用法代码示例。如果您正苦于以下问题:C++ BlendFormula::hasSecondaryOutput方法的具体用法?C++ BlendFormula::hasSecondaryOutput怎么用?C++ BlendFormula::hasSecondaryOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlendFormula
的用法示例。
在下文中一共展示了BlendFormula::hasSecondaryOutput方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShaderPDXferProcessor
GrXferProcessor*
GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps,
const GrPipelineOptimizations& optimizations,
bool hasMixedSamples,
const DstTexture* dstTexture) const {
if (optimizations.fOverrides.fUsePLSDstRead) {
return new ShaderPDXferProcessor(dstTexture, hasMixedSamples, fXfermode);
}
BlendFormula blendFormula;
if (optimizations.fCoveragePOI.isFourChannelOutput()) {
if (SkBlendMode::kSrcOver == fXfermode &&
kRGBA_GrColorComponentFlags == optimizations.fColorPOI.validFlags() &&
!caps.shaderCaps()->dualSourceBlendingSupport() &&
!caps.shaderCaps()->dstReadInShaderSupport()) {
// If we don't have dual source blending or in shader dst reads, we fall back to this
// trick for rendering SrcOver LCD text instead of doing a dst copy.
SkASSERT(!dstTexture || !dstTexture->texture());
return PDLCDXferProcessor::Create(fXfermode, optimizations.fColorPOI);
}
blendFormula = get_lcd_blend_formula(optimizations.fCoveragePOI, fXfermode);
} else {
blendFormula = get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI,
hasMixedSamples, fXfermode);
}
if (blendFormula.hasSecondaryOutput() && !caps.shaderCaps()->dualSourceBlendingSupport()) {
return new ShaderPDXferProcessor(dstTexture, hasMixedSamples, fXfermode);
}
SkASSERT(!dstTexture || !dstTexture->texture());
return new PorterDuffXferProcessor(blendFormula);
}
示例2: Create
GrXferProcessor*
GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& covPOI,
bool hasMixedSamples,
const DstTexture* dstTexture) const {
BlendFormula blendFormula;
if (covPOI.isFourChannelOutput()) {
if (SkXfermode::kSrcOver_Mode == fXfermode &&
kRGBA_GrColorComponentFlags == colorPOI.validFlags()) {
SkASSERT(!dstTexture || !dstTexture->texture());
return PDLCDXferProcessor::Create(fXfermode, colorPOI);
}
blendFormula = get_lcd_blend_formula(covPOI, fXfermode);
} else {
blendFormula = get_blend_formula(colorPOI, covPOI, hasMixedSamples, fXfermode);
}
if (blendFormula.hasSecondaryOutput() && !caps.shaderCaps()->dualSourceBlendingSupport()) {
return new ShaderPDXferProcessor(dstTexture, hasMixedSamples, fXfermode);
}
SkASSERT(!dstTexture || !dstTexture->texture());
return new PorterDuffXferProcessor(blendFormula);
}
示例3: emitOutputsForBlendState
void emitOutputsForBlendState(const EmitArgs& args) override {
const PorterDuffXferProcessor& xp = args.fXP.cast<PorterDuffXferProcessor>();
GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
BlendFormula blendFormula = xp.getBlendFormula();
if (blendFormula.hasSecondaryOutput()) {
append_color_output(xp, fsBuilder, blendFormula.fSecondaryOutputType,
args.fOutputSecondary, args.fInputColor, args.fInputCoverage);
}
append_color_output(xp, fsBuilder, blendFormula.fPrimaryOutputType,
args.fOutputPrimary, args.fInputColor, args.fInputCoverage);
}
示例4: Create
GrXferProcessor*
GrPorterDuffXPFactory::onCreateXferProcessor(const GrCaps& caps,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& covPOI,
const DstTexture* dstTexture) const {
if (covPOI.isFourChannelOutput()) {
SkASSERT(!dstTexture || !dstTexture->texture());
return PDLCDXferProcessor::Create(fXfermode, colorPOI);
}
BlendFormula blendFormula = get_blend_formula(fXfermode, colorPOI, covPOI);
if (blendFormula.hasSecondaryOutput() && !caps.shaderCaps()->dualSourceBlendingSupport()) {
return ShaderPDXferProcessor::Create(fXfermode, dstTexture);
}
SkASSERT(!dstTexture || !dstTexture->texture());
return PorterDuffXferProcessor::Create(blendFormula);
}
示例5: CreateSrcOverXferProcessor
GrXferProcessor* GrPorterDuffXPFactory::CreateSrcOverXferProcessor(
const GrCaps& caps,
const GrPipelineOptimizations& optimizations,
bool hasMixedSamples,
const GrXferProcessor::DstTexture* dstTexture) {
if (optimizations.fOverrides.fUsePLSDstRead) {
return new ShaderPDXferProcessor(dstTexture, hasMixedSamples, SkBlendMode::kSrcOver);
}
// We want to not make an xfer processor if possible. Thus for the simple case where we are not
// doing lcd blending we will just use our global SimpleSrcOverXP. This slightly differs from
// the general case where we convert a src-over blend that has solid coverage and an opaque
// color to src-mode, which allows disabling of blending.
if (!optimizations.fCoveragePOI.isFourChannelOutput()) {
// We return nullptr here, which our caller interprets as meaning "use SimpleSrcOverXP".
// We don't simply return the address of that XP here because our caller would have to unref
// it and since it is a global object and GrProgramElement's ref-cnting system is not thread
// safe.
return nullptr;
}
if (kRGBA_GrColorComponentFlags == optimizations.fColorPOI.validFlags() &&
!caps.shaderCaps()->dualSourceBlendingSupport() &&
!caps.shaderCaps()->dstReadInShaderSupport()) {
// If we don't have dual source blending or in shader dst reads, we fall
// back to this trick for rendering SrcOver LCD text instead of doing a
// dst copy.
SkASSERT(!dstTexture || !dstTexture->texture());
return PDLCDXferProcessor::Create(SkBlendMode::kSrcOver, optimizations.fColorPOI);
}
BlendFormula blendFormula;
blendFormula = get_lcd_blend_formula(optimizations.fCoveragePOI, SkBlendMode::kSrcOver);
if (blendFormula.hasSecondaryOutput() && !caps.shaderCaps()->dualSourceBlendingSupport()) {
return new ShaderPDXferProcessor(dstTexture, hasMixedSamples, SkBlendMode::kSrcOver);
}
SkASSERT(!dstTexture || !dstTexture->texture());
return new PorterDuffXferProcessor(blendFormula);
}