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

Side by Side Diff: src/gpu/gl/GrGLBufferImpl.h

Issue 1534123003: More framework support for TransferBuffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address more comments Created 4 years, 11 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/GrTest.cpp ('k') | src/gpu/gl/GrGLGpu.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 #ifndef GrGLBufferImpl_DEFINED 8 #ifndef GrGLBufferImpl_DEFINED
9 #define GrGLBufferImpl_DEFINED 9 #define GrGLBufferImpl_DEFINED
10 10
(...skipping 28 matching lines...) Expand all
39 ~GrGLBufferImpl() { 39 ~GrGLBufferImpl() {
40 // either release or abandon should have been called by the owner of thi s object. 40 // either release or abandon should have been called by the owner of thi s object.
41 SkASSERT(0 == fDesc.fID); 41 SkASSERT(0 == fDesc.fID);
42 } 42 }
43 43
44 void abandon(); 44 void abandon();
45 void release(GrGLGpu* gpu); 45 void release(GrGLGpu* gpu);
46 46
47 GrGLuint bufferID() const { return fDesc.fID; } 47 GrGLuint bufferID() const { return fDesc.fID; }
48 size_t baseOffset() const { return reinterpret_cast<size_t>(fCPUData); } 48 size_t baseOffset() const { return reinterpret_cast<size_t>(fCPUData); }
49 GrGLenum bufferType() const { return fBufferType; }
49 50
50 void* map(GrGLGpu* gpu); 51 void* map(GrGLGpu* gpu);
51 void unmap(GrGLGpu* gpu); 52 void unmap(GrGLGpu* gpu);
52 bool isMapped() const; 53 bool isMapped() const;
53 bool updateData(GrGLGpu* gpu, const void* src, size_t srcSizeInBytes); 54 bool updateData(GrGLGpu* gpu, const void* src, size_t srcSizeInBytes);
54 55
55 private: 56 private:
56 void validate() const; 57 void validate() const;
57 58
58 Desc fDesc; 59 Desc fDesc;
59 GrGLenum fBufferType; // GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER 60 GrGLenum fBufferType; // GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER, e.g .
60 void* fCPUData; 61 void* fCPUData;
61 void* fMapPtr; 62 void* fMapPtr;
62 size_t fGLSizeInBytes; // In certain cases we make the size of the GL buffer object 63 size_t fGLSizeInBytes; // In certain cases we make the size of the GL buffer object
63 // smaller or larger than the size in fDesc . 64 // smaller or larger than the size in fDesc .
64 65
65 typedef SkNoncopyable INHERITED; 66 typedef SkNoncopyable INHERITED;
66 }; 67 };
67 68
68 #endif 69 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTest.cpp ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698