本文整理汇总了C++中GrProcOptInfo::inputColorToEffectiveStage方法的典型用法代码示例。如果您正苦于以下问题:C++ GrProcOptInfo::inputColorToEffectiveStage方法的具体用法?C++ GrProcOptInfo::inputColorToEffectiveStage怎么用?C++ GrProcOptInfo::inputColorToEffectiveStage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrProcOptInfo
的用法示例。
在下文中一共展示了GrProcOptInfo::inputColorToEffectiveStage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xferProcessor
GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder,
const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
const GrDrawTargetCaps& caps,
const GrScissorState& scissorState,
const GrDeviceCoordTexture* dstCopy) {
// Create XferProcessor from DS's XPFactory
SkAutoTUnref<GrXferProcessor> xferProcessor(
pipelineBuilder.getXPFactory()->createXferProcessor(colorPOI, coveragePOI, dstCopy, caps));
GrColor overrideColor = GrColor_ILLEGAL;
if (colorPOI.firstEffectiveStageIndex() != 0) {
overrideColor = colorPOI.inputColorToEffectiveStage();
}
GrXferProcessor::OptFlags optFlags;
if (xferProcessor) {
fXferProcessor.reset(xferProcessor.get());
optFlags = xferProcessor->getOptimizations(colorPOI,
coveragePOI,
pipelineBuilder.getStencil().doesWrite(),
&overrideColor,
caps);
}
// When path rendering the stencil settings are not always set on the GrPipelineBuilder
// so we must check the draw type. In cases where we will skip drawing we simply return a
// null GrPipeline.
if (!xferProcessor || (GrXferProcessor::kSkipDraw_OptFlag & optFlags)) {
// Set the fields that don't default init and return. The lack of a render target will
// indicate that this can be skipped.
fFlags = 0;
fDrawFace = GrPipelineBuilder::kInvalid_DrawFace;
return;
}
fRenderTarget.reset(pipelineBuilder.fRenderTarget.get());
SkASSERT(fRenderTarget);
fScissorState = scissorState;
fStencilSettings = pipelineBuilder.getStencil();
fDrawFace = pipelineBuilder.getDrawFace();
fFlags = 0;
if (pipelineBuilder.isHWAntialias()) {
fFlags |= kHWAA_Flag;
}
if (pipelineBuilder.isDither()) {
fFlags |= kDither_Flag;
}
if (pipelineBuilder.snapVerticesToPixelCenters()) {
fFlags |= kSnapVertices_Flag;
}
int firstColorStageIdx = colorPOI.firstEffectiveStageIndex();
// TODO: Once we can handle single or four channel input into coverage stages then we can use
// GrPipelineBuilder's coverageProcInfo (like color above) to set this initial information.
int firstCoverageStageIdx = 0;
this->adjustProgramFromOptimizations(pipelineBuilder, optFlags, colorPOI, coveragePOI,
&firstColorStageIdx, &firstCoverageStageIdx);
bool usesLocalCoords = false;
// Copy Stages from PipelineBuilder to Pipeline
for (int i = firstColorStageIdx; i < pipelineBuilder.numColorFragmentStages(); ++i) {
SkNEW_APPEND_TO_TARRAY(&fFragmentStages,
GrPendingFragmentStage,
(pipelineBuilder.fColorStages[i]));
usesLocalCoords = usesLocalCoords ||
pipelineBuilder.fColorStages[i].processor()->usesLocalCoords();
}
fNumColorStages = fFragmentStages.count();
for (int i = firstCoverageStageIdx; i < pipelineBuilder.numCoverageFragmentStages(); ++i) {
SkNEW_APPEND_TO_TARRAY(&fFragmentStages,
GrPendingFragmentStage,
(pipelineBuilder.fCoverageStages[i]));
usesLocalCoords = usesLocalCoords ||
pipelineBuilder.fCoverageStages[i].processor()->usesLocalCoords();
}
// let the GP init the batch tracker
fInitBT.fColorIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag);
fInitBT.fOverrideColor = fInitBT.fColorIgnored ? GrColor_ILLEGAL : overrideColor;
fInitBT.fCoverageIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag);
fInitBT.fUsesLocalCoords = usesLocalCoords;
fInitBT.fCanTweakAlphaForCoverage =
SkToBool(optFlags & GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag);
}