OLD | NEW |
---|---|
(Empty) | |
1 | |
2 /* | |
3 * Copyright 2014 Google Inc. | |
4 * | |
5 * Use of this source code is governed by a BSD-style license that can be | |
6 * found in the LICENSE file. | |
7 */ | |
8 | |
9 #ifndef GrGLNameAllocator_DEFINED | |
10 #define GrGLNameAllocator_DEFINED | |
11 | |
12 #include "SkRefCnt.h" | |
13 #include "gl/GrGLFunctions.h" | |
bsalomon
2014/05/30 18:09:11
Is this for the GrGL data types?
Chris Dalton
2014/05/30 21:39:41
Yeah - GrGLuint. Would you prefer to use a more ge
bsalomon
2014/06/02 15:14:43
I was mostly just curious. But maybe we could sepa
| |
14 | |
15 /** | |
16 * This class takes ownership of a range of OpenGL object names and manages | |
17 * allocations within that range. This allows the app to generate new objects | |
18 * on the client side without having to make round trips to the GL server. | |
19 */ | |
20 | |
21 class GrGLNameAllocator { | |
22 class SparseNameRange; | |
bsalomon
2014/05/30 18:09:11
Can you move these down to the explicit private se
| |
23 class SparseNameTree; | |
24 class ContiguousNameRange; | |
25 | |
26 public: | |
27 GrGLNameAllocator(GrGLuint names, GrGLuint range); | |
28 ~GrGLNameAllocator(); | |
29 | |
30 GrGLuint names() const { return fNames; } | |
bsalomon
2014/05/30 18:09:11
some docs here would useful
| |
31 GrGLuint range() const { return fRange; } | |
32 | |
33 GrGLuint allocateName(); | |
34 void freeName(GrGLuint name); | |
35 | |
36 private: | |
37 const GrGLuint fNames; | |
38 const GrGLuint fRange; | |
39 SkAutoTUnref<SparseNameRange> fAllocatedNames; | |
40 }; | |
41 | |
42 #endif | |
OLD | NEW |