本文整理汇总了C++中GrCaps::usesMixedSamples方法的典型用法代码示例。如果您正苦于以下问题:C++ GrCaps::usesMixedSamples方法的具体用法?C++ GrCaps::usesMixedSamples怎么用?C++ GrCaps::usesMixedSamples使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrCaps
的用法示例。
在下文中一共展示了GrCaps::usesMixedSamples方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SrcOverWillNeedDstTexture
bool GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(const GrCaps& caps,
const GrPipelineOptimizations& optimizations) {
if (caps.shaderCaps()->dstReadInShaderSupport() ||
caps.shaderCaps()->dualSourceBlendingSupport()) {
return false;
}
// When we have four channel coverage we always need to read the dst in order to correctly
// blend. The one exception is when we are using srcover mode and we know the input color
// into the XP.
if (optimizations.fCoveragePOI.isFourChannelOutput()) {
if (kRGBA_GrColorComponentFlags == optimizations.fColorPOI.validFlags() &&
!caps.shaderCaps()->dstReadInShaderSupport()) {
return false;
}
return get_lcd_blend_formula(optimizations.fCoveragePOI,
SkBlendMode::kSrcOver).hasSecondaryOutput();
}
// We fallback on the shader XP when the blend formula would use dual source blending but we
// don't have support for it.
static const bool kHasMixedSamples = false;
SkASSERT(!caps.usesMixedSamples()); // We never use mixed samples without dual source blending.
return get_blend_formula(optimizations.fColorPOI, optimizations.fCoveragePOI,
kHasMixedSamples, SkBlendMode::kSrcOver).hasSecondaryOutput();
}
示例2: INHERITED
// Deferred version
// TODO: we can probably munge the 'desc' in both the wrapped and deferred
// cases to make the sampleConfig/numSamples stuff more rational.
GrRenderTargetProxy::GrRenderTargetProxy(const GrCaps& caps, const GrSurfaceDesc& desc,
SkBackingFit fit, SkBudgeted budgeted, uint32_t flags)
: INHERITED(desc, fit, budgeted, flags)
, fRenderTargetFlags(GrRenderTarget::Flags::kNone) {
// Since we know the newly created render target will be internal, we are able to precompute
// what the flags will ultimately end up being.
if (caps.usesMixedSamples() && fDesc.fSampleCnt > 0) {
fRenderTargetFlags |= GrRenderTarget::Flags::kMixedSampled;
}
if (caps.maxWindowRectangles() > 0) {
fRenderTargetFlags |= GrRenderTarget::Flags::kWindowRectsSupport;
}
}
示例3: ComputeSampleConfig
GrRenderTarget::SampleConfig GrRenderTarget::ComputeSampleConfig(const GrCaps& caps,
int sampleCnt) {
return (caps.usesMixedSamples() && sampleCnt > 0)
? GrRenderTarget::kStencil_SampleConfig
: GrRenderTarget::kUnified_SampleConfig;
}