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

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

Issue 1285193004: Move willColorBlendWithDst from pipeline builder to GrPipelineOptimizations. (Closed) Base URL: https://skia.googlesource.com/skia.git@xpfail
Patch Set: Address comment Created 5 years, 4 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/GrPrimitiveProcessor.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 "GrBlend.h" 10 #include "GrBlend.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrPipelineBuilder.h ('k') | src/gpu/GrPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698