| 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 30 matching lines...) Expand all Loading... |
| 41 fCoverageCache = that.fCoverageCache; | 41 fCoverageCache = that.fCoverageCache; |
| 42 if (fColorProcInfoValid) { | 42 if (fColorProcInfoValid) { |
| 43 fColorProcInfo = that.fColorProcInfo; | 43 fColorProcInfo = that.fColorProcInfo; |
| 44 } | 44 } |
| 45 if (fCoverageProcInfoValid) { | 45 if (fCoverageProcInfoValid) { |
| 46 fCoverageProcInfo = that.fCoverageProcInfo; | 46 fCoverageProcInfo = that.fCoverageProcInfo; |
| 47 } | 47 } |
| 48 return *this; | 48 return *this; |
| 49 } | 49 } |
| 50 | 50 |
| 51 void GrPipelineBuilder::setFromPaint(const GrPaint& paint, GrRenderTarget* rt, c
onst GrClip& clip) { | 51 GrPipelineBuilder::GrPipelineBuilder(const GrPaint& paint, GrRenderTarget* rt, c
onst GrClip& clip) { |
| 52 SkASSERT(0 == fBlockEffectRemovalCnt || 0 == this->numFragmentStages()); | 52 SkDEBUGCODE(fBlockEffectRemovalCnt = 0;) |
| 53 | 53 |
| 54 fColorStages.reset(); | 54 fColorStages.reset(); |
| 55 fCoverageStages.reset(); | 55 fCoverageStages.reset(); |
| 56 | 56 |
| 57 for (int i = 0; i < paint.numColorStages(); ++i) { | 57 for (int i = 0; i < paint.numColorStages(); ++i) { |
| 58 fColorStages.push_back(paint.getColorStage(i)); | 58 fColorStages.push_back(paint.getColorStage(i)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 for (int i = 0; i < paint.numCoverageStages(); ++i) { | 61 for (int i = 0; i < paint.numCoverageStages(); ++i) { |
| 62 fCoverageStages.push_back(paint.getCoverageStage(i)); | 62 fCoverageStages.push_back(paint.getCoverageStage(i)); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |