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

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

Issue 12462008: Add GrEllipseEdgeEffect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: rebase again 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
« no previous file with comments | « src/gpu/gl/GrGLEffect.h ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLEffect.cpp
===================================================================
--- src/gpu/gl/GrGLEffect.cpp (revision 8091)
+++ 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;
+}
« no previous file with comments | « src/gpu/gl/GrGLEffect.h ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698