本文整理汇总了C++中GrProcOptInfo::color方法的典型用法代码示例。如果您正苦于以下问题:C++ GrProcOptInfo::color方法的具体用法?C++ GrProcOptInfo::color怎么用?C++ GrProcOptInfo::color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrProcOptInfo
的用法示例。
在下文中一共展示了GrProcOptInfo::color方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getInvariantBlendedColor
void GrPorterDuffXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
InvariantBlendedColor* blendedColor) const {
// Find the blended color info based on the formula that does not have coverage.
BlendFormula colorFormula = gBlendTable[colorPOI.isOpaque()][0][fXfermode];
if (colorFormula.usesDstColor()) {
blendedColor->fWillBlendWithDst = true;
blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags;
return;
}
blendedColor->fWillBlendWithDst = false;
SkASSERT(kAdd_GrBlendEquation == colorFormula.fBlendEquation);
switch (colorFormula.fSrcCoeff) {
case kZero_GrBlendCoeff:
blendedColor->fKnownColor = 0;
blendedColor->fKnownColorFlags = kRGBA_GrColorComponentFlags;
return;
case kOne_GrBlendCoeff:
blendedColor->fKnownColor = colorPOI.color();
blendedColor->fKnownColorFlags = colorPOI.validFlags();
return;
default:
blendedColor->fKnownColorFlags = kNone_GrColorComponentFlags;
return;
}
}
示例2: isConstantBlendedColor
bool GrPaint::isConstantBlendedColor(GrColor* color) const {
GrProcOptInfo colorProcInfo;
colorProcInfo.calcWithInitialValues(fColorFragmentProcessors.begin(),
this->numColorFragmentProcessors(), fColor,
kRGBA_GrColorComponentFlags, false);
GrXPFactory::InvariantBlendedColor blendedColor;
if (fXPFactory) {
fXPFactory->getInvariantBlendedColor(colorProcInfo, &blendedColor);
} else {
GrPorterDuffXPFactory::SrcOverInvariantBlendedColor(colorProcInfo.color(),
colorProcInfo.validFlags(),
colorProcInfo.isOpaque(),
&blendedColor);
}
if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) {
*color = blendedColor.fKnownColor;
return true;
}
return false;
}
示例3: getInvariantOutput
void GrPorterDuffXPFactory::getInvariantOutput(const GrProcOptInfo& colorPOI,
const GrProcOptInfo& coveragePOI,
GrXPFactory::InvariantOutput* output) const {
if (!coveragePOI.isSolidWhite()) {
output->fWillBlendWithDst = true;
output->fBlendedColorFlags = 0;
return;
}
GrBlendCoeff srcCoeff = fSrcCoeff;
GrBlendCoeff dstCoeff = fDstCoeff;
// TODO: figure out to merge this simplify with other current optimization code paths and
// eventually remove from GrBlend
GrSimplifyBlend(&srcCoeff, &dstCoeff, colorPOI.color(), colorPOI.validFlags(),
0, 0, 0);
if (GrBlendCoeffRefsDst(srcCoeff)) {
output->fWillBlendWithDst = true;
output->fBlendedColorFlags = 0;
return;
}
if (kZero_GrBlendCoeff != dstCoeff) {
bool srcAIsOne = colorPOI.isOpaque();
if (kISA_GrBlendCoeff != dstCoeff || !srcAIsOne) {
output->fWillBlendWithDst = true;
}
output->fBlendedColorFlags = 0;
return;
}
switch (srcCoeff) {
case kZero_GrBlendCoeff:
output->fBlendedColor = 0;
output->fBlendedColorFlags = kRGBA_GrColorComponentFlags;
break;
case kOne_GrBlendCoeff:
output->fBlendedColor = colorPOI.color();
output->fBlendedColorFlags = colorPOI.validFlags();
break;
// The src coeff should never refer to the src and if it refers to dst then opaque
// should have been false.
case kSC_GrBlendCoeff:
case kISC_GrBlendCoeff:
case kDC_GrBlendCoeff:
case kIDC_GrBlendCoeff:
case kSA_GrBlendCoeff:
case kISA_GrBlendCoeff:
case kDA_GrBlendCoeff:
case kIDA_GrBlendCoeff:
default:
SkFAIL("srcCoeff should not refer to src or dst.");
break;
// TODO: update this once GrPaint actually has a const color.
case kConstC_GrBlendCoeff:
case kIConstC_GrBlendCoeff:
case kConstA_GrBlendCoeff:
case kIConstA_GrBlendCoeff:
output->fBlendedColorFlags = 0;
break;
}
output->fWillBlendWithDst = false;
}