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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 SkPlatformGpuFence fFrameFences[kMaxFrameLag - 1]; | 106 SkPlatformGpuFence fFrameFences[kMaxFrameLag - 1]; |
107 int fCurrentFenceIdx; | 107 int fCurrentFenceIdx; |
108 | 108 |
109 /** Subclass provides the gl interface object if construction was | 109 /** Subclass provides the gl interface object if construction was |
110 * successful. */ | 110 * successful. */ |
111 SkAutoTUnref<const GrGLInterface> fGL; | 111 SkAutoTUnref<const GrGLInterface> fGL; |
112 | 112 |
113 friend class GLFenceSync; // For onPlatformGetProcAddress. | 113 friend class GLFenceSync; // For onPlatformGetProcAddress. |
114 }; | 114 }; |
115 | 115 |
116 /** Creates platform-dependent GL context object | 116 /** Creates platform-dependent GL context object. The shareContext parameter is in an optional |
117 * context with which to share display lists. This should be a pointer to an SkG LContext created | |
118 * with SkCreatePlatformGLContext. NULL indicates that no sharing is to take pl ace. | |
bsalomon
2016/01/20 15:26:07
Can you rewrap the rest of the comment to agree wi
| |
117 * Returns a valid gl context object or NULL if such can not be created. | 119 * Returns a valid gl context object or NULL if such can not be created. |
118 * Note: If Skia embedder needs a custom GL context that sets up the GL | 120 * Note: If Skia embedder needs a custom GL context that sets up the GL |
119 * interface, this function should be implemented by the embedder. | 121 * interface, this function should be implemented by the embedder. |
120 * Otherwise, the default implementation for the platform should be compiled in | 122 * Otherwise, the default implementation for the platform should be compiled in |
121 * the library. | 123 * the library. |
122 */ | 124 */ |
123 SK_API SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI); | 125 SK_API SkGLContext* SkCreatePlatformGLContext(GrGLStandard forcedGpuAPI, |
126 SkGLContext* shareContext = nullpt r); | |
124 | 127 |
125 /** | 128 /** |
126 * Helper macros for using the GL context through the GrGLInterface. Example: | 129 * Helper macros for using the GL context through the GrGLInterface. Example: |
127 * SK_GL(glCtx, GenTextures(1, &texID)); | 130 * SK_GL(glCtx, GenTextures(1, &texID)); |
128 */ | 131 */ |
129 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ | 132 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ |
130 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) | 133 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
131 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ | 134 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ |
132 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) | 135 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
133 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X | 136 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X |
134 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X | 137 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X |
135 | 138 |
136 #endif | 139 #endif |
OLD | NEW |