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 #ifndef GrGLExtensions_DEFINED | 8 #ifndef GrGLExtensions_DEFINED |
9 #define GrGLExtensions_DEFINED | 9 #define GrGLExtensions_DEFINED |
10 | 10 |
11 #include "GrGLFunctions.h" | 11 #include "GrGLFunctions.h" |
12 #include "SkString.h" | 12 #include "SkString.h" |
13 #include "SkTArray.h" | 13 #include "SkTArray.h" |
14 | 14 |
15 struct GrGLInterface; | 15 struct GrGLInterface; |
16 | 16 |
17 /** | 17 /** |
18 * This helper queries the current GL context for its extensions, remembers them
, and can be | 18 * This helper queries the current GL context for its extensions, remembers them
, and can be |
19 * queried. It supports both glGetString- and glGetStringi-style extension strin
g APIs and will | 19 * queried. It supports both glGetString- and glGetStringi-style extension strin
g APIs and will |
20 * use the latter if it is available. | 20 * use the latter if it is available. |
21 */ | 21 */ |
22 class GrGLExtensions { | 22 class SK_API GrGLExtensions { |
23 public: | 23 public: |
24 GrGLExtensions() : fInitialized(false), fStrings(SkNEW(SkTArray<SkString>))
{} | 24 GrGLExtensions() : fInitialized(false), fStrings(SkNEW(SkTArray<SkString>))
{} |
25 | 25 |
26 GrGLExtensions(const GrGLExtensions&); | 26 GrGLExtensions(const GrGLExtensions&); |
27 | 27 |
28 GrGLExtensions& operator=(const GrGLExtensions&); | 28 GrGLExtensions& operator=(const GrGLExtensions&); |
29 | 29 |
30 void swap(GrGLExtensions* that) { | 30 void swap(GrGLExtensions* that) { |
31 fStrings.swap(&that->fStrings); | 31 fStrings.swap(&that->fStrings); |
32 SkTSwap(fInitialized, that->fInitialized); | 32 SkTSwap(fInitialized, that->fInitialized); |
(...skipping 29 matching lines...) Expand all Loading... |
62 void reset() { fStrings->reset(); } | 62 void reset() { fStrings->reset(); } |
63 | 63 |
64 void print(const char* sep = "\n") const; | 64 void print(const char* sep = "\n") const; |
65 | 65 |
66 private: | 66 private: |
67 bool fInitialized; | 67 bool fInitialized; |
68 SkAutoTDelete<SkTArray<SkString> > fStrings; | 68 SkAutoTDelete<SkTArray<SkString> > fStrings; |
69 }; | 69 }; |
70 | 70 |
71 #endif | 71 #endif |
OLD | NEW |