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 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const GrGLInterface* fGL; | 71 const GrGLInterface* fGL; |
72 | 72 |
73 typedef SkRefCnt INHERITED; | 73 typedef SkRefCnt INHERITED; |
74 }; | 74 }; |
75 | 75 |
76 /** | 76 /** |
77 * Helper macros for using the GL context through the GrGLInterface. Example: | 77 * Helper macros for using the GL context through the GrGLInterface. Example: |
78 * SK_GL(glCtx, GenTextures(1, &texID)); | 78 * SK_GL(glCtx, GenTextures(1, &texID)); |
79 */ | 79 */ |
80 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ | 80 #define SK_GL(ctx, X) (ctx).gl()->fFunctions.f ## X; \ |
81 SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fFunctions.fGetErro
r()) | 81 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
82 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ | 82 #define SK_GL_RET(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X; \ |
83 SkASSERT(GR_GL_NO_ERROR == (ctx).gl()->fFunctions.fGetError()) | 83 SkASSERT(0 == (ctx).gl()->fFunctions.fGetError()) |
84 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X | 84 #define SK_GL_NOERRCHECK(ctx, X) (ctx).gl()->fFunctions.f ## X |
85 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X | 85 #define SK_GL_RET_NOERRCHECK(ctx, RET, X) (RET) = (ctx).gl()->fFunctions.f ## X |
86 | 86 |
87 #endif | 87 #endif |
OLD | NEW |