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

Side by Side Diff: src/gpu/gl/GrGLEffect.cpp

Issue 22850006: Replace uses of GrAssert by SkASSERT. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 4 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/GrGLCreateNullInterface.cpp ('k') | src/gpu/gl/GrGLEffectMatrix.h » ('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 #include "GrDrawEffect.h" 10 #include "GrDrawEffect.h"
(...skipping 10 matching lines...) Expand all
21 void GrGLEffect::setData(const GrGLUniformManager&, const GrDrawEffect&) { 21 void GrGLEffect::setData(const GrGLUniformManager&, const GrDrawEffect&) {
22 } 22 }
23 23
24 GrGLEffect::EffectKey GrGLEffect::GenTextureKey(const GrDrawEffect& drawEffect, 24 GrGLEffect::EffectKey GrGLEffect::GenTextureKey(const GrDrawEffect& drawEffect,
25 const GrGLCaps& caps) { 25 const GrGLCaps& caps) {
26 EffectKey key = 0; 26 EffectKey key = 0;
27 int numTextures = (*drawEffect.effect())->numTextures(); 27 int numTextures = (*drawEffect.effect())->numTextures();
28 for (int index = 0; index < numTextures; ++index) { 28 for (int index = 0; index < numTextures; ++index) {
29 const GrTextureAccess& access = (*drawEffect.effect())->textureAccess(in dex); 29 const GrTextureAccess& access = (*drawEffect.effect())->textureAccess(in dex);
30 EffectKey value = GrGLShaderBuilder::KeyForTextureAccess(access, caps) < < index; 30 EffectKey value = GrGLShaderBuilder::KeyForTextureAccess(access, caps) < < index;
31 GrAssert(0 == (value & key)); // keys for each access ought not to overl ap 31 SkASSERT(0 == (value & key)); // keys for each access ought not to overl ap
32 key |= value; 32 key |= value;
33 } 33 }
34 return key; 34 return key;
35 } 35 }
36 36
37 GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrDrawEffect& drawEffect) { 37 GrGLEffect::EffectKey GrGLEffect::GenAttribKey(const GrDrawEffect& drawEffect) {
38 EffectKey key = 0; 38 EffectKey key = 0;
39 39
40 int numAttributes = drawEffect.getVertexAttribIndexCount(); 40 int numAttributes = drawEffect.getVertexAttribIndexCount();
41 GrAssert(numAttributes <= 2); 41 SkASSERT(numAttributes <= 2);
42 const int* attributeIndices = drawEffect.getVertexAttribIndices(); 42 const int* attributeIndices = drawEffect.getVertexAttribIndices();
43 for (int index = 0; index < numAttributes; ++index) { 43 for (int index = 0; index < numAttributes; ++index) {
44 EffectKey value = attributeIndices[index] << 3*index; 44 EffectKey value = attributeIndices[index] << 3*index;
45 GrAssert(0 == (value & key)); // keys for each attribute ought not to ov erlap 45 SkASSERT(0 == (value & key)); // keys for each attribute ought not to ov erlap
46 key |= value; 46 key |= value;
47 } 47 }
48 48
49 return key; 49 return key;
50 } 50 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCreateNullInterface.cpp ('k') | src/gpu/gl/GrGLEffectMatrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698