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

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

Issue 808593003: Rename GrGpuGL to GrGLGpu for consistency (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years 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/GrTraceMarker.cpp ('k') | src/gpu/gl/GrGLBufferImpl.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 #ifndef GrGLBufferImpl_DEFINED 8 #ifndef GrGLBufferImpl_DEFINED
9 #define GrGLBufferImpl_DEFINED 9 #define GrGLBufferImpl_DEFINED
10 10
11 #include "SkTypes.h" 11 #include "SkTypes.h"
12 #include "gl/GrGLFunctions.h" 12 #include "gl/GrGLFunctions.h"
13 13
14 class GrGpuGL; 14 class GrGLGpu;
15 15
16 /** 16 /**
17 * This class serves as the implementation of GrGL*Buffer classes. It was writte n to avoid code 17 * This class serves as the implementation of GrGL*Buffer classes. It was writte n to avoid code
18 * duplication in those classes. 18 * duplication in those classes.
19 */ 19 */
20 class GrGLBufferImpl : SkNoncopyable { 20 class GrGLBufferImpl : SkNoncopyable {
21 public: 21 public:
22 struct Desc { 22 struct Desc {
23 bool fIsWrapped; 23 bool fIsWrapped;
24 GrGLuint fID; // set to 0 to indicate buffer is CPU-backed and not a VBO. 24 GrGLuint fID; // set to 0 to indicate buffer is CPU-backed and not a VBO.
25 size_t fSizeInBytes; 25 size_t fSizeInBytes;
26 bool fDynamic; 26 bool fDynamic;
27 }; 27 };
28 28
29 GrGLBufferImpl(GrGpuGL*, const Desc&, GrGLenum bufferType); 29 GrGLBufferImpl(GrGLGpu*, const Desc&, GrGLenum bufferType);
30 ~GrGLBufferImpl() { 30 ~GrGLBufferImpl() {
31 // either release or abandon should have been called by the owner of thi s object. 31 // either release or abandon should have been called by the owner of thi s object.
32 SkASSERT(0 == fDesc.fID); 32 SkASSERT(0 == fDesc.fID);
33 } 33 }
34 34
35 void abandon(); 35 void abandon();
36 void release(GrGpuGL* gpu); 36 void release(GrGLGpu* gpu);
37 37
38 GrGLuint bufferID() const { return fDesc.fID; } 38 GrGLuint bufferID() const { return fDesc.fID; }
39 size_t baseOffset() const { return reinterpret_cast<size_t>(fCPUData); } 39 size_t baseOffset() const { return reinterpret_cast<size_t>(fCPUData); }
40 40
41 void bind(GrGpuGL* gpu) const; 41 void bind(GrGLGpu* gpu) const;
42 42
43 void* map(GrGpuGL* gpu); 43 void* map(GrGLGpu* gpu);
44 void unmap(GrGpuGL* gpu); 44 void unmap(GrGLGpu* gpu);
45 bool isMapped() const; 45 bool isMapped() const;
46 bool updateData(GrGpuGL* gpu, const void* src, size_t srcSizeInBytes); 46 bool updateData(GrGLGpu* gpu, const void* src, size_t srcSizeInBytes);
47 47
48 private: 48 private:
49 void validate() const; 49 void validate() const;
50 50
51 Desc fDesc; 51 Desc fDesc;
52 GrGLenum fBufferType; // GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER 52 GrGLenum fBufferType; // GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER
53 void* fCPUData; 53 void* fCPUData;
54 void* fMapPtr; 54 void* fMapPtr;
55 size_t fGLSizeInBytes; // In certain cases we make the size of the GL buffer object 55 size_t fGLSizeInBytes; // In certain cases we make the size of the GL buffer object
56 // smaller or larger than the size in fDesc . 56 // smaller or larger than the size in fDesc .
57 57
58 typedef SkNoncopyable INHERITED; 58 typedef SkNoncopyable INHERITED;
59 }; 59 };
60 60
61 #endif 61 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTraceMarker.cpp ('k') | src/gpu/gl/GrGLBufferImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698