Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Side by Side Diff: src/gpu/GrPipelineBuilder.cpp

Issue 1127693002: Remove canTweakAlphaForCoverage from XP's since batch reads flag. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 fPipelineBuilder = pipelineBuilder; 110 fPipelineBuilder = pipelineBuilder;
111 if (NULL != pipelineBuilder) { 111 if (NULL != pipelineBuilder) {
112 fColorEffectCnt = pipelineBuilder->numColorFragmentStages(); 112 fColorEffectCnt = pipelineBuilder->numColorFragmentStages();
113 fCoverageEffectCnt = pipelineBuilder->numCoverageFragmentStages(); 113 fCoverageEffectCnt = pipelineBuilder->numCoverageFragmentStages();
114 SkDEBUGCODE(++pipelineBuilder->fBlockEffectRemovalCnt;) 114 SkDEBUGCODE(++pipelineBuilder->fBlockEffectRemovalCnt;)
115 } 115 }
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
121 // others will blend incorrectly.
122 bool GrPipelineBuilder::canTweakAlphaForCoverage() const {
123 return this->getXPFactory()->canTweakAlphaForCoverage();
124 }
125
126 ////////////////////////////////////////////////////////////////////////////////
127
128 GrPipelineBuilder::~GrPipelineBuilder() { 120 GrPipelineBuilder::~GrPipelineBuilder() {
129 SkASSERT(0 == fBlockEffectRemovalCnt); 121 SkASSERT(0 == fBlockEffectRemovalCnt);
130 } 122 }
131 123
132 //////////////////////////////////////////////////////////////////////////////// 124 ////////////////////////////////////////////////////////////////////////////////
133 125
134 bool GrPipelineBuilder::willBlendWithDst(const GrPrimitiveProcessor* pp) const { 126 bool GrPipelineBuilder::willBlendWithDst(const GrPrimitiveProcessor* pp) const {
135 this->calcColorInvariantOutput(pp); 127 this->calcColorInvariantOutput(pp);
136 this->calcCoverageInvariantOutput(pp); 128 this->calcCoverageInvariantOutput(pp);
137 129
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const { 169 void GrPipelineBuilder::calcCoverageInvariantOutput(GrColor coverage) const {
178 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { 170 if (!fCoverageProcInfoValid || coverage != fCoverageCache) {
179 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; 171 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;
180 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), 172 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(),
181 this->numCoverageFragmentStages( ), coverage, flags, 173 this->numCoverageFragmentStages( ), coverage, flags,
182 true); 174 true);
183 fCoverageProcInfoValid = true; 175 fCoverageProcInfoValid = true;
184 fCoverageCache = coverage; 176 fCoverageCache = coverage;
185 } 177 }
186 } 178 }
OLDNEW
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/effects/GrCustomXfermodePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698