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

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

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/GrGLEffect.h ('k') | src/gpu/gl/GrGLEffectMatrix.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLEffect.cpp
diff --git a/src/gpu/gl/GrGLEffect.cpp b/src/gpu/gl/GrGLEffect.cpp
index 28be7afb345396188de0569646161590ee36b417..af351a47fe41f435ab5c9b57483dd5ad5ecaee6e 100644
--- a/src/gpu/gl/GrGLEffect.cpp
+++ b/src/gpu/gl/GrGLEffect.cpp
@@ -7,6 +7,7 @@
#include "GrGLSL.h"
#include "GrGLEffect.h"
+#include "GrCoordTransform.h"
#include "GrDrawEffect.h"
GrGLEffect::GrGLEffect(const GrBackendEffectFactory& factory)
@@ -34,6 +35,18 @@ GrGLEffect::EffectKey GrGLEffect::GenTextureKey(const GrDrawEffect& drawEffect,
return key;
}
+GrGLEffect::EffectKey GrGLEffect::GenTransformKey(const GrDrawEffect& drawEffect) {
+ EffectKey key = 0;
+ int numTransforms = (*drawEffect.effect())->numTransforms();
+ for (int index = 0; index < numTransforms; ++index) {
+ EffectKey value = GrGLCoordTransform::GenKey(drawEffect, index);
+ value <<= index * GrGLCoordTransform::kKeyBits;
+ SkASSERT(0 == (value & key)); // keys for each transform ought not to overlap
+ key |= value;
+ }
+ return key;
+}
+
GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrDrawEffect& drawEffect) {
EffectKey key = 0;
« no previous file with comments | « src/gpu/gl/GrGLEffect.h ('k') | src/gpu/gl/GrGLEffectMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698