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

Unified Diff: include/gpu/GrBackendEffectFactory.h

Issue 24853002: Make GPU coord transforms automatic (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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
Index: include/gpu/GrBackendEffectFactory.h
diff --git a/include/gpu/GrBackendEffectFactory.h b/include/gpu/GrBackendEffectFactory.h
index 77cf2cc13d4c05fd307c528a9aa124261996a5b0..48efa290f58e372f90a3e04ea5b3922fc5483742 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 transfors and texture accesses in their
jvanverth1 2013/09/27 20:41:35 Typo: transfors
Chris Dalton 2013/09/27 23:33:45 Done.
+ * effect's EffectKey, so effects don't need to account for them in GenKey().
*/
- kTextureKeyBits = 6,
- kAttribKeyBits = 6
+ kTextureKeyBits = 5,
+ kTransformKeyBits = 6,
+ kAttribKeyBits = 6,
+ kClassIDBits = 5
};
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') | include/gpu/GrCoordTransform.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698