| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 #ifndef SkGLContext_DEFINED | 8 #ifndef SkGLContext_DEFINED |
| 9 #define SkGLContext_DEFINED | 9 #define SkGLContext_DEFINED |
| 10 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 * context with which to share display lists. This should be a pointer to an SkG
LContext created | 124 * context with which to share display lists. This should be a pointer to an SkG
LContext created |
| 125 * with SkCreatePlatformGLContext. NULL indicates that no sharing is to take pl
ace. Returns a valid | 125 * with SkCreatePlatformGLContext. NULL indicates that no sharing is to take pl
ace. Returns a valid |
| 126 * gl context object or NULL if such can not be created. | 126 * gl context object or NULL if such can not be created. |
| 127 * Note: If Skia embedder needs a custom GL context that sets up the GL interfac
e, this function | 127 * Note: If Skia embedder needs a custom GL context that sets up the GL interfac
e, this function |
| 128 * should be implemented by the embedder. Otherwise, the default implementation
for the platform | 128 * should be implemented by the embedder. Otherwise, the default implementation
for the platform |
| 129 * should be compiled in the library. | 129 * should be compiled in the library. |
| 130 */ | 130 */ |
| 131 SK_API SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, | 131 SK_API SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, |
| 132 SkGLContext* shareContext = nullpt
r); | 132 SkGLContext* shareContext = nullpt
r); |
| 133 | 133 |
| 134 /** Destroys any GL related thread global state that may have been created due |
| 135 * to calls to SkCreatePlatformGLContext. |
| 136 */ |
| 137 SK_API void SkReleasePlatformGLAPIsInThread(); |
| 138 |
| 134 /** | 139 /** |
| 135 * Helper macros for using the GL context through the GrGLInterface. Example: | 140 * Helper macros for using the GL context through the GrGLInterface. Example: |
| 136 * SK_GL(glCtx, GenTextures(1, &texID)); | 141 * SK_GL(glCtx, GenTextures(1, &texID)); |
| 137 */ | 142 */ |
| 138 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ | 143 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ |
| 139 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) | 144 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
| 140 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ | 145 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ |
| 141 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) | 146 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
| 142 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X | 147 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X |
| 143 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X | 148 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X |
| 144 | 149 |
| 145 #endif | 150 #endif |
| OLD | NEW |