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 SkGLContextHelper_DEFINED | 8 #ifndef SkGLContextHelper_DEFINED |
9 #define SkGLContextHelper_DEFINED | 9 #define SkGLContextHelper_DEFINED |
10 | 10 |
11 #include "GrGLInterface.h" | 11 #include "GrGLInterface.h" |
12 | 12 |
13 /** | 13 /** |
14 * Create an offscreen opengl context with an RGBA8 / 8bit stencil FBO. | 14 * Create an offscreen opengl context with an RGBA8 / 8bit stencil FBO. |
15 * Provides a GrGLInterface struct of function pointers for the context. | 15 * Provides a GrGLInterface struct of function pointers for the context. |
16 */ | 16 */ |
17 | 17 |
18 class SkGLContextHelper : public SkRefCnt { | 18 class SK_API SkGLContextHelper : public SkRefCnt { |
19 public: | 19 public: |
20 SK_DECLARE_INST_COUNT(SkGLContextHelper) | 20 SK_DECLARE_INST_COUNT(SkGLContextHelper) |
21 | 21 |
22 SkGLContextHelper(); | 22 SkGLContextHelper(); |
23 virtual ~SkGLContextHelper(); | 23 virtual ~SkGLContextHelper(); |
24 | 24 |
25 /** | 25 /** |
26 * Initializes the context and makes it current. | 26 * Initializes the context and makes it current. |
27 */ | 27 */ |
28 bool init(const int width, const int height); | 28 bool init(const int width, const int height); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 * SK_GL(glCtx, GenTextures(1, &texID)); | 78 * SK_GL(glCtx, GenTextures(1, &texID)); |
79 */ | 79 */ |
80 #define SK_GL(ctx, X) (ctx).gl()->f ## X; \ | 80 #define SK_GL(ctx, X) (ctx).gl()->f ## X; \ |
81 SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fGetError()) | 81 SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fGetError()) |
82 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->f ## X; \ | 82 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->f ## X; \ |
83 SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fGetError()) | 83 SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fGetError()) |
84 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->f ## X | 84 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->f ## X |
85 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->f ## X | 85 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->f ## X |
86 | 86 |
87 #endif | 87 #endif |
OLD | NEW |