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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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
« no previous file with comments | « src/gpu/gl/GrGLUtil.cpp ('k') | src/gpu/gl/GrGpuGL.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
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 GrGLAttribArrayState* GrGLVertexArray::bind() { 93 GrGLAttribArrayState* GrGLVertexArray::bind() {
94 if (0 == fID) { 94 if (0 == fID) {
95 return NULL; 95 return NULL;
96 } 96 }
97 GPUGL->bindVertexArray(fID); 97 GPUGL->bindVertexArray(fID);
98 return &fAttribArrays; 98 return &fAttribArrays;
99 } 99 }
100 100
101 GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(const GrGLIndexBuffer * buffer) { 101 GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(const GrGLIndexBuffer * buffer) {
102 GrGLAttribArrayState* state = this->bind(); 102 GrGLAttribArrayState* state = this->bind();
103 if (NULL != state && NULL != buffer) { 103 if (state && buffer) {
104 GrGLuint bufferID = buffer->bufferID(); 104 GrGLuint bufferID = buffer->bufferID();
105 if (!fIndexBufferIDIsValid || bufferID != fIndexBufferID) { 105 if (!fIndexBufferIDIsValid || bufferID != fIndexBufferID) {
106 GL_CALL(BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, bufferID)); 106 GL_CALL(BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, bufferID));
107 fIndexBufferIDIsValid = true; 107 fIndexBufferIDIsValid = true;
108 fIndexBufferID = bufferID; 108 fIndexBufferID = bufferID;
109 } 109 }
110 } 110 }
111 return state; 111 return state;
112 } 112 }
113 113
114 void GrGLVertexArray::notifyIndexBufferDelete(GrGLuint bufferID) { 114 void GrGLVertexArray::notifyIndexBufferDelete(GrGLuint bufferID) {
115 if (fIndexBufferIDIsValid && bufferID == fIndexBufferID) { 115 if (fIndexBufferIDIsValid && bufferID == fIndexBufferID) {
116 fIndexBufferID = 0; 116 fIndexBufferID = 0;
117 } 117 }
118 } 118 }
119 119
120 void GrGLVertexArray::invalidateCachedState() { 120 void GrGLVertexArray::invalidateCachedState() {
121 fAttribArrays.invalidate(); 121 fAttribArrays.invalidate();
122 fIndexBufferIDIsValid = false; 122 fIndexBufferIDIsValid = false;
123 } 123 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLUtil.cpp ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698