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

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

Issue 24853002: Make GPU coord transforms automatic (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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/gl/GrGLCoordTransform.cpp ('k') | src/gpu/gl/GrGLEffect.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 5df22811c4c60dfef25794d2294ad49117a60a05..d3c49d11cf76d4af80ef19cd01764e910a53df68 100644
--- a/src/gpu/gl/GrGLEffect.h
+++ b/src/gpu/gl/GrGLEffect.h
@@ -18,8 +18,8 @@ class GrGLTexture;
/** @file
This file contains specializations for OpenGL of the shader stages declared in
include/gpu/GrEffect.h. Objects of type GrGLEffect are responsible for emitting the
- GLSL code that implements a GrEffect and for uploading uniforms at draw time. They also
- must have a function:
+ GLSL code that implements a GrEffect and for uploading uniforms at draw time. If they don't
+ always emit the same GLSL code, they must have a function:
static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&)
that is used to implement a program cache. When two GrEffects produce the same key this means
that their GrGLEffects would emit the same GLSL code.
@@ -45,6 +45,7 @@ public:
kEffectKeyBits = GrBackendEffectFactory::kEffectKeyBits,
};
+ typedef GrGLShaderBuilder::TransformedCoordsArray TransformedCoordsArray;
typedef GrGLShaderBuilder::TextureSamplerArray TextureSamplerArray;
GrGLEffect(const GrBackendEffectFactory&);
@@ -76,6 +77,7 @@ public:
EffectKey key,
const char* outputColor,
const char* inputColor,
+ const TransformedCoordsArray& coords,
const TextureSamplerArray& samplers) = 0;
/** A GrGLEffect instance can be reused with any GrEffect that produces the same stage
@@ -89,7 +91,10 @@ public:
const char* name() const { return fFactory.name(); }
+ static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&) { return 0; }
+
static EffectKey GenTextureKey(const GrDrawEffect&, const GrGLCaps&);
+ static EffectKey GenTransformKey(const GrDrawEffect&);
static EffectKey GenAttribKey(const GrDrawEffect& stage);
protected:
« no previous file with comments | « src/gpu/gl/GrGLCoordTransform.cpp ('k') | src/gpu/gl/GrGLEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698