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 "GrGeometryProcessor.h" | 10 #include "GrGeometryProcessor.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 | 99 |
100 /////////////////////////////////////////////////////////////////////////////// | 100 /////////////////////////////////////////////////////////////////////////////// |
101 | 101 |
102 GrProcessor::~GrProcessor() {} | 102 GrProcessor::~GrProcessor() {} |
103 | 103 |
104 void GrProcessor::addTextureAccess(const GrTextureAccess* access) { | 104 void GrProcessor::addTextureAccess(const GrTextureAccess* access) { |
105 fTextureAccesses.push_back(access); | 105 fTextureAccesses.push_back(access); |
106 this->addGpuResource(access->getProgramTexture()); | 106 this->addGpuResource(access->getProgramTexture()); |
107 } | 107 } |
108 | 108 |
109 void GrProcessor::addBufferAccess(const GrBufferAccess* access) { | |
Chris Dalton
2016/04/08 00:56:43
Is there a kosher way to get a hold of a caps obje
bsalomon
2016/04/11 16:51:38
Not really. I wouldn't bend over backwards for tha
| |
110 fBufferAccesses.push_back(access); | |
111 this->addGpuResource(access->getProgramBuffer()); | |
112 } | |
113 | |
109 void* GrProcessor::operator new(size_t size) { | 114 void* GrProcessor::operator new(size_t size) { |
110 return MemoryPoolAccessor().pool()->allocate(size); | 115 return MemoryPoolAccessor().pool()->allocate(size); |
111 } | 116 } |
112 | 117 |
113 void GrProcessor::operator delete(void* target) { | 118 void GrProcessor::operator delete(void* target) { |
114 return MemoryPoolAccessor().pool()->release(target); | 119 return MemoryPoolAccessor().pool()->release(target); |
115 } | 120 } |
116 | 121 |
117 bool GrProcessor::hasSameTextureAccesses(const GrProcessor& that) const { | 122 bool GrProcessor::hasSameSamplers(const GrProcessor& that) const { |
118 if (this->numTextures() != that.numTextures()) { | 123 if (this->numTextures() != that.numTextures() || this->numBuffers() != that. numBuffers()) { |
119 return false; | 124 return false; |
120 } | 125 } |
121 for (int i = 0; i < this->numTextures(); ++i) { | 126 for (int i = 0; i < this->numTextures(); ++i) { |
122 if (this->textureAccess(i) != that.textureAccess(i)) { | 127 if (this->textureAccess(i) != that.textureAccess(i)) { |
123 return false; | 128 return false; |
124 } | 129 } |
125 } | 130 } |
131 for (int i = 0; i < this->numBuffers(); ++i) { | |
132 if (this->bufferAccess(i) != that.bufferAccess(i)) { | |
133 return false; | |
134 } | |
135 } | |
126 return true; | 136 return true; |
127 } | 137 } |
128 | 138 |
129 //////////////////////////////////////////////////////////////////////////////// /////////////////// | 139 //////////////////////////////////////////////////////////////////////////////// /////////////////// |
130 | 140 |
131 // Initial static variable from GrXPFactory | 141 // Initial static variable from GrXPFactory |
132 int32_t GrXPFactory::gCurrXPFClassID = | 142 int32_t GrXPFactory::gCurrXPFClassID = |
133 GrXPFactory::kIllegalXPFClassID; | 143 GrXPFactory::kIllegalXPFClassID; |
OLD | NEW |