Index: include/gpu/gl/GrGLExtensions.h |
diff --git a/include/gpu/gl/GrGLExtensions.h b/include/gpu/gl/GrGLExtensions.h |
index 45f698ef29dfac0384453c0e4401e31f087d489e..ca7b43fc6c8d0224bfe8709f67c0a944908cc025 100644 |
--- a/include/gpu/gl/GrGLExtensions.h |
+++ b/include/gpu/gl/GrGLExtensions.h |
@@ -8,23 +8,33 @@ |
#ifndef GrGLExtensions_DEFINED |
#define GrGLExtensions_DEFINED |
-#include "GrGLInterface.h" |
+#include "GrGLFunctions.h" |
#include "SkString.h" |
#include "SkTArray.h" |
+struct GrGLInterface; |
+ |
/** |
* This helper queries the current GL context for its extensions, remembers them, and can be |
* queried. It supports both glGetString- and glGetStringi-style extension string APIs and will |
* use the latter if it is available. |
*/ |
-class GrGLExtensions { |
+class GrGLExtensions : public SkNoncopyable { |
public: |
robertphillips
2014/01/16 17:13:11
delete this?
bsalomon
2014/01/16 18:28:45
Done.
|
+#if 0 |
bool init(const GrGLInterface* iface) { |
return this->init(iface->fStandard, |
iface->fGetString, |
iface->fGetStringi, |
iface->fGetIntegerv); |
} |
+#endif |
+ GrGLExtensions() : fStrings(SkNEW(SkTArray<SkString>)), fInitialized(false) {} |
+ |
+ void swap(GrGLExtensions* that) { |
+ fStrings.swap(&that->fStrings); |
+ } |
+ |
/** |
* We sometimes need to use this class without having yet created a GrGLInterface. This version |
* of init expects that getString is always non-NULL while getIntegerv and getStringi are non- |
@@ -35,17 +45,20 @@ public: |
GrGLGetStringiProc getStringi, |
GrGLGetIntegervProc getIntegerv); |
+ bool isInitialized() const { return fInitialized; } |
+ |
/** |
* Queries whether an extension is present. This will fail if init() has not been called. |
*/ |
bool has(const char*) const; |
- void reset() { fStrings.reset(); } |
+ void reset() { fStrings->reset(); } |
void print(const char* sep = "\n") const; |
private: |
- SkTArray<SkString> fStrings; |
+ bool fInitialized; |
+ SkAutoTDelete<SkTArray<SkString> > fStrings; |
}; |
#endif |