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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLEffect.h ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLSL.h" 8 #include "GrGLSL.h"
9 #include "GrGLEffect.h" 9 #include "GrGLEffect.h"
10 10
(...skipping 13 matching lines...) Expand all
24 const GrGLCaps& caps) { 24 const GrGLCaps& caps) {
25 EffectKey key = 0; 25 EffectKey key = 0;
26 for (int index = 0; index < (*effect)->numTextures(); ++index) { 26 for (int index = 0; index < (*effect)->numTextures(); ++index) {
27 const GrTextureAccess& access = (*effect)->textureAccess(index); 27 const GrTextureAccess& access = (*effect)->textureAccess(index);
28 EffectKey value = GrGLShaderBuilder::KeyForTextureAccess(access, caps) < < index; 28 EffectKey value = GrGLShaderBuilder::KeyForTextureAccess(access, caps) < < index;
29 GrAssert(0 == (value & key)); // keys for each access ought not to overl ap 29 GrAssert(0 == (value & key)); // keys for each access ought not to overl ap
30 key |= value; 30 key |= value;
31 } 31 }
32 return key; 32 return key;
33 } 33 }
34
35 GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrEffectStage& stage) {
36 EffectKey key = 0;
37
38 int numAttributes = stage.getVertexAttribIndexCount();
39 GrAssert(numAttributes <= 2);
40 const int* attributeIndices = stage.getVertexAttribIndices();
41 for (int index = 0; index < numAttributes; ++index) {
42 EffectKey value = attributeIndices[index] << 2*index;
43 GrAssert(0 == (value & key)); // keys for each attribute ought not to ov erlap
44 key |= value;
45 }
46
47 return key;
48 }
OLDNEW
« 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