OLD | NEW |
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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 69 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
70 | 70 |
71 GrGLVertexArray::GrGLVertexArray(GrGpuGL* gpu, GrGLint id, int attribCount) | 71 GrGLVertexArray::GrGLVertexArray(GrGpuGL* gpu, GrGLint id, int attribCount) |
72 : INHERITED(gpu, false) | 72 : INHERITED(gpu, false) |
73 , fID(id) | 73 , fID(id) |
74 , fAttribArrays(attribCount) | 74 , fAttribArrays(attribCount) |
75 , fIndexBufferIDIsValid(false) { | 75 , fIndexBufferIDIsValid(false) { |
76 this->registerWithCache(); | |
77 } | 76 } |
78 | 77 |
79 void GrGLVertexArray::onAbandon() { | 78 void GrGLVertexArray::onAbandon() { |
80 fID = 0; | 79 fID = 0; |
81 INHERITED::onAbandon(); | 80 INHERITED::onAbandon(); |
82 } | 81 } |
83 | 82 |
84 void GrGLVertexArray::onRelease() { | 83 void GrGLVertexArray::onRelease() { |
85 if (0 != fID) { | 84 if (0 != fID) { |
86 GL_CALL(DeleteVertexArrays(1, &fID)); | 85 GL_CALL(DeleteVertexArrays(1, &fID)); |
(...skipping 27 matching lines...) Expand all Loading... |
114 void GrGLVertexArray::notifyIndexBufferDelete(GrGLuint bufferID) { | 113 void GrGLVertexArray::notifyIndexBufferDelete(GrGLuint bufferID) { |
115 if (fIndexBufferIDIsValid && bufferID == fIndexBufferID) { | 114 if (fIndexBufferIDIsValid && bufferID == fIndexBufferID) { |
116 fIndexBufferID = 0; | 115 fIndexBufferID = 0; |
117 } | 116 } |
118 } | 117 } |
119 | 118 |
120 void GrGLVertexArray::invalidateCachedState() { | 119 void GrGLVertexArray::invalidateCachedState() { |
121 fAttribArrays.invalidate(); | 120 fAttribArrays.invalidate(); |
122 fIndexBufferIDIsValid = false; | 121 fIndexBufferIDIsValid = false; |
123 } | 122 } |
OLD | NEW |