OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrPipelineBuilder.h" | 8 #include "GrPipelineBuilder.h" |
9 | 9 |
10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 //////////////////////////////////////////////////////////////////////////////// | 118 //////////////////////////////////////////////////////////////////////////////// |
119 | 119 |
120 GrPipelineBuilder::~GrPipelineBuilder() { | 120 GrPipelineBuilder::~GrPipelineBuilder() { |
121 SkASSERT(0 == fBlockEffectRemovalCnt); | 121 SkASSERT(0 == fBlockEffectRemovalCnt); |
122 } | 122 } |
123 | 123 |
124 //////////////////////////////////////////////////////////////////////////////// | 124 //////////////////////////////////////////////////////////////////////////////// |
125 | 125 |
126 bool GrPipelineBuilder::willBlendWithDst(const GrPrimitiveProcessor* pp) const { | 126 bool GrPipelineBuilder::willColorBlendWithDst(const GrPrimitiveProcessor* pp) co
nst { |
127 this->calcColorInvariantOutput(pp); | 127 this->calcColorInvariantOutput(pp); |
128 this->calcCoverageInvariantOutput(pp); | 128 this->calcCoverageInvariantOutput(pp); |
129 | 129 |
130 GrXPFactory::InvariantOutput output; | 130 GrXPFactory::InvariantBlendedColor blendedColor; |
131 fXPFactory->getInvariantOutput(fColorProcInfo, fCoverageProcInfo, &output); | 131 fXPFactory->getInvariantBlendedColor(fColorProcInfo, fCoverageProcInfo, &ble
ndedColor); |
132 return output.fWillBlendWithDst; | 132 return blendedColor.fWillBlendWithDst; |
133 } | 133 } |
134 | 134 |
135 void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp)
const { | 135 void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp)
const { |
136 fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColo
rFragmentStages()); | 136 fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColo
rFragmentStages()); |
137 fColorProcInfoValid = false; | 137 fColorProcInfoValid = false; |
138 | 138 |
139 } | 139 } |
140 | 140 |
141 void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor*
pp) const { | 141 void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor*
pp) const { |
142 fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(), | 142 fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(), |
(...skipping 26 matching lines...) Expand all Loading... |
169 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { | 169 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { |
170 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { | 170 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { |
171 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; | 171 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; |
172 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), | 172 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), |
173 this->numCoverageFragmentStages(
), coverage, flags, | 173 this->numCoverageFragmentStages(
), coverage, flags, |
174 true); | 174 true); |
175 fCoverageProcInfoValid = true; | 175 fCoverageProcInfoValid = true; |
176 fCoverageCache = coverage; | 176 fCoverageCache = coverage; |
177 } | 177 } |
178 } | 178 } |
OLD | NEW |