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 | 8 |
9 #ifndef GrGLContext_DEFINED | 9 #ifndef GrGLContext_DEFINED |
10 #define GrGLContext_DEFINED | 10 #define GrGLContext_DEFINED |
(...skipping 29 matching lines...) Expand all Loading... |
40 * Initializes a GrGLContextInfo from a GrGLInterface and the currently | 40 * Initializes a GrGLContextInfo from a GrGLInterface and the currently |
41 * bound OpenGL context accessible by the GrGLInterface. | 41 * bound OpenGL context accessible by the GrGLInterface. |
42 */ | 42 */ |
43 bool initialize(const GrGLInterface* interface); | 43 bool initialize(const GrGLInterface* interface); |
44 bool isInitialized() const; | 44 bool isInitialized() const; |
45 | 45 |
46 GrGLBinding binding() const { return fBindingInUse; } | 46 GrGLBinding binding() const { return fBindingInUse; } |
47 GrGLVersion version() const { return fGLVersion; } | 47 GrGLVersion version() const { return fGLVersion; } |
48 GrGLSLGeneration glslGeneration() const { return fGLSLGeneration; } | 48 GrGLSLGeneration glslGeneration() const { return fGLSLGeneration; } |
49 GrGLVendor vendor() const { return fVendor; } | 49 GrGLVendor vendor() const { return fVendor; } |
| 50 /** Is this a mesa-based driver. Does not mean it is the osmesa software ras
terizer. */ |
| 51 bool isMesa() const { return fIsMesa; } |
50 const GrGLCaps* caps() const { return fGLCaps.get(); } | 52 const GrGLCaps* caps() const { return fGLCaps.get(); } |
51 GrGLCaps* caps() { return fGLCaps; } | 53 GrGLCaps* caps() { return fGLCaps; } |
52 const GrGLExtensions& extensions() const { return fExtensions; } | 54 const GrGLExtensions& extensions() const { return fExtensions; } |
53 | 55 |
54 /** | 56 /** |
55 * Shortcut for extensions().has(ext); | 57 * Shortcut for extensions().has(ext); |
56 */ | 58 */ |
57 bool hasExtension(const char* ext) const { | 59 bool hasExtension(const char* ext) const { |
58 if (!this->isInitialized()) { | 60 if (!this->isInitialized()) { |
59 return false; | 61 return false; |
60 } | 62 } |
61 return fExtensions.has(ext); | 63 return fExtensions.has(ext); |
62 } | 64 } |
63 | 65 |
64 /** | 66 /** |
65 * Reset the information | 67 * Reset the information |
66 */ | 68 */ |
67 void reset(); | 69 void reset(); |
68 | 70 |
69 private: | 71 private: |
70 | 72 |
71 GrGLBinding fBindingInUse; | 73 GrGLBinding fBindingInUse; |
72 GrGLVersion fGLVersion; | 74 GrGLVersion fGLVersion; |
73 GrGLSLGeneration fGLSLGeneration; | 75 GrGLSLGeneration fGLSLGeneration; |
74 GrGLVendor fVendor; | 76 GrGLVendor fVendor; |
75 GrGLExtensions fExtensions; | 77 GrGLExtensions fExtensions; |
| 78 bool fIsMesa; |
76 SkAutoTUnref<GrGLCaps> fGLCaps; | 79 SkAutoTUnref<GrGLCaps> fGLCaps; |
77 }; | 80 }; |
78 | 81 |
79 /** | 82 /** |
80 * Encapsulates the GrGLInterface used to make GL calls plus information | 83 * Encapsulates the GrGLInterface used to make GL calls plus information |
81 * about the context (via GrGLContextInfo). | 84 * about the context (via GrGLContextInfo). |
82 */ | 85 */ |
83 class GrGLContext { | 86 class GrGLContext { |
84 public: | 87 public: |
85 /** | 88 /** |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 GrGLContextInfo& info() { return fInfo; } | 120 GrGLContextInfo& info() { return fInfo; } |
118 | 121 |
119 private: | 122 private: |
120 void reset(); | 123 void reset(); |
121 | 124 |
122 const GrGLInterface* fInterface; | 125 const GrGLInterface* fInterface; |
123 GrGLContextInfo fInfo; | 126 GrGLContextInfo fInfo; |
124 }; | 127 }; |
125 | 128 |
126 #endif | 129 #endif |
OLD | NEW |