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 |
11 #include "GrGLInterface.h" | 11 #include "GrGLInterface.h" |
12 #include "../../private/SkGpuFenceSync.h" | 12 #include "../../src/gpu/SkGpuFenceSync.h" |
13 | 13 |
14 /** | 14 /** |
15 * Create an offscreen opengl context with an RGBA8 / 8bit stencil FBO. | 15 * Create an offscreen opengl context with an RGBA8 / 8bit stencil FBO. |
16 * Provides a GrGLInterface struct of function pointers for the context. | 16 * Provides a GrGLInterface struct of function pointers for the context. |
17 */ | 17 */ |
18 | 18 |
19 class SK_API SkGLContext : public SkRefCnt { | 19 class SK_API SkGLContext : public SkRefCnt { |
20 public: | 20 public: |
21 | 21 |
22 | 22 |
23 ~SkGLContext() override; | 23 ~SkGLContext() override; |
24 | 24 |
25 bool isValid() const { return NULL != gl(); } | 25 bool isValid() const { return NULL != gl(); } |
26 | 26 |
27 const GrGLInterface* gl() const { return fGL.get(); } | 27 const GrGLInterface* gl() const { return fGL.get(); } |
28 | 28 |
29 bool fenceSyncSupport() const { return SkToBool(fFenceSync); } | 29 bool fenceSyncSupport() const { return SkToBool(fFenceSync); } |
30 | 30 |
31 bool getMaxGpuFrameLag(int* maxFrameLag) const { | 31 bool getMaxGpuFrameLag(int* maxFrameLag) const { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 * SK_GL(glCtx, GenTextures(1, &texID)); | 109 * SK_GL(glCtx, GenTextures(1, &texID)); |
110 */ | 110 */ |
111 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ | 111 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ |
112 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) | 112 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
113 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ | 113 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ |
114 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) | 114 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
115 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X | 115 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X |
116 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X | 116 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X |
117 | 117 |
118 #endif | 118 #endif |
OLD | NEW |