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

Side by Side Diff: src/gpu/gl/GrGLVertexArray.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/GrGLVertexArray.h ('k') | src/gpu/gl/GrGLVertexBuffer.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 2013 Google Inc. 2 * Copyright 2013 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 "GrGLVertexArray.h" 8 #include "GrGLVertexArray.h"
9 #include "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 10
11 #define GPUGL static_cast<GrGpuGL*>(this->getGpu()) 11 #define GPUGL static_cast<GrGpuGL*>(this->getGpu())
12 #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X); 12 #define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X);
13 13
14 void GrGLAttribArrayState::set(const GrGpuGL* gpu, 14 void GrGLAttribArrayState::set(const GrGpuGL* gpu,
15 int index, 15 int index,
16 GrGLVertexBuffer* buffer, 16 GrGLVertexBuffer* buffer,
17 GrGLint size, 17 GrGLint size,
18 GrGLenum type, 18 GrGLenum type,
19 GrGLboolean normalized, 19 GrGLboolean normalized,
20 GrGLsizei stride, 20 GrGLsizei stride,
21 GrGLvoid* offset) { 21 GrGLvoid* offset) {
22 GrAssert(index >= 0 && index < fAttribArrayStates.count()); 22 SkASSERT(index >= 0 && index < fAttribArrayStates.count());
23 AttribArrayState* array = &fAttribArrayStates[index]; 23 AttribArrayState* array = &fAttribArrayStates[index];
24 if (!array->fEnableIsValid || !array->fEnabled) { 24 if (!array->fEnableIsValid || !array->fEnabled) {
25 GR_GL_CALL(gpu->glInterface(), EnableVertexAttribArray(index)); 25 GR_GL_CALL(gpu->glInterface(), EnableVertexAttribArray(index));
26 array->fEnableIsValid = true; 26 array->fEnableIsValid = true;
27 array->fEnabled = true; 27 array->fEnabled = true;
28 } 28 }
29 if (!array->fAttribPointerIsValid || 29 if (!array->fAttribPointerIsValid ||
30 array->fVertexBufferID != buffer->bufferID() || 30 array->fVertexBufferID != buffer->bufferID() ||
31 array->fSize != size || 31 array->fSize != size ||
32 array->fNormalized != normalized || 32 array->fNormalized != normalized ||
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 114 }
115 } 115 }
116 116
117 void GrGLVertexArray::invalidateCachedState() { 117 void GrGLVertexArray::invalidateCachedState() {
118 int count = fAttribArrays.count(); 118 int count = fAttribArrays.count();
119 for (int i = 0; i < count; ++i) { 119 for (int i = 0; i < count; ++i) {
120 fAttribArrays.invalidate(); 120 fAttribArrays.invalidate();
121 } 121 }
122 fIndexBufferIDIsValid = false; 122 fIndexBufferIDIsValid = false;
123 } 123 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLVertexArray.h ('k') | src/gpu/gl/GrGLVertexBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698