OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |