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

Unified Diff: include/gpu/GrTBackendEffectFactory.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 | « include/gpu/GrEffect.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTBackendEffectFactory.h
diff --git a/include/gpu/GrTBackendEffectFactory.h b/include/gpu/GrTBackendEffectFactory.h
index 1a01e1c274c21badd04ecca10c276bc4fa53a559..9528f8a367c851891efe17d9f79a4855ebf3467d 100644
--- a/include/gpu/GrTBackendEffectFactory.h
+++ b/include/gpu/GrTBackendEffectFactory.h
@@ -35,19 +35,29 @@ public:
SkASSERT(kIllegalEffectClassID != fEffectClassID);
EffectKey effectKey = GLEffect::GenKey(drawEffect, caps);
EffectKey textureKey = GLEffect::GenTextureKey(drawEffect, caps);
+ EffectKey transformKey = GLEffect::GenTransformKey(drawEffect);
EffectKey attribKey = GLEffect::GenAttribKey(drawEffect);
#ifdef SK_DEBUG
- static const EffectKey kIllegalIDMask = (uint16_t) (~((1U << kEffectKeyBits) - 1));
- SkASSERT(!(kIllegalIDMask & effectKey));
+ static const EffectKey kIllegalEffectKeyMask = (uint16_t) (~((1U << kEffectKeyBits) - 1));
+ SkASSERT(!(kIllegalEffectKeyMask & effectKey));
static const EffectKey kIllegalTextureKeyMask = (uint16_t) (~((1U << kTextureKeyBits) - 1));
SkASSERT(!(kIllegalTextureKeyMask & textureKey));
+ static const EffectKey kIllegalTransformKeyMask = (uint16_t) (~((1U << kTransformKeyBits) - 1));
+ SkASSERT(!(kIllegalTransformKeyMask & transformKey));
+
static const EffectKey kIllegalAttribKeyMask = (uint16_t) (~((1U << kAttribKeyBits) - 1));
SkASSERT(!(kIllegalAttribKeyMask & textureKey));
+
+ static const EffectKey kIllegalClassIDMask = (uint16_t) (~((1U << kClassIDBits) - 1));
+ SkASSERT(!(kIllegalClassIDMask & fEffectClassID));
#endif
- return fEffectClassID | (attribKey << (kEffectKeyBits+kTextureKeyBits)) |
- (textureKey << kEffectKeyBits) | effectKey;
+ return (fEffectClassID << (kEffectKeyBits+kTextureKeyBits+kTransformKeyBits+kAttribKeyBits)) |
+ (attribKey << (kEffectKeyBits+kTextureKeyBits+kTransformKeyBits)) |
+ (transformKey << (kEffectKeyBits+kTextureKeyBits)) |
+ (textureKey << kEffectKeyBits) |
+ (effectKey);
}
/** Returns a new instance of the appropriate *GL* implementation class
@@ -71,7 +81,7 @@ public:
protected:
GrTBackendEffectFactory() {
- fEffectClassID = GenID() << (kAttribKeyBits + kEffectKeyBits + kTextureKeyBits) ;
+ fEffectClassID = GenID();
}
};
« no previous file with comments | « include/gpu/GrEffect.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698