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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void testAbandon(); | 78 void testAbandon(); |
79 | 79 |
80 /** | 80 /** |
81 * Creates a new GL context of the same type and makes the returned context
current | 81 * Creates a new GL context of the same type and makes the returned context
current |
82 * (if not null). | 82 * (if not null). |
83 */ | 83 */ |
84 virtual SkGLContext* createNew() const { return nullptr; } | 84 virtual SkGLContext* createNew() const { return nullptr; } |
85 | 85 |
86 class GLFenceSync; // SkGpuFenceSync implementation that uses the OpenGL fu
nctionality. | 86 class GLFenceSync; // SkGpuFenceSync implementation that uses the OpenGL fu
nctionality. |
87 | 87 |
| 88 /* |
| 89 * returns the fencesync object owned by this SkGLContext |
| 90 */ |
| 91 SkGpuFenceSync* fenceSync() { return fFenceSync.get(); } |
| 92 |
88 protected: | 93 protected: |
89 SkGLContext(); | 94 SkGLContext(); |
90 | 95 |
91 /* | 96 /* |
92 * Methods that sublcasses must call from their constructors and destructors
. | 97 * Methods that sublcasses must call from their constructors and destructors
. |
93 */ | 98 */ |
94 void init(const GrGLInterface*, SkGpuFenceSync* = NULL); | 99 void init(const GrGLInterface*, SkGpuFenceSync* = NULL); |
95 void teardown(); | 100 void teardown(); |
96 | 101 |
97 /* | 102 /* |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 * SK_GL(glCtx, GenTextures(1, &texID)); | 136 * SK_GL(glCtx, GenTextures(1, &texID)); |
132 */ | 137 */ |
133 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ | 138 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ |
134 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) | 139 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
135 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ | 140 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ |
136 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) | 141 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
137 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X | 142 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X |
138 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X | 143 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X |
139 | 144 |
140 #endif | 145 #endif |
OLD | NEW |