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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 /** Function that returns a new interface identical to "interface" but without s upport for | 75 /** Function that returns a new interface identical to "interface" but without s upport for |
76 GL_NV_path_rendering. */ | 76 GL_NV_path_rendering. */ |
77 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface*); | 77 const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface*); |
78 | 78 |
79 /** Function that returns a new interface identical to "interface" but with supp ort for | |
80 test version of GL_EXT_debug_marker. */ | |
81 const GrGLInterface* GrGLInterfaceAddTestDebugMarker(const GrGLInterface*); | |
bsalomon
2014/02/20 22:14:13
I think this might prove generally useful... perha
| |
82 | |
79 /** | 83 /** |
80 * GrContext uses the following interface to make all calls into OpenGL. When a | 84 * GrContext uses the following interface to make all calls into OpenGL. When a |
81 * GrContext is created it is given a GrGLInterface. The interface's function | 85 * GrContext is created it is given a GrGLInterface. The interface's function |
82 * pointers must be valid for the OpenGL context associated with the GrContext. | 86 * pointers must be valid for the OpenGL context associated with the GrContext. |
83 * On some platforms, such as Windows, function pointers for OpenGL extensions | 87 * On some platforms, such as Windows, function pointers for OpenGL extensions |
84 * may vary between OpenGL contexts. So the caller must be careful to use a | 88 * may vary between OpenGL contexts. So the caller must be careful to use a |
85 * GrGLInterface initialized for the correct context. All functions that should | 89 * GrGLInterface initialized for the correct context. All functions that should |
86 * be available based on the OpenGL's version and extension string must be | 90 * be available based on the OpenGL's version and extension string must be |
87 * non-NULL or GrContext creation will fail. This can be tested with the | 91 * non-NULL or GrContext creation will fail. This can be tested with the |
88 * validate() method when the OpenGL context has been made current. | 92 * validate() method when the OpenGL context has been made current. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 GLPtr<GrGLGetQueryivProc> fGetQueryiv; | 225 GLPtr<GrGLGetQueryivProc> fGetQueryiv; |
222 GLPtr<GrGLGetProgramInfoLogProc> fGetProgramInfoLog; | 226 GLPtr<GrGLGetProgramInfoLogProc> fGetProgramInfoLog; |
223 GLPtr<GrGLGetProgramivProc> fGetProgramiv; | 227 GLPtr<GrGLGetProgramivProc> fGetProgramiv; |
224 GLPtr<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv; | 228 GLPtr<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv; |
225 GLPtr<GrGLGetShaderInfoLogProc> fGetShaderInfoLog; | 229 GLPtr<GrGLGetShaderInfoLogProc> fGetShaderInfoLog; |
226 GLPtr<GrGLGetShaderivProc> fGetShaderiv; | 230 GLPtr<GrGLGetShaderivProc> fGetShaderiv; |
227 GLPtr<GrGLGetStringProc> fGetString; | 231 GLPtr<GrGLGetStringProc> fGetString; |
228 GLPtr<GrGLGetStringiProc> fGetStringi; | 232 GLPtr<GrGLGetStringiProc> fGetStringi; |
229 GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv; | 233 GLPtr<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv; |
230 GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation; | 234 GLPtr<GrGLGetUniformLocationProc> fGetUniformLocation; |
235 GLPtr<GrGLInsertEventMarkerProc> fInsertEventMarker; | |
231 GLPtr<GrGLLineWidthProc> fLineWidth; | 236 GLPtr<GrGLLineWidthProc> fLineWidth; |
232 GLPtr<GrGLLinkProgramProc> fLinkProgram; | 237 GLPtr<GrGLLinkProgramProc> fLinkProgram; |
233 GLPtr<GrGLLoadIdentityProc> fLoadIdentity; | 238 GLPtr<GrGLLoadIdentityProc> fLoadIdentity; |
234 GLPtr<GrGLLoadMatrixfProc> fLoadMatrixf; | 239 GLPtr<GrGLLoadMatrixfProc> fLoadMatrixf; |
235 GLPtr<GrGLMapBufferProc> fMapBuffer; | 240 GLPtr<GrGLMapBufferProc> fMapBuffer; |
236 GLPtr<GrGLMatrixModeProc> fMatrixMode; | 241 GLPtr<GrGLMatrixModeProc> fMatrixMode; |
237 GLPtr<GrGLPixelStoreiProc> fPixelStorei; | 242 GLPtr<GrGLPixelStoreiProc> fPixelStorei; |
243 GLPtr<GrGLPopGroupMarkerProc> fPopGroupMarker; | |
244 GLPtr<GrGLPushGroupMarkerProc> fPushGroupMarker; | |
238 GLPtr<GrGLQueryCounterProc> fQueryCounter; | 245 GLPtr<GrGLQueryCounterProc> fQueryCounter; |
239 GLPtr<GrGLReadBufferProc> fReadBuffer; | 246 GLPtr<GrGLReadBufferProc> fReadBuffer; |
240 GLPtr<GrGLReadPixelsProc> fReadPixels; | 247 GLPtr<GrGLReadPixelsProc> fReadPixels; |
241 GLPtr<GrGLRenderbufferStorageProc> fRenderbufferStorage; | 248 GLPtr<GrGLRenderbufferStorageProc> fRenderbufferStorage; |
242 | 249 |
243 // On OpenGL ES there are multiple incompatible extensions that add sup port for MSAA | 250 // On OpenGL ES there are multiple incompatible extensions that add sup port for MSAA |
244 // and ES3 adds MSAA support to the standard. On an ES3 driver we may s till use the | 251 // and ES3 adds MSAA support to the standard. On an ES3 driver we may s till use the |
245 // older extensions for performance reasons or due to ES3 driver bugs. We want the function | 252 // older extensions for performance reasons or due to ES3 driver bugs. We want the function |
246 // that creates the GrGLInterface to provide all available functions an d internally | 253 // that creates the GrGLInterface to provide all available functions an d internally |
247 // we will select among them. They all have a method called glRenderbuf ferStorageMultisample*. | 254 // we will select among them. They all have a method called glRenderbuf ferStorageMultisample*. |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 GLPtrAlias<GrGLGetQueryivProc> fGetQueryiv; | 445 GLPtrAlias<GrGLGetQueryivProc> fGetQueryiv; |
439 GLPtrAlias<GrGLGetProgramInfoLogProc> fGetProgramInfoLog; | 446 GLPtrAlias<GrGLGetProgramInfoLogProc> fGetProgramInfoLog; |
440 GLPtrAlias<GrGLGetProgramivProc> fGetProgramiv; | 447 GLPtrAlias<GrGLGetProgramivProc> fGetProgramiv; |
441 GLPtrAlias<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv; | 448 GLPtrAlias<GrGLGetRenderbufferParameterivProc> fGetRenderbufferParameteriv; |
442 GLPtrAlias<GrGLGetShaderInfoLogProc> fGetShaderInfoLog; | 449 GLPtrAlias<GrGLGetShaderInfoLogProc> fGetShaderInfoLog; |
443 GLPtrAlias<GrGLGetShaderivProc> fGetShaderiv; | 450 GLPtrAlias<GrGLGetShaderivProc> fGetShaderiv; |
444 GLPtrAlias<GrGLGetStringProc> fGetString; | 451 GLPtrAlias<GrGLGetStringProc> fGetString; |
445 GLPtrAlias<GrGLGetStringiProc> fGetStringi; | 452 GLPtrAlias<GrGLGetStringiProc> fGetStringi; |
446 GLPtrAlias<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv; | 453 GLPtrAlias<GrGLGetTexLevelParameterivProc> fGetTexLevelParameteriv; |
447 GLPtrAlias<GrGLGetUniformLocationProc> fGetUniformLocation; | 454 GLPtrAlias<GrGLGetUniformLocationProc> fGetUniformLocation; |
455 GLPtrAlias<GrGLInsertEventMarkerProc> fInsertEventMarker; | |
448 GLPtrAlias<GrGLLineWidthProc> fLineWidth; | 456 GLPtrAlias<GrGLLineWidthProc> fLineWidth; |
449 GLPtrAlias<GrGLLinkProgramProc> fLinkProgram; | 457 GLPtrAlias<GrGLLinkProgramProc> fLinkProgram; |
450 GLPtrAlias<GrGLLoadIdentityProc> fLoadIdentity; | 458 GLPtrAlias<GrGLLoadIdentityProc> fLoadIdentity; |
451 GLPtrAlias<GrGLLoadMatrixfProc> fLoadMatrixf; | 459 GLPtrAlias<GrGLLoadMatrixfProc> fLoadMatrixf; |
452 GLPtrAlias<GrGLMapBufferProc> fMapBuffer; | 460 GLPtrAlias<GrGLMapBufferProc> fMapBuffer; |
453 GLPtrAlias<GrGLMatrixModeProc> fMatrixMode; | 461 GLPtrAlias<GrGLMatrixModeProc> fMatrixMode; |
454 GLPtrAlias<GrGLPixelStoreiProc> fPixelStorei; | 462 GLPtrAlias<GrGLPixelStoreiProc> fPixelStorei; |
463 GLPtrAlias<GrGLPopGroupMarkerProc> fPopGroupMarker; | |
464 GLPtrAlias<GrGLPushGroupMarkerProc> fPushGroupMarker; | |
455 GLPtrAlias<GrGLQueryCounterProc> fQueryCounter; | 465 GLPtrAlias<GrGLQueryCounterProc> fQueryCounter; |
456 GLPtrAlias<GrGLReadBufferProc> fReadBuffer; | 466 GLPtrAlias<GrGLReadBufferProc> fReadBuffer; |
457 GLPtrAlias<GrGLReadPixelsProc> fReadPixels; | 467 GLPtrAlias<GrGLReadPixelsProc> fReadPixels; |
458 GLPtrAlias<GrGLRenderbufferStorageProc> fRenderbufferStorage; | 468 GLPtrAlias<GrGLRenderbufferStorageProc> fRenderbufferStorage; |
459 GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMulti sampleES2EXT; | 469 GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMulti sampleES2EXT; |
460 GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMulti sampleES2APPLE; | 470 GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMulti sampleES2APPLE; |
461 GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMulti sample; | 471 GLPtrAlias<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMulti sample; |
462 GLPtrAlias<GrGLBindUniformLocation> fBindUniformLocation; | 472 GLPtrAlias<GrGLBindUniformLocation> fBindUniformLocation; |
463 GLPtrAlias<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebu ffer; | 473 GLPtrAlias<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebu ffer; |
464 GLPtrAlias<GrGLScissorProc> fScissor; | 474 GLPtrAlias<GrGLScissorProc> fScissor; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
555 | 565 |
556 // Per-GL func callback | 566 // Per-GL func callback |
557 #if GR_GL_PER_GL_FUNC_CALLBACK | 567 #if GR_GL_PER_GL_FUNC_CALLBACK |
558 GrGLInterfaceCallbackProc fCallback; | 568 GrGLInterfaceCallbackProc fCallback; |
559 GrGLInterfaceCallbackData fCallbackData; | 569 GrGLInterfaceCallbackData fCallbackData; |
560 #endif | 570 #endif |
561 | 571 |
562 }; | 572 }; |
563 | 573 |
564 #endif | 574 #endif |
OLD | NEW |