Chromium Code Reviews| 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 // Some blend modes allow folding a fractional coverage value into the color's a lpha channel, while | 120 // Some blend modes allow folding a fractional coverage value into the color's a lpha channel, while |
| 121 // others will blend incorrectly. | 121 // others will blend incorrectly. |
| 122 bool GrPipelineBuilder::canTweakAlphaForCoverage() const { | 122 bool GrPipelineBuilder::canTweakAlphaForCoverage() const { |
| 123 return this->getXPFactory()->canTweakAlphaForCoverage(); | 123 return this->getXPFactory()->canTweakAlphaForCoverage(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 // Some blending extensions require the use of a barrier to ensure coherent resu lts. | |
| 127 bool GrPipelineBuilder::willBlendCoherently(const GrDrawTargetCaps& caps) const { | |
| 128 return this->getXPFactory()->willBlendCoherently(caps); | |
|
Mark Kilgard
2015/04/02 23:02:38
this seems a lot of indirection to just return a b
| |
| 129 } | |
| 130 | |
| 126 //////////////////////////////////////////////////////////////////////////////// | 131 //////////////////////////////////////////////////////////////////////////////// |
| 127 | 132 |
| 128 GrPipelineBuilder::~GrPipelineBuilder() { | 133 GrPipelineBuilder::~GrPipelineBuilder() { |
| 129 SkASSERT(0 == fBlockEffectRemovalCnt); | 134 SkASSERT(0 == fBlockEffectRemovalCnt); |
| 130 } | 135 } |
| 131 | 136 |
| 132 //////////////////////////////////////////////////////////////////////////////// | 137 //////////////////////////////////////////////////////////////////////////////// |
| 133 | 138 |
| 134 bool GrPipelineBuilder::willBlendWithDst(const GrPrimitiveProcessor* pp) const { | 139 bool GrPipelineBuilder::willBlendWithDst(const GrPrimitiveProcessor* pp) const { |
| 135 this->calcColorInvariantOutput(pp); | 140 this->calcColorInvariantOutput(pp); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { | 182 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { |
| 178 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { | 183 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { |
| 179 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; | 184 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; |
| 180 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), | 185 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), |
| 181 this->numCoverageFragmentStages( ), coverage, flags, | 186 this->numCoverageFragmentStages( ), coverage, flags, |
| 182 true); | 187 true); |
| 183 fCoverageProcInfoValid = true; | 188 fCoverageProcInfoValid = true; |
| 184 fCoverageCache = coverage; | 189 fCoverageCache = coverage; |
| 185 } | 190 } |
| 186 } | 191 } |
| OLD | NEW |