Use GrGLContextInfo in shader generator
Review URL: http://codereview.appspot.com/5645083/
git-svn-id: http://skia.googlecode.com/svn/trunk@3170 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGpuGLShaders.cpp b/src/gpu/gl/GrGpuGLShaders.cpp
index 968b893..7fe7d4b 100644
--- a/src/gpu/gl/GrGpuGLShaders.cpp
+++ b/src/gpu/gl/GrGpuGLShaders.cpp
@@ -55,21 +55,19 @@
Entry fEntries[kMaxEntries];
int fCount;
unsigned int fCurrLRUStamp;
- const GrGLInterface* fGL;
- GrGLSLGeneration fGLSLGeneration;
+ const GrGLContextInfo& fGL;
public:
- ProgramCache(const GrGLInterface* gl,
- GrGLSLGeneration glslGeneration)
+ ProgramCache(const GrGLContextInfo& gl)
: fCount(0)
, fCurrLRUStamp(0)
- , fGL(gl)
- , fGLSLGeneration(glslGeneration) {
+ , fGL(gl) {
}
~ProgramCache() {
for (int i = 0; i < fCount; ++i) {
- GrGpuGLShaders::DeleteProgram(fGL, &fEntries[i].fProgramData);
+ GrGpuGLShaders::DeleteProgram(fGL.interface(),
+ &fEntries[i].fProgramData);
}
}
@@ -90,8 +88,7 @@
Entry* entry = fHashCache.find(newEntry.fKey);
if (NULL == entry) {
- if (!desc.genProgram(fGL, fGLSLGeneration,
- &newEntry.fProgramData)) {
+ if (!desc.genProgram(fGL, &newEntry.fProgramData)) {
return NULL;
}
if (fCount < kMaxEntries) {
@@ -106,7 +103,8 @@
}
}
fHashCache.remove(entry->fKey, entry);
- GrGpuGLShaders::DeleteProgram(fGL, &entry->fProgramData);
+ GrGpuGLShaders::DeleteProgram(fGL.interface(),
+ &entry->fProgramData);
}
entry->copyAndTakeOwnership(newEntry);
fHashCache.insert(entry->fKey, entry);
@@ -281,9 +279,7 @@
}
}
CachedData cachedData;
- if (!program.genProgram(this->glInterface(),
- glslGeneration,
- &cachedData)) {
+ if (!program.genProgram(this->glContextInfo(), &cachedData)) {
return false;
}
DeleteProgram(this->glInterface(), &cachedData);
@@ -314,8 +310,7 @@
&fMaxVertexAttribs);
fProgramData = NULL;
- fProgramCache = new ProgramCache(this->glInterface(),
- this->glslGeneration());
+ fProgramCache = new ProgramCache(this->glContextInfo());
#if 0
this->programUnitTest();