aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPipeline.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-07-08 10:20:21 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-08 10:20:21 -0700
commitd07a2793baea42956d27b3ad47ed562f08e4570a (patch)
tree43f0a8ac998e1fc05b7063e65c3f69317f209e68 /src/gpu/GrPipeline.cpp
parent60c047557559e5410063452e59d65377e813e5f2 (diff)
Revert of Rework GrPipelineInfo (patchset #7 id:120001 of https://codereview.chromium.org/1213383005/)
Reason for revert: breaking stuff! Original issue's description: > Makes GrPipelineInfo a class with query functions used by GrBatch subclasses. > > Committed: https://skia.googlesource.com/skia/+/f5179a4c490bc787190321bd8ffdb0e6a4efa9ac TBR=joshualitt@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1213013003
Diffstat (limited to 'src/gpu/GrPipeline.cpp')
-rw-r--r--src/gpu/GrPipeline.cpp33
1 files changed, 8 insertions, 25 deletions
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 7bdc3000d5..4feddb00ab 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -30,7 +30,7 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder,
overrideColor = colorPOI.inputColorToEffectiveStage();
}
- GrXferProcessor::OptFlags optFlags = GrXferProcessor::kNone_OptFlags;
+ GrXferProcessor::OptFlags optFlags;
if (xferProcessor) {
fXferProcessor.reset(xferProcessor.get());
@@ -41,11 +41,6 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder,
caps);
}
- // No need to have an override color if it isn't even going to be used.
- if (SkToBool(GrXferProcessor::kIgnoreColor_OptFlag)) {
- overrideColor = GrColor_ILLEGAL;
- }
-
// When path rendering the stencil settings are not always set on the GrPipelineBuilder
// so we must check the draw type. In cases where we will skip drawing we simply return a
// null GrPipeline.
@@ -103,25 +98,13 @@ GrPipeline::GrPipeline(const GrPipelineBuilder& pipelineBuilder,
pipelineBuilder.fCoverageStages[i].processor()->usesLocalCoords();
}
- // Setup info we need to pass to GrPrimitiveProcessors that are used with this GrPipeline.
- fInfoForPrimitiveProcessor.fFlags = 0;
- if (!SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag)) {
- fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kReadsColor_GrPipelineInfoFlag;
- }
- if (GrColor_ILLEGAL != overrideColor) {
- fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kUseOverrideColor_GrPipelineInfoFlag;
- fInfoForPrimitiveProcessor.fOverrideColor = overrideColor;
- }
- if (!SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag)) {
- fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kReadsCoverage_GrPipelineInfoFlag;
- }
- if (usesLocalCoords) {
- fInfoForPrimitiveProcessor.fFlags |= GrPipelineInfo::kReadsLocalCoords_GrPipelineInfoFlag;
- }
- if (SkToBool(optFlags & GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag)) {
- fInfoForPrimitiveProcessor.fFlags |=
- GrPipelineInfo::kCanTweakAlphaForCoverage_GrPipelineInfoFlag;
- }
+ // let the GP init the batch tracker
+ fInitBT.fColorIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreColor_OptFlag);
+ fInitBT.fOverrideColor = fInitBT.fColorIgnored ? GrColor_ILLEGAL : overrideColor;
+ fInitBT.fCoverageIgnored = SkToBool(optFlags & GrXferProcessor::kIgnoreCoverage_OptFlag);
+ fInitBT.fUsesLocalCoords = usesLocalCoords;
+ fInitBT.fCanTweakAlphaForCoverage =
+ SkToBool(optFlags & GrXferProcessor::kCanTweakAlphaForCoverage_OptFlag);
}
void GrPipeline::adjustProgramFromOptimizations(const GrPipelineBuilder& pipelineBuilder,