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

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

Issue 12462008: Add GrEllipseEdgeEffect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Add dynamic vertex attributes for Effects Created 7 years, 9 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: src/gpu/gl/GrGLEffect.cpp
===================================================================
--- src/gpu/gl/GrGLEffect.cpp (revision 8019)
+++ src/gpu/gl/GrGLEffect.cpp (working copy)
@@ -31,3 +31,18 @@
}
return key;
}
+
+GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrEffectStage& stage) {
+ EffectKey key = 0;
+
+ int numAttributes = stage.getVertexAttribIndexCount();
+ GrAssert(numAttributes <= 2);
+ const int* attributeIndices = stage.getVertexAttribIndices();
+ for (int index = 0; index < numAttributes; ++index) {
+ EffectKey value = attributeIndices[index] << 2*index;
+ GrAssert(0 == (value & key)); // keys for each attribute ought not to overlap
+ key |= value;
+ }
+
+ return key;
+}

Powered by Google App Engine
This is Rietveld 408576698