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

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

Issue 551253004: Changes to remove program effects builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: removing program effects builder Created 6 years, 3 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
Index: src/gpu/gl/GrGLEffect.h
diff --git a/src/gpu/gl/GrGLEffect.h b/src/gpu/gl/GrGLEffect.h
index 24c20c6d57367468a7bf8e0af0be940ab97cc3cc..398bc9a6302c9514ff796e705c24130b224d26ea 100644
--- a/src/gpu/gl/GrGLEffect.h
+++ b/src/gpu/gl/GrGLEffect.h
@@ -34,11 +34,53 @@ class GrGLTexture;
class GrGLGeometryProcessor;
class GrGLEffect {
-
public:
- typedef GrGLProgramEffects::TransformedCoordsArray TransformedCoordsArray;
- typedef GrGLProgramEffects::TextureSampler TextureSampler;
- typedef GrGLProgramEffects::TextureSamplerArray TextureSamplerArray;
+ typedef GrGLProgramDataManager::UniformHandle UniformHandle;
+
+ /**
+ * Passed to GrGLEffects so they can add transformed coordinates to their shader code.
+ */
+ class TransformedCoords {
bsalomon 2014/09/18 18:08:33 Curious whether this should be a GrGLShaderVar
+ public:
+ TransformedCoords(const SkString& name, GrSLType type)
+ : fName(name), fType(type) {
+ }
+
+ const char* c_str() const { return fName.c_str(); }
+ GrSLType type() const { return fType; }
+ const SkString& getName() const { return fName; }
+
+ private:
+ SkString fName;
+ GrSLType fType;
+ };
+
+ typedef SkTArray<TransformedCoords> TransformedCoordsArray;
+
+ /**
+ * Passed to GrGLEffects so they can add texture reads to their shader code.
+ */
+ class TextureSampler {
+ public:
+ TextureSampler(UniformHandle uniform, const GrTextureAccess& access)
+ : fSamplerUniform(uniform)
+ , fConfigComponentMask(GrPixelConfigComponentMask(access.getTexture()->config())) {
+ SkASSERT(0 != fConfigComponentMask);
+ memcpy(fSwizzle, access.getSwizzle(), 5);
+ }
+
+ UniformHandle samplerUniform() const { return fSamplerUniform; }
bsalomon 2014/09/18 18:08:33 Do they need this?
+ // bitfield of GrColorComponentFlags present in the texture's config.
+ uint32_t configComponentMask() const { return fConfigComponentMask; }
+ const char* swizzle() const { return fSwizzle; }
bsalomon 2014/09/18 18:08:33 Maybe a comment that this is ".abcd"
+
+ private:
+ UniformHandle fSamplerUniform;
+ uint32_t fConfigComponentMask;
+ char fSwizzle[5];
+ };
+
+ typedef SkTArray<TextureSampler> TextureSamplerArray;
GrGLEffect(const GrBackendEffectFactory& factory)
: fFactory(factory)

Powered by Google App Engine
This is Rietveld 408576698