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

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

Issue 1870893002: Implement texel buffers (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_texelfetch
Patch Set: GrBuffer(Access) into include/gpu Created 4 years, 8 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/GrGLBuffer.h » ('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 "GrGeometryProcessor.h" 10 #include "GrGeometryProcessor.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) {
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;
OLDNEW
« no previous file with comments | « src/gpu/GrFragmentProcessor.cpp ('k') | src/gpu/gl/GrGLBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698