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

Side by Side Diff: include/gpu/gl/GrGLExtensions.h

Issue 133073009: Move GrGLInterface function pointers into a nested struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: tip of tree Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | include/gpu/gl/GrGLInterface.h » ('j') | include/gpu/gl/GrGLInterface.h » ('J')
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 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 : public SkNoncopyable { 22 class GrGLExtensions : public SkNoncopyable {
23 public: 23 public:
24
25 GrGLExtensions() : fInitialized(false), fStrings(SkNEW(SkTArray<SkString>)) {} 24 GrGLExtensions() : fInitialized(false), fStrings(SkNEW(SkTArray<SkString>)) {}
26 25
27 void swap(GrGLExtensions* that) { 26 void swap(GrGLExtensions* that) {
28 fStrings.swap(&that->fStrings); 27 fStrings.swap(&that->fStrings);
29 } 28 }
30 29
31 /** 30 /**
32 * We sometimes need to use this class without having yet created a GrGLInte rface. This version 31 * We sometimes need to use this class without having yet created a GrGLInte rface. This version
33 * of init expects that getString is always non-NULL while getIntegerv and g etStringi are non- 32 * of init expects that getString is always non-NULL while getIntegerv and g etStringi are non-
34 * NULL if on desktop GL with version 3.0 or higher. Otherwise it will fail. 33 * NULL if on desktop GL with version 3.0 or higher. Otherwise it will fail.
(...skipping 13 matching lines...) Expand all
48 void reset() { fStrings->reset(); } 47 void reset() { fStrings->reset(); }
49 48
50 void print(const char* sep = "\n") const; 49 void print(const char* sep = "\n") const;
51 50
52 private: 51 private:
53 bool fInitialized; 52 bool fInitialized;
54 SkAutoTDelete<SkTArray<SkString> > fStrings; 53 SkAutoTDelete<SkTArray<SkString> > fStrings;
55 }; 54 };
56 55
57 #endif 56 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/gl/GrGLInterface.h » ('j') | include/gpu/gl/GrGLInterface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698