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 "GrBlend.h" | 10 #include "GrBlend.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 //////////////////////////////////////////////////////////////////////////////// | 128 //////////////////////////////////////////////////////////////////////////////// |
129 | 129 |
130 GrPipelineBuilder::~GrPipelineBuilder() { | 130 GrPipelineBuilder::~GrPipelineBuilder() { |
131 SkASSERT(0 == fBlockEffectRemovalCnt); | 131 SkASSERT(0 == fBlockEffectRemovalCnt); |
132 } | 132 } |
133 | 133 |
134 //////////////////////////////////////////////////////////////////////////////// | 134 //////////////////////////////////////////////////////////////////////////////// |
135 | 135 |
136 bool GrPipelineBuilder::willColorBlendWithDst(const GrPrimitiveProcessor* pp) co
nst { | |
137 this->calcColorInvariantOutput(pp); | |
138 | |
139 GrXPFactory::InvariantBlendedColor blendedColor; | |
140 fXPFactory->getInvariantBlendedColor(fColorProcInfo, &blendedColor); | |
141 return blendedColor.fWillBlendWithDst; | |
142 } | |
143 | |
144 void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp)
const { | 136 void GrPipelineBuilder::calcColorInvariantOutput(const GrPrimitiveProcessor* pp)
const { |
145 fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColo
rFragmentStages()); | 137 fColorProcInfo.calcColorWithPrimProc(pp, fColorStages.begin(), this->numColo
rFragmentStages()); |
146 fColorProcInfoValid = false; | 138 fColorProcInfoValid = false; |
147 | 139 |
148 } | 140 } |
149 | 141 |
150 void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor*
pp) const { | 142 void GrPipelineBuilder::calcCoverageInvariantOutput(const GrPrimitiveProcessor*
pp) const { |
151 fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(), | 143 fCoverageProcInfo.calcCoverageWithPrimProc(pp, fCoverageStages.begin(), |
152 this->numCoverageFragmentStages()
); | 144 this->numCoverageFragmentStages()
); |
153 fCoverageProcInfoValid = false; | 145 fCoverageProcInfoValid = false; |
(...skipping 24 matching lines...) Expand all Loading... |
178 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { | 170 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { |
179 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { | 171 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { |
180 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; | 172 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; |
181 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), | 173 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), |
182 this->numCoverageFragmentStages(
), coverage, flags, | 174 this->numCoverageFragmentStages(
), coverage, flags, |
183 true); | 175 true); |
184 fCoverageProcInfoValid = true; | 176 fCoverageProcInfoValid = true; |
185 fCoverageCache = coverage; | 177 fCoverageCache = coverage; |
186 } | 178 } |
187 } | 179 } |
OLD | NEW |