OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 | 8 |
9 #ifndef GrGLContextInfo_DEFINED | 9 #ifndef GrGLContextInfo_DEFINED |
10 #define GrGLContextInfo_DEFINED | 10 #define GrGLContextInfo_DEFINED |
11 | 11 |
| 12 #include "gl/GrGLExtensions.h" |
12 #include "gl/GrGLInterface.h" | 13 #include "gl/GrGLInterface.h" |
13 #include "GrGLCaps.h" | 14 #include "GrGLCaps.h" |
14 #include "GrGLSL.h" | 15 #include "GrGLSL.h" |
15 #include "GrGLUtil.h" | 16 #include "GrGLUtil.h" |
16 | 17 |
17 #include "SkString.h" | 18 #include "SkString.h" |
18 | 19 |
19 /** | 20 /** |
20 * Encapsulates information about an OpenGL context including the GrGLInterface | 21 * Encapsulates information about an OpenGL context including the GrGLInterface |
21 * used to make GL calls, the OpenGL version, the GrGLBinding type of the | 22 * used to make GL calls, the OpenGL version, the GrGLBinding type of the |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 GrGLCaps& caps() { return fGLCaps; } | 64 GrGLCaps& caps() { return fGLCaps; } |
64 | 65 |
65 /** | 66 /** |
66 * Checks for extension support using a cached copy of the GL_EXTENSIONS | 67 * Checks for extension support using a cached copy of the GL_EXTENSIONS |
67 * string. | 68 * string. |
68 */ | 69 */ |
69 bool hasExtension(const char* ext) const { | 70 bool hasExtension(const char* ext) const { |
70 if (!this->isInitialized()) { | 71 if (!this->isInitialized()) { |
71 return false; | 72 return false; |
72 } | 73 } |
73 return GrGLHasExtensionFromString(ext, fExtensionString.c_str()); | 74 return fExtensions.has(ext); |
74 } | 75 } |
75 | 76 |
76 private: | 77 private: |
77 void reset(); | 78 void reset(); |
78 | 79 |
79 const GrGLInterface* fInterface; | 80 const GrGLInterface* fInterface; |
80 GrGLBinding fBindingInUse; | 81 GrGLBinding fBindingInUse; |
81 GrGLVersion fGLVersion; | 82 GrGLVersion fGLVersion; |
82 GrGLSLGeneration fGLSLGeneration; | 83 GrGLSLGeneration fGLSLGeneration; |
83 GrGLVendor fVendor; | 84 GrGLVendor fVendor; |
84 SkString fExtensionString; | 85 GrGLExtensions fExtensions; |
85 GrGLCaps fGLCaps; | 86 GrGLCaps fGLCaps; |
86 }; | 87 }; |
87 | 88 |
88 #endif | 89 #endif |
OLD | NEW |