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

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: rebase 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
« no previous file with comments | « src/gpu/effects/GrYUVtoRGBEffect.cpp ('k') | 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/GrGLEffect.h
diff --git a/src/gpu/gl/GrGLEffect.h b/src/gpu/gl/GrGLEffect.h
index 24c20c6d57367468a7bf8e0af0be940ab97cc3cc..61e3ed8e534f55655a9a056ccf0402f3aebafc5e 100644
--- a/src/gpu/gl/GrGLEffect.h
+++ b/src/gpu/gl/GrGLEffect.h
@@ -34,11 +34,41 @@ 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.
+ */
+ typedef GrShaderVar TransformedCoords;
+ typedef SkTArray<GrShaderVar> 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);
+ }
+
+ // bitfield of GrColorComponentFlags present in the texture's config.
+ uint32_t configComponentMask() const { return fConfigComponentMask; }
+ // this is .abcd
+ const char* swizzle() const { return fSwizzle; }
+
+ private:
+ UniformHandle fSamplerUniform;
+ uint32_t fConfigComponentMask;
+ char fSwizzle[5];
+
+ friend class GrGLShaderBuilder;
+ };
+
+ typedef SkTArray<TextureSampler> TextureSamplerArray;
GrGLEffect(const GrBackendEffectFactory& factory)
: fFactory(factory)
« no previous file with comments | « src/gpu/effects/GrYUVtoRGBEffect.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698