2 * Copyright 2011 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef GrGLVertexBuffer_DEFINED
9 #define GrGLVertexBuffer_DEFINED
11 #include "GrVertexBuffer.h"
12 #include "GrGLBufferImpl.h"
13 #include "gl/GrGLInterface.h"
17 class GrGLVertexBuffer : public GrVertexBuffer {
20 typedef GrGLBufferImpl::Desc Desc;
22 GrGLVertexBuffer(GrGLGpu* gpu, const Desc& desc);
24 GrGLuint bufferID() const { return fImpl.bufferID(); }
25 size_t baseOffset() const { return fImpl.baseOffset(); }
28 if (!this->wasDestroyed()) {
29 fImpl.bind(this->getGpuGL());
34 void onAbandon() SK_OVERRIDE;
35 void onRelease() SK_OVERRIDE;
38 void* onMap() SK_OVERRIDE;
39 void onUnmap() SK_OVERRIDE;
40 bool onUpdateData(const void* src, size_t srcSizeInBytes) SK_OVERRIDE;
42 GrGLGpu* getGpuGL() const {
43 SkASSERT(!this->wasDestroyed());
44 return (GrGLGpu*)(this->getGpu());
49 typedef GrVertexBuffer INHERITED;