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

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

Issue 2365943003: Stop aggregating texture/buffer access objects in GrFragmentProcessor parents. (Closed)
Patch Set: Readd base class, rebase Created 4 years, 2 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/GrFragmentProcessor.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('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 "GrPipeline.h" 8 #include "GrPipeline.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 &blendedColor); 169 &blendedColor);
170 } 170 }
171 if (blendedColor.fWillBlendWithDst) { 171 if (blendedColor.fWillBlendWithDst) {
172 overrides->fFlags |= GrXPOverridesForBatch::kWillColorBlendWithDst_Flag; 172 overrides->fFlags |= GrXPOverridesForBatch::kWillColorBlendWithDst_Flag;
173 } 173 }
174 174
175 return pipeline; 175 return pipeline;
176 } 176 }
177 177
178 static void add_dependencies_for_processor(const GrFragmentProcessor* proc, GrRe nderTarget* rt) { 178 static void add_dependencies_for_processor(const GrFragmentProcessor* proc, GrRe nderTarget* rt) {
179 for (int i = 0; i < proc->numChildProcessors(); ++i) { 179 GrFragmentProcessor::TextureAccessIter iter(proc);
180 // need to recurse 180 while (const GrTextureAccess* access = iter.next()) {
181 add_dependencies_for_processor(&proc->childProcessor(i), rt);
182 }
183
184 for (int i = 0; i < proc->numTextures(); ++i) {
185 GrTexture* texture = proc->textureAccess(i).getTexture();
186 SkASSERT(rt->getLastDrawTarget()); 181 SkASSERT(rt->getLastDrawTarget());
187 rt->getLastDrawTarget()->addDependency(texture); 182 rt->getLastDrawTarget()->addDependency(access->getTexture());
188 } 183 }
189 } 184 }
190 185
191 void GrPipeline::addDependenciesTo(GrRenderTarget* rt) const { 186 void GrPipeline::addDependenciesTo(GrRenderTarget* rt) const {
192 for (int i = 0; i < fFragmentProcessors.count(); ++i) { 187 for (int i = 0; i < fFragmentProcessors.count(); ++i) {
193 add_dependencies_for_processor(fFragmentProcessors[i].get(), rt); 188 add_dependencies_for_processor(fFragmentProcessors[i].get(), rt);
194 } 189 }
195 190
196 const GrXferProcessor& xfer = this->getXferProcessor(); 191 const GrXferProcessor& xfer = this->getXferProcessor();
197 192
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 239 }
245 } 240 }
246 241
247 for (int i = 0; i < a.numFragmentProcessors(); i++) { 242 for (int i = 0; i < a.numFragmentProcessors(); i++) {
248 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i))) { 243 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i))) {
249 return false; 244 return false;
250 } 245 }
251 } 246 }
252 return true; 247 return true;
253 } 248 }
OLDNEW
« no previous file with comments | « src/gpu/GrFragmentProcessor.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698