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

Unified Diff: include/gpu/GrBackendEffectFactory.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 | « gyp/gpu.gypi ('k') | include/gpu/GrCoordTransform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrBackendEffectFactory.h
diff --git a/include/gpu/GrBackendEffectFactory.h b/include/gpu/GrBackendEffectFactory.h
index 6f5cb3b437ade60064d889113b188c8ead2f60b7..b3f52fbb04a0adef2ca91dba587a0b01f41b65d2 100644
--- a/include/gpu/GrBackendEffectFactory.h
+++ b/include/gpu/GrBackendEffectFactory.h
@@ -33,15 +33,15 @@ public:
typedef uint32_t EffectKey;
enum {
kNoEffectKey = 0,
- kEffectKeyBits = 15,
+ kEffectKeyBits = 10,
/**
- * Some aspects of the generated code may be determined by the particular textures that are
- * associated with the effect. These manipulations are performed by GrGLShaderBuilder beyond
- * GrGLEffects' control. So there is a dedicated part of the key which is combined
- * automatically with the bits produced by GrGLEffect::GenKey().
+ * The framework automatically includes coord transforms and texture accesses in their
+ * effect's EffectKey, so effects don't need to account for them in GenKey().
*/
kTextureKeyBits = 4,
- kAttribKeyBits = 6
+ kTransformKeyBits = 6,
+ kAttribKeyBits = 6,
+ kClassIDBits = 6
};
virtual EffectKey glEffectKey(const GrDrawEffect&, const GrGLCaps&) const = 0;
@@ -56,6 +56,10 @@ public:
virtual const char* name() const = 0;
+ static EffectKey GetTransformKey(EffectKey key) {
+ return key >> (kEffectKeyBits + kTextureKeyBits) & ((1U << kTransformKeyBits) - 1);
+ }
+
protected:
enum {
kIllegalEffectClassID = 0,
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrCoordTransform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698