aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPipeline.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-04-04 15:13:25 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-04 19:46:18 +0000
commite14bd80db048277daa3db28496310e1863b5b7a9 (patch)
tree7da5f6aa72b4b884476f46cc4cebe2a9fa3274c4 /src/gpu/GrPipeline.cpp
parent9e4d51126f60264f53fbf841ef97092803e88374 (diff)
Move GrPipelineBuilder into GrRenderTargetContext::addLegacyDrawOp
This makes the legacy code use GrProcessorSet::Analysis in the same manner as the non-GrLegacyMeshDrawOps which enables changes to how analysis works. Change-Id: I8171e285ac8930beb3ac33cd3c4ee88f217b9e40 Reviewed-on: https://skia-review.googlesource.com/11205 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrPipeline.cpp')
-rw-r--r--src/gpu/GrPipeline.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index e36db07e0e..f48162c86b 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -19,10 +19,6 @@
#include "ops/GrOp.h"
void GrPipeline::init(const InitArgs& args) {
- if (args.fAnalysis) {
- SkASSERT(args.fAnalysis->outputColor() == args.fInputColor);
- SkASSERT(args.fAnalysis->outputCoverage() == args.fInputCoverage);
- }
SkASSERT(args.fRenderTarget);
fRenderTarget.reset(args.fRenderTarget);
@@ -62,12 +58,12 @@ void GrPipeline::init(const InitArgs& args) {
const GrXPFactory* xpFactory = args.fProcessors->xpFactory();
if (xpFactory) {
xferProcessor.reset(xpFactory->createXferProcessor(
- args.fInputColor, args.fInputCoverage, hasMixedSamples, *args.fCaps));
+ args.fXPInputColor, args.fXPInputCoverage, hasMixedSamples, *args.fCaps));
SkASSERT(xferProcessor);
} else {
// This may return nullptr in the common case of src-over implemented using hw blending.
xferProcessor.reset(GrPorterDuffXPFactory::CreateSrcOverXferProcessor(
- *args.fCaps, args.fInputColor, args.fInputCoverage, hasMixedSamples));
+ *args.fCaps, args.fXPInputColor, args.fXPInputCoverage, hasMixedSamples));
}
fXferProcessor.reset(xferProcessor.get());
}
@@ -76,25 +72,9 @@ void GrPipeline::init(const InitArgs& args) {
fDstTextureOffset = args.fDstTexture.offset();
}
- // This is for the legacy GrPipeline creation in GrLegacyMeshDrawOp where analysis does not
- // eliminate fragment processors from GrProcessorSet.
- int colorFPsToEliminate = 0;
- if (args.fAnalysis) {
- GrColor overrideColor = GrColor_ILLEGAL;
- colorFPsToEliminate =
- args.fAnalysis->getInputColorOverrideAndColorProcessorEliminationCount(
- &overrideColor);
- colorFPsToEliminate = SkTMax(colorFPsToEliminate, 0);
- if (args.fAnalysis->isInputColorIgnored()) {
- // No need to have an override color if it isn't even going to be used.
- overrideColor = GrColor_ILLEGAL;
- colorFPsToEliminate = args.fProcessors->numColorFragmentProcessors();
- }
- }
-
// Copy GrFragmentProcessors from GrPipelineBuilder to Pipeline, possibly removing some of the
// color fragment processors.
- fNumColorProcessors = args.fProcessors->numColorFragmentProcessors() - colorFPsToEliminate;
+ fNumColorProcessors = args.fProcessors->numColorFragmentProcessors();
int numTotalProcessors =
fNumColorProcessors + args.fProcessors->numCoverageFragmentProcessors();
if (args.fAppliedClip && args.fAppliedClip->clipCoverageFragmentProcessor()) {
@@ -102,8 +82,7 @@ void GrPipeline::init(const InitArgs& args) {
}
fFragmentProcessors.reset(numTotalProcessors);
int currFPIdx = 0;
- for (int i = colorFPsToEliminate; i < args.fProcessors->numColorFragmentProcessors();
- ++i, ++currFPIdx) {
+ for (int i = 0; i < args.fProcessors->numColorFragmentProcessors(); ++i, ++currFPIdx) {
const GrFragmentProcessor* fp = args.fProcessors->colorFragmentProcessor(i);
fFragmentProcessors[currFPIdx].reset(fp);
}