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

Unified Diff: src/gpu/gl/GrGLProgram.h

Issue 16158007: Make GrGLProgram no longer depend on kNumStages (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: cleanup Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgram.h
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index be6e6878dfad918cae6019fb7e39f9b6c042fbe9..ce43b710bfeb3dd13e9458a905a81e7b9b846272 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -156,8 +156,7 @@ private:
// Helper for setData() that sets the view matrix and loads the render target height uniform
void setMatrixAndRenderTargetHeight(const GrDrawState&);
- typedef SkSTArray<4, UniformHandle, true> SamplerUniSArray;
-
+ // handles for uniforms (aside from per-effect samplers)
struct UniformHandles {
UniformHandle fViewMatrixUni;
UniformHandle fColorUni;
@@ -173,9 +172,6 @@ private:
UniformHandle fDstCopyScaleUni;
UniformHandle fDstCopySamplerUni;
- // An array of sampler uniform handles for each effect.
- SamplerUniSArray fEffectSamplerUnis[GrDrawState::kNumStages];
-
UniformHandles() {
fViewMatrixUni = GrGLUniformManager::kInvalidUniformHandle;
fColorUni = GrGLUniformManager::kInvalidUniformHandle;
@@ -188,6 +184,17 @@ private:
}
};
+ typedef SkSTArray<4, UniformHandle, true> SamplerUniSArray;
+ typedef SkSTArray<4, int, true> TextureUnitSArray;
+
+ struct EffectAndSamplers {
+ EffectAndSamplers() : fGLEffect(NULL) {}
+ ~EffectAndSamplers() { delete fGLEffect; }
+ GrGLEffect* fGLEffect;
+ SamplerUniSArray fSamplerUnis; // sampler uni handles for effect's GrTextureAccess
+ TextureUnitSArray fTextureUnits; // texture unit used for each entry of fSamplerUnis
+ };
+
// GL IDs
GrGLuint fVShaderID;
GrGLuint fGShaderID;
@@ -199,8 +206,9 @@ private:
GrColor fColor;
GrColor fCoverage;
GrColor fColorFilterColor;
+ int fDstCopyTexUnit;
- GrGLEffect* fEffects[GrDrawState::kNumStages];
+ SkTArray<EffectAndSamplers> fEffectStates;
GrGLProgramDesc fDesc;
const GrGLContext& fContext;
« no previous file with comments | « no previous file | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698