const GrPipelineAnalysis&,
bool hasMixedSamples,
const GrXferProcessor::DstTexture*);
+
+ /** Returns a simple non-LCD porter duff blend XP with no optimizations or coverage. */
+ static sk_sp<GrXferProcessor> CreateNoCoverageXP(SkBlendMode);
+
/** This XP implements non-LCD src-over using hw blend with no optimizations. It is returned
by reference because it is global and its ref-cnting methods are not thread safe. */
static const GrXferProcessor& SimpleSrcOverXP();
}
}
+GrPipeline::GrPipeline(GrRenderTarget* rt, SkBlendMode blendmode)
+ : fRenderTarget(rt)
+ , fScissorState()
+ , fWindowRectsState()
+ , fUserStencilSettings(&GrUserStencilSettings::kUnused)
+ , fDrawFace(static_cast<uint16_t>(GrDrawFace::kBoth))
+ , fFlags()
+ , fXferProcessor(GrPorterDuffXPFactory::CreateNoCoverageXP(blendmode).get())
+ , fFragmentProcessors()
+ , fNumColorProcessors(0) {
+}
+
////////////////////////////////////////////////////////////////////////////////
bool GrPipeline::AreEqual(const GrPipeline& a, const GrPipeline& b) {
/** Creates a pipeline into a pre-allocated buffer */
static GrPipeline* CreateAt(void* memory, const CreateArgs&, GrPipelineOptimizations*);
+ /**
+ * Creates a simple pipeline with default settings and no processors. The provided blend mode
+ * must be "Porter Duff" (<= kLastCoeffMode).
+ **/
+ GrPipeline(GrRenderTarget*, SkBlendMode);
+
/// @}
///////////////////////////////////////////////////////////////////////////
return new PorterDuffXferProcessor(blendFormula);
}
+sk_sp<GrXferProcessor> GrPorterDuffXPFactory::CreateNoCoverageXP(SkBlendMode blendmode) {
+ BlendFormula formula = get_blend_formula(false, false, false, blendmode);
+ return sk_make_sp<PorterDuffXferProcessor>(formula);
+}
+
bool GrPorterDuffXPFactory::SrcOverWillNeedDstTexture(const GrCaps& caps,
const GrPipelineAnalysis& analysis) {
if (caps.shaderCaps()->dstReadInShaderSupport() ||