| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 GrGLRenderer renderer() const { return fRenderer; } | 50 GrGLRenderer renderer() const { return fRenderer; } |
| 51 /** Is this a mesa-based driver. Does not mean it is the osmesa software ras
terizer. */ | 51 /** Is this a mesa-based driver. Does not mean it is the osmesa software ras
terizer. */ |
| 52 bool isMesa() const { return fIsMesa; } | 52 bool isMesa() const { return fIsMesa; } |
| 53 /** Are we running inside Chromium (using the command buffer)? */ |
| 54 bool isChromium() const { return fIsChromium; } |
| 53 const GrGLCaps* caps() const { return fGLCaps.get(); } | 55 const GrGLCaps* caps() const { return fGLCaps.get(); } |
| 54 GrGLCaps* caps() { return fGLCaps; } | 56 GrGLCaps* caps() { return fGLCaps; } |
| 55 const GrGLExtensions& extensions() const { return fExtensions; } | 57 const GrGLExtensions& extensions() const { return fExtensions; } |
| 56 | 58 |
| 57 /** | 59 /** |
| 58 * Shortcut for extensions().has(ext); | 60 * Shortcut for extensions().has(ext); |
| 59 */ | 61 */ |
| 60 bool hasExtension(const char* ext) const { | 62 bool hasExtension(const char* ext) const { |
| 61 if (!this->isInitialized()) { | 63 if (!this->isInitialized()) { |
| 62 return false; | 64 return false; |
| 63 } | 65 } |
| 64 return fExtensions.has(ext); | 66 return fExtensions.has(ext); |
| 65 } | 67 } |
| 66 | 68 |
| 67 /** | 69 /** |
| 68 * Reset the information | 70 * Reset the information |
| 69 */ | 71 */ |
| 70 void reset(); | 72 void reset(); |
| 71 | 73 |
| 72 private: | 74 private: |
| 73 | 75 |
| 74 GrGLBinding fBindingInUse; | 76 GrGLBinding fBindingInUse; |
| 75 GrGLVersion fGLVersion; | 77 GrGLVersion fGLVersion; |
| 76 GrGLSLGeneration fGLSLGeneration; | 78 GrGLSLGeneration fGLSLGeneration; |
| 77 GrGLVendor fVendor; | 79 GrGLVendor fVendor; |
| 78 GrGLRenderer fRenderer; | 80 GrGLRenderer fRenderer; |
| 79 GrGLExtensions fExtensions; | 81 GrGLExtensions fExtensions; |
| 80 bool fIsMesa; | 82 bool fIsMesa; |
| 83 bool fIsChromium; |
| 81 SkAutoTUnref<GrGLCaps> fGLCaps; | 84 SkAutoTUnref<GrGLCaps> fGLCaps; |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 /** | 87 /** |
| 85 * Encapsulates the GrGLInterface used to make GL calls plus information | 88 * Encapsulates the GrGLInterface used to make GL calls plus information |
| 86 * about the context (via GrGLContextInfo). | 89 * about the context (via GrGLContextInfo). |
| 87 */ | 90 */ |
| 88 class GrGLContext { | 91 class GrGLContext { |
| 89 public: | 92 public: |
| 90 /** | 93 /** |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 GrGLContextInfo& info() { return fInfo; } | 125 GrGLContextInfo& info() { return fInfo; } |
| 123 | 126 |
| 124 private: | 127 private: |
| 125 void reset(); | 128 void reset(); |
| 126 | 129 |
| 127 const GrGLInterface* fInterface; | 130 const GrGLInterface* fInterface; |
| 128 GrGLContextInfo fInfo; | 131 GrGLContextInfo fInfo; |
| 129 }; | 132 }; |
| 130 | 133 |
| 131 #endif | 134 #endif |
| OLD | NEW |