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