| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef GrGLInterface_DEFINED | 8 #ifndef GrGLInterface_DEFINED |
| 9 #define GrGLInterface_DEFINED | 9 #define GrGLInterface_DEFINED |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 * Creates a debugging GrGLInterface that doesn't draw anything. Used for | 65 * Creates a debugging GrGLInterface that doesn't draw anything. Used for |
| 66 * finding memory leaks and invalid memory accesses. | 66 * finding memory leaks and invalid memory accesses. |
| 67 */ | 67 */ |
| 68 const GrGLInterface* GrGLCreateDebugInterface(); | 68 const GrGLInterface* GrGLCreateDebugInterface(); |
| 69 | 69 |
| 70 #if GR_GL_PER_GL_FUNC_CALLBACK | 70 #if GR_GL_PER_GL_FUNC_CALLBACK |
| 71 typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*); | 71 typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*); |
| 72 typedef intptr_t GrGLInterfaceCallbackData; | 72 typedef intptr_t GrGLInterfaceCallbackData; |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 /* | 75 /** Function that returns a new interface identical to "interface" but without s
upport for |
| 76 GL_NV_path_rendering. */ |
| 77 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface*); |
| 78 |
| 79 /** |
| 76 * GrContext uses the following interface to make all calls into OpenGL. When a | 80 * GrContext uses the following interface to make all calls into OpenGL. When a |
| 77 * GrContext is created it is given a GrGLInterface. The interface's function | 81 * GrContext is created it is given a GrGLInterface. The interface's function |
| 78 * pointers must be valid for the OpenGL context associated with the GrContext. | 82 * pointers must be valid for the OpenGL context associated with the GrContext. |
| 79 * On some platforms, such as Windows, function pointers for OpenGL extensions | 83 * On some platforms, such as Windows, function pointers for OpenGL extensions |
| 80 * may vary between OpenGL contexts. So the caller must be careful to use a | 84 * may vary between OpenGL contexts. So the caller must be careful to use a |
| 81 * GrGLInterface initialized for the correct context. All functions that should | 85 * GrGLInterface initialized for the correct context. All functions that should |
| 82 * be available based on the OpenGL's version and extension string must be | 86 * be available based on the OpenGL's version and extension string must be |
| 83 * non-NULL or GrContext creation will fail. This can be tested with the | 87 * non-NULL or GrContext creation will fail. This can be tested with the |
| 84 * validate() method when the OpenGL context has been made current. | 88 * validate() method when the OpenGL context has been made current. |
| 85 */ | 89 */ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 105 GLPtr<FNPTR_TYPE>* fBase; | 109 GLPtr<FNPTR_TYPE>* fBase; |
| 106 }; | 110 }; |
| 107 | 111 |
| 108 typedef SkRefCnt INHERITED; | 112 typedef SkRefCnt INHERITED; |
| 109 | 113 |
| 110 public: | 114 public: |
| 111 SK_DECLARE_INST_COUNT(GrGLInterface) | 115 SK_DECLARE_INST_COUNT(GrGLInterface) |
| 112 | 116 |
| 113 GrGLInterface(); | 117 GrGLInterface(); |
| 114 | 118 |
| 119 static GrGLInterface* NewClone(const GrGLInterface*); |
| 120 |
| 115 // Validates that the GrGLInterface supports its advertised standard. This m
eans the necessary | 121 // Validates that the GrGLInterface supports its advertised standard. This m
eans the necessary |
| 116 // function pointers have been initialized for both the GL version and any a
dvertised | 122 // function pointers have been initialized for both the GL version and any a
dvertised |
| 117 // extensions. | 123 // extensions. |
| 118 bool validate() const; | 124 bool validate() const; |
| 119 | 125 |
| 120 // Indicates the type of GL implementation | 126 // Indicates the type of GL implementation |
| 121 union { | 127 union { |
| 122 GrGLStandard fStandard; | 128 GrGLStandard fStandard; |
| 123 GrGLStandard fBindingsExported; // Legacy name, will be remove when Chro
mium is updated. | 129 GrGLStandard fBindingsExported; // Legacy name, will be remove when Chro
mium is updated. |
| 124 }; | 130 }; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 GLPtr<GrGLGetPathColorGenivProc> fGetPathColorGeniv; | 357 GLPtr<GrGLGetPathColorGenivProc> fGetPathColorGeniv; |
| 352 GLPtr<GrGLGetPathColorGenfvProc> fGetPathColorGenfv; | 358 GLPtr<GrGLGetPathColorGenfvProc> fGetPathColorGenfv; |
| 353 GLPtr<GrGLGetPathTexGenivProc> fGetPathTexGeniv; | 359 GLPtr<GrGLGetPathTexGenivProc> fGetPathTexGeniv; |
| 354 GLPtr<GrGLGetPathTexGenfvProc> fGetPathTexGenfv; | 360 GLPtr<GrGLGetPathTexGenfvProc> fGetPathTexGenfv; |
| 355 GLPtr<GrGLIsPointInFillPathProc> fIsPointInFillPath; | 361 GLPtr<GrGLIsPointInFillPathProc> fIsPointInFillPath; |
| 356 GLPtr<GrGLIsPointInStrokePathProc> fIsPointInStrokePath; | 362 GLPtr<GrGLIsPointInStrokePathProc> fIsPointInStrokePath; |
| 357 GLPtr<GrGLGetPathLengthProc> fGetPathLength; | 363 GLPtr<GrGLGetPathLengthProc> fGetPathLength; |
| 358 GLPtr<GrGLPointAlongPathProc> fPointAlongPath; | 364 GLPtr<GrGLPointAlongPathProc> fPointAlongPath; |
| 359 } fFunctions; | 365 } fFunctions; |
| 360 | 366 |
| 361 | |
| 362 // Temporary workaround aliases to keep Chromium GrGLInterface factories com
piling until they | 367 // Temporary workaround aliases to keep Chromium GrGLInterface factories com
piling until they |
| 363 // assign the members of fFunctions. | 368 // assign the members of fFunctions. |
| 364 GLPtrAlias<GrGLActiveTextureProc> fActiveTexture; | 369 GLPtrAlias<GrGLActiveTextureProc> fActiveTexture; |
| 365 GLPtrAlias<GrGLAttachShaderProc> fAttachShader; | 370 GLPtrAlias<GrGLAttachShaderProc> fAttachShader; |
| 366 GLPtrAlias<GrGLBeginQueryProc> fBeginQuery; | 371 GLPtrAlias<GrGLBeginQueryProc> fBeginQuery; |
| 367 GLPtrAlias<GrGLBindAttribLocationProc> fBindAttribLocation; | 372 GLPtrAlias<GrGLBindAttribLocationProc> fBindAttribLocation; |
| 368 GLPtrAlias<GrGLBindBufferProc> fBindBuffer; | 373 GLPtrAlias<GrGLBindBufferProc> fBindBuffer; |
| 369 GLPtrAlias<GrGLBindFragDataLocationProc> fBindFragDataLocation; | 374 GLPtrAlias<GrGLBindFragDataLocationProc> fBindFragDataLocation; |
| 370 GLPtrAlias<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed
; | 375 GLPtrAlias<GrGLBindFragDataLocationIndexedProc> fBindFragDataLocationIndexed
; |
| 371 GLPtrAlias<GrGLBindFramebufferProc> fBindFramebuffer; | 376 GLPtrAlias<GrGLBindFramebufferProc> fBindFramebuffer; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 555 |
| 551 // Per-GL func callback | 556 // Per-GL func callback |
| 552 #if GR_GL_PER_GL_FUNC_CALLBACK | 557 #if GR_GL_PER_GL_FUNC_CALLBACK |
| 553 GrGLInterfaceCallbackProc fCallback; | 558 GrGLInterfaceCallbackProc fCallback; |
| 554 GrGLInterfaceCallbackData fCallbackData; | 559 GrGLInterfaceCallbackData fCallbackData; |
| 555 #endif | 560 #endif |
| 556 | 561 |
| 557 }; | 562 }; |
| 558 | 563 |
| 559 #endif | 564 #endif |
| OLD | NEW |