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

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

Issue 1266633003: Added registerChild; transforms, textures, glKey automatically handled. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: refactored to onGetGLProcessorKey; removed emitSamplers specialized template; fixed nits 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
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 129
130 //////////////////////////////////////////////////////////////////////////////// /////////////////// 130 //////////////////////////////////////////////////////////////////////////////// ///////////////////
131 131
132 void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) { 132 void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) {
133 fCoordTransforms.push_back(transform); 133 fCoordTransforms.push_back(transform);
134 fUsesLocalCoords = fUsesLocalCoords || transform->sourceCoords() == kLocal_G rCoordSet; 134 fUsesLocalCoords = fUsesLocalCoords || transform->sourceCoords() == kLocal_G rCoordSet;
135 SkDEBUGCODE(transform->setInProcessor();) 135 SkDEBUGCODE(transform->setInProcessor();)
136 } 136 }
137 137
138 void GrFragmentProcessor::registerChildProcessor(GrFragmentProcessor* child) {
139 fChildProcessors.push_back(child);
140 }
141
138 bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) con st { 142 bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) con st {
139 if (fCoordTransforms.count() != that.fCoordTransforms.count()) { 143 if (fCoordTransforms.count() != that.fCoordTransforms.count()) {
140 return false; 144 return false;
141 } 145 }
142 int count = fCoordTransforms.count(); 146 int count = fCoordTransforms.count();
143 for (int i = 0; i < count; ++i) { 147 for (int i = 0; i < count; ++i) {
144 if (*fCoordTransforms[i] != *that.fCoordTransforms[i]) { 148 if (*fCoordTransforms[i] != *that.fCoordTransforms[i]) {
145 return false; 149 return false;
146 } 150 }
147 } 151 }
(...skipping 13 matching lines...) Expand all
161 //////////////////////////////////////////////////////////////////////////////// /////////////////// 165 //////////////////////////////////////////////////////////////////////////////// ///////////////////
162 166
163 // GrProcessorDataManager lives in the same pool 167 // GrProcessorDataManager lives in the same pool
164 void* GrProcessorDataManager::operator new(size_t size) { 168 void* GrProcessorDataManager::operator new(size_t size) {
165 return MemoryPoolAccessor().pool()->allocate(size); 169 return MemoryPoolAccessor().pool()->allocate(size);
166 } 170 }
167 171
168 void GrProcessorDataManager::operator delete(void* target) { 172 void GrProcessorDataManager::operator delete(void* target) {
169 return MemoryPoolAccessor().pool()->release(target); 173 return MemoryPoolAccessor().pool()->release(target);
170 } 174 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp ('k') | src/gpu/effects/GrBicubicEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698