| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef GrGLInterface_DEFINED | 10 #ifndef GrGLInterface_DEFINED |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 * GrContext uses the following interface to make all calls into OpenGL. When a | 103 * GrContext uses the following interface to make all calls into OpenGL. When a |
| 104 * GrContext is created it is given a GrGLInterface. The interface's function | 104 * GrContext is created it is given a GrGLInterface. The interface's function |
| 105 * pointers must be valid for the OpenGL context associated with the GrContext. | 105 * pointers must be valid for the OpenGL context associated with the GrContext. |
| 106 * On some platforms, such as Windows, function pointers for OpenGL extensions | 106 * On some platforms, such as Windows, function pointers for OpenGL extensions |
| 107 * may vary between OpenGL contexts. So the caller must be careful to use a | 107 * may vary between OpenGL contexts. So the caller must be careful to use a |
| 108 * GrGLInterface initialized for the correct context. All functions that should | 108 * GrGLInterface initialized for the correct context. All functions that should |
| 109 * be available based on the OpenGL's version and extension string must be | 109 * be available based on the OpenGL's version and extension string must be |
| 110 * non-NULL or GrContext creation will fail. This can be tested with the | 110 * non-NULL or GrContext creation will fail. This can be tested with the |
| 111 * validate() method when the OpenGL context has been made current. | 111 * validate() method when the OpenGL context has been made current. |
| 112 */ | 112 */ |
| 113 struct GR_API GrGLInterface : public GrRefCnt { | 113 struct SK_API GrGLInterface : public GrRefCnt { |
| 114 private: | 114 private: |
| 115 // simple wrapper class that exists only to initialize a pointer to NULL | 115 // simple wrapper class that exists only to initialize a pointer to NULL |
| 116 template <typename FNPTR_TYPE> class GLPtr { | 116 template <typename FNPTR_TYPE> class GLPtr { |
| 117 public: | 117 public: |
| 118 GLPtr() : fPtr(NULL) {} | 118 GLPtr() : fPtr(NULL) {} |
| 119 GLPtr operator =(FNPTR_TYPE ptr) { fPtr = ptr; return *this; } | 119 GLPtr operator =(FNPTR_TYPE ptr) { fPtr = ptr; return *this; } |
| 120 operator FNPTR_TYPE() const { return fPtr; } | 120 operator FNPTR_TYPE() const { return fPtr; } |
| 121 private: | 121 private: |
| 122 FNPTR_TYPE fPtr; | 122 FNPTR_TYPE fPtr; |
| 123 }; | 123 }; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 // Per-GL func callback | 324 // Per-GL func callback |
| 325 #if GR_GL_PER_GL_FUNC_CALLBACK | 325 #if GR_GL_PER_GL_FUNC_CALLBACK |
| 326 GrGLInterfaceCallbackProc fCallback; | 326 GrGLInterfaceCallbackProc fCallback; |
| 327 GrGLInterfaceCallbackData fCallbackData; | 327 GrGLInterfaceCallbackData fCallbackData; |
| 328 #endif | 328 #endif |
| 329 | 329 |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 #endif | 332 #endif |
| OLD | NEW |