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

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

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 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/GrGLVertexArray.h ('k') | src/gpu/gl/GrGLVertexBuffer.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 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 "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 //////////////////////////////////////////////////////////////////////////////// /////////////////// 68 //////////////////////////////////////////////////////////////////////////////// ///////////////////
69 69
70 GrGLVertexArray::GrGLVertexArray(GrGLint id, int attribCount) 70 GrGLVertexArray::GrGLVertexArray(GrGLint id, int attribCount)
71 : fID(id) 71 : fID(id)
72 , fAttribArrays(attribCount) 72 , fAttribArrays(attribCount)
73 , fIndexBufferIDIsValid(false) { 73 , fIndexBufferIDIsValid(false) {
74 } 74 }
75 75
76 GrGLAttribArrayState* GrGLVertexArray::bind(GrGLGpu* gpu) { 76 GrGLAttribArrayState* GrGLVertexArray::bind(GrGLGpu* gpu) {
77 if (0 == fID) { 77 if (0 == fID) {
78 return NULL; 78 return nullptr;
79 } 79 }
80 gpu->bindVertexArray(fID); 80 gpu->bindVertexArray(fID);
81 return &fAttribArrays; 81 return &fAttribArrays;
82 } 82 }
83 83
84 GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(GrGLGpu* gpu, GrGLuin t ibufferID) { 84 GrGLAttribArrayState* GrGLVertexArray::bindWithIndexBuffer(GrGLGpu* gpu, GrGLuin t ibufferID) {
85 GrGLAttribArrayState* state = this->bind(gpu); 85 GrGLAttribArrayState* state = this->bind(gpu);
86 if (state) { 86 if (state) {
87 if (!fIndexBufferIDIsValid || ibufferID != fIndexBufferID) { 87 if (!fIndexBufferIDIsValid || ibufferID != fIndexBufferID) {
88 GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER , ibufferID)); 88 GR_GL_CALL(gpu->glInterface(), BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER , ibufferID));
89 fIndexBufferIDIsValid = true; 89 fIndexBufferIDIsValid = true;
90 fIndexBufferID = ibufferID; 90 fIndexBufferID = ibufferID;
91 } 91 }
92 } 92 }
93 return state; 93 return state;
94 } 94 }
95 95
96 void GrGLVertexArray::notifyIndexBufferDelete(GrGLuint bufferID) { 96 void GrGLVertexArray::notifyIndexBufferDelete(GrGLuint bufferID) {
97 if (fIndexBufferIDIsValid && bufferID == fIndexBufferID) { 97 if (fIndexBufferIDIsValid && bufferID == fIndexBufferID) {
98 fIndexBufferID = 0; 98 fIndexBufferID = 0;
99 } 99 }
100 } 100 }
101 101
102 void GrGLVertexArray::invalidateCachedState() { 102 void GrGLVertexArray::invalidateCachedState() {
103 fAttribArrays.invalidate(); 103 fAttribArrays.invalidate();
104 fIndexBufferIDIsValid = false; 104 fIndexBufferIDIsValid = false;
105 } 105 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLVertexArray.h ('k') | src/gpu/gl/GrGLVertexBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698