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

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

Issue 1306803003: Revert of Remove GrStagedProcessor, remove the word Stage as it applies to FPs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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/GrProcOptInfo.cpp ('k') | src/gpu/GrSWMaskHelper.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 2012 Google Inc. 2 * Copyright 2012 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 "GrProcessor.h" 8 #include "GrProcessor.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrCoordTransform.h" 10 #include "GrCoordTransform.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 for (int i = 0; i < this->numTextures(); ++i) { 123 for (int i = 0; i < this->numTextures(); ++i) {
124 if (this->textureAccess(i) != that.textureAccess(i)) { 124 if (this->textureAccess(i) != that.textureAccess(i)) {
125 return false; 125 return false;
126 } 126 }
127 } 127 }
128 return true; 128 return true;
129 } 129 }
130 130
131 //////////////////////////////////////////////////////////////////////////////// /////////////////// 131 //////////////////////////////////////////////////////////////////////////////// ///////////////////
132 132
133 GrFragmentProcessor::~GrFragmentProcessor() {
134 for (int i = 0; i < fChildProcessors.count(); ++i) {
135 fChildProcessors[i]->unref();
136 }
137 }
138
139 bool GrFragmentProcessor::isEqual(const GrFragmentProcessor& that, 133 bool GrFragmentProcessor::isEqual(const GrFragmentProcessor& that,
140 bool ignoreCoordTransforms) const { 134 bool ignoreCoordTransforms) const {
141 if (this->classID() != that.classID() || 135 if (this->classID() != that.classID() ||
142 !this->hasSameTextureAccesses(that)) { 136 !this->hasSameTextureAccesses(that)) {
143 return false; 137 return false;
144 } 138 }
145 if (ignoreCoordTransforms) { 139 if (ignoreCoordTransforms) {
146 if (this->numTransforms() != that.numTransforms()) { 140 if (this->numTransforms() != that.numTransforms()) {
147 return false; 141 return false;
148 } 142 }
(...skipping 11 matching lines...) Expand all
160 return false; 154 return false;
161 } 155 }
162 } 156 }
163 return true; 157 return true;
164 } 158 }
165 159
166 GrGLFragmentProcessor* GrFragmentProcessor::createGLInstance() const { 160 GrGLFragmentProcessor* GrFragmentProcessor::createGLInstance() const {
167 GrGLFragmentProcessor* glFragProc = this->onCreateGLInstance(); 161 GrGLFragmentProcessor* glFragProc = this->onCreateGLInstance();
168 glFragProc->fChildProcessors.push_back_n(fChildProcessors.count()); 162 glFragProc->fChildProcessors.push_back_n(fChildProcessors.count());
169 for (int i = 0; i < fChildProcessors.count(); ++i) { 163 for (int i = 0; i < fChildProcessors.count(); ++i) {
170 glFragProc->fChildProcessors[i] = fChildProcessors[i]->createGLInstance( ); 164 glFragProc->fChildProcessors[i] = fChildProcessors[i].processor()->creat eGLInstance();
171 } 165 }
172 return glFragProc; 166 return glFragProc;
173 } 167 }
174 168
175 void GrFragmentProcessor::addTextureAccess(const GrTextureAccess* textureAccess) { 169 void GrFragmentProcessor::addTextureAccess(const GrTextureAccess* textureAccess) {
176 // Can't add texture accesses after registering any children since their tex ture accesses have 170 // Can't add texture accesses after registering any children since their tex ture accesses have
177 // already been bubbled up into our fTextureAccesses array 171 // already been bubbled up into our fTextureAccesses array
178 SkASSERT(fChildProcessors.empty()); 172 SkASSERT(fChildProcessors.empty());
179 173
180 INHERITED::addTextureAccess(textureAccess); 174 INHERITED::addTextureAccess(textureAccess);
(...skipping 17 matching lines...) Expand all
198 if (!child->fCoordTransforms.empty()) { 192 if (!child->fCoordTransforms.empty()) {
199 fCoordTransforms.push_back_n(child->fCoordTransforms.count(), 193 fCoordTransforms.push_back_n(child->fCoordTransforms.count(),
200 child->fCoordTransforms.begin()); 194 child->fCoordTransforms.begin());
201 } 195 }
202 if (!child->fTextureAccesses.empty()) { 196 if (!child->fTextureAccesses.empty()) {
203 fTextureAccesses.push_back_n(child->fTextureAccesses.count(), 197 fTextureAccesses.push_back_n(child->fTextureAccesses.count(),
204 child->fTextureAccesses.begin()); 198 child->fTextureAccesses.begin());
205 } 199 }
206 200
207 int index = fChildProcessors.count(); 201 int index = fChildProcessors.count();
208 fChildProcessors.push_back(SkRef(child)); 202 fChildProcessors.push_back(GrFragmentStage(child));
209 203
210 if (child->willReadFragmentPosition()) { 204 if (child->willReadFragmentPosition()) {
211 this->setWillReadFragmentPosition(); 205 this->setWillReadFragmentPosition();
212 } 206 }
213 207
214 if (child->usesLocalCoords()) { 208 if (child->usesLocalCoords()) {
215 fUsesLocalCoords = true; 209 fUsesLocalCoords = true;
216 } 210 }
217 211
218 return index; 212 return index;
(...skipping 25 matching lines...) Expand all
244 //////////////////////////////////////////////////////////////////////////////// /////////////////// 238 //////////////////////////////////////////////////////////////////////////////// ///////////////////
245 239
246 // GrProcessorDataManager lives in the same pool 240 // GrProcessorDataManager lives in the same pool
247 void* GrProcessorDataManager::operator new(size_t size) { 241 void* GrProcessorDataManager::operator new(size_t size) {
248 return MemoryPoolAccessor().pool()->allocate(size); 242 return MemoryPoolAccessor().pool()->allocate(size);
249 } 243 }
250 244
251 void GrProcessorDataManager::operator delete(void* target) { 245 void GrProcessorDataManager::operator delete(void* target) {
252 return MemoryPoolAccessor().pool()->release(target); 246 return MemoryPoolAccessor().pool()->release(target);
253 } 247 }
OLDNEW
« no previous file with comments | « src/gpu/GrProcOptInfo.cpp ('k') | src/gpu/GrSWMaskHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698