| Index: src/gpu/instanced/InstanceProcessor.cpp
|
| diff --git a/src/gpu/instanced/InstanceProcessor.cpp b/src/gpu/instanced/InstanceProcessor.cpp
|
| index 80437a110a04a6b1b971a160a27e6c951e76105d..0266d43f7f87ef1cdfb983543f102b13dc6bcf61 100644
|
| --- a/src/gpu/instanced/InstanceProcessor.cpp
|
| +++ b/src/gpu/instanced/InstanceProcessor.cpp
|
| @@ -141,8 +141,7 @@ private:
|
|
|
| class GLSLInstanceProcessor::Backend {
|
| public:
|
| - static Backend* SK_WARN_UNUSED_RESULT Create(const GrGLSLProgramBuilder*, BatchInfo,
|
| - const VertexInputs&);
|
| + static Backend* SK_WARN_UNUSED_RESULT Create(const GrPipeline&, BatchInfo, const VertexInputs&);
|
| virtual ~Backend() {}
|
|
|
| void init(GrGLSLVaryingHandler*, GrGLSLVertexBuilder*);
|
| @@ -208,6 +207,7 @@ protected:
|
| };
|
|
|
| void GLSLInstanceProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
|
| + const GrPipeline& pipeline = args.fVertBuilder->getProgramBuilder()->pipeline();
|
| const InstanceProcessor& ip = args.fGP.cast<InstanceProcessor>();
|
| GrGLSLUniformHandler* uniHandler = args.fUniformHandler;
|
| GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
|
| @@ -247,7 +247,7 @@ void GLSLInstanceProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
|
| inputs.attr(Attrib::kInstanceInfo));
|
| }
|
|
|
| - SkAutoTDelete<Backend> backend(Backend::Create(v->getProgramBuilder(), ip.batchInfo(), inputs));
|
| + SkAutoTDelete<Backend> backend(Backend::Create(pipeline, ip.batchInfo(), inputs));
|
| backend->init(varyingHandler, v);
|
|
|
| if (hasSingleShapeType) {
|
| @@ -339,7 +339,8 @@ void GLSLInstanceProcessor::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
|
| v->definef("OVAL_SHAPE_TYPE", "%du", (int)ShapeType::kOval);
|
| }
|
|
|
| - backend->emitCode(v, f, args.fOutputCoverage, args.fOutputColor);
|
| + backend->emitCode(v, f, pipeline.ignoresCoverage() ? nullptr : args.fOutputCoverage,
|
| + args.fOutputColor);
|
|
|
| const char* localCoords = nullptr;
|
| if (ip.batchInfo().fUsesLocalCoords) {
|
| @@ -516,9 +517,10 @@ void GLSLInstanceProcessor::Backend::setupInnerRRect(GrGLSLVertexBuilder* v) {
|
|
|
| void GLSLInstanceProcessor::Backend::emitCode(GrGLSLVertexBuilder* v, GrGLSLPPFragmentBuilder* f,
|
| const char* outCoverage, const char* outColor) {
|
| + SkASSERT(!fModifiesCoverage || outCoverage);
|
| this->onEmitCode(v, f, fModifiesCoverage ? outCoverage : nullptr,
|
| fModifiesColor ? outColor : nullptr);
|
| - if (!fModifiesCoverage) {
|
| + if (outCoverage && !fModifiesCoverage) {
|
| // Even though the subclass doesn't use coverage, we are expected to assign some value.
|
| f->codeAppendf("%s = vec4(1);", outCoverage);
|
| }
|
| @@ -1661,7 +1663,7 @@ void GLSLInstanceProcessor::BackendMultisample::acceptCoverageMask(GrGLSLPPFragm
|
| ////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
| GLSLInstanceProcessor::Backend*
|
| -GLSLInstanceProcessor::Backend::Create(const GrGLSLProgramBuilder* p, BatchInfo batchInfo,
|
| +GLSLInstanceProcessor::Backend::Create(const GrPipeline& pipeline, BatchInfo batchInfo,
|
| const VertexInputs& inputs) {
|
| switch (batchInfo.fAntialiasMode) {
|
| default:
|
| @@ -1672,7 +1674,6 @@ GLSLInstanceProcessor::Backend::Create(const GrGLSLProgramBuilder* p, BatchInfo
|
| return new BackendCoverage(batchInfo, inputs);
|
| case AntialiasMode::kMSAA:
|
| case AntialiasMode::kMixedSamples: {
|
| - const GrPipeline& pipeline = p->pipeline();
|
| const GrRenderTargetPriv& rtp = pipeline.getRenderTarget()->renderTargetPriv();
|
| const GrGpu::MultisampleSpecs& specs = rtp.getMultisampleSpecs(pipeline.getStencil());
|
| return new BackendMultisample(batchInfo, inputs, specs.fEffectiveSampleCnt);
|
|
|