1 
2 /*
3  * Copyright 2011 Google Inc.
4  *
5  * Use of this source code is governed by a BSD-style license that can be
6  * found in the LICENSE file.
7  */
8 
9 
10 
11 #ifndef GrGLConfig_DEFINED
12 #define GrGLConfig_DEFINED
13 
14 #include "include/gpu/GrTypes.h"
15 
16 /**
17  * Optional GL config file.
18  */
19 #ifdef GR_GL_CUSTOM_SETUP_HEADER
20     #include GR_GL_CUSTOM_SETUP_HEADER
21 #endif
22 
23 #if !defined(GR_GL_FUNCTION_TYPE)
24     #if defined(SK_BUILD_FOR_WIN)
25         #define GR_GL_FUNCTION_TYPE __stdcall
26     #else
27         #define GR_GL_FUNCTION_TYPE
28     #endif
29 #endif
30 
31 /**
32  * The following are optional defines that can be enabled at the compiler
33  * command line, in a IDE project, in a GrUserConfig.h file, or in a GL custom
34  * file (if one is in use). If a GR_GL_CUSTOM_SETUP_HEADER is used they can
35  * also be placed there.
36  *
37  * GR_GL_LOG_CALLS: if 1 Gr can print every GL call using SkDebugf. Defaults to
38  * 0. Logging can be enabled and disabled at runtime using a debugger via to
39  * global gLogCallsGL. The initial value of gLogCallsGL is controlled by
40  * GR_GL_LOG_CALLS_START.
41  *
42  * GR_GL_LOG_CALLS_START: controls the initial value of gLogCallsGL when
43  * GR_GL_LOG_CALLS is 1. Defaults to 0.
44  *
45  * GR_GL_CHECK_ERROR: if enabled Gr can do a glGetError() after every GL call.
46  * Defaults to 1 if SK_DEBUG is set, otherwise 0. When GR_GL_CHECK_ERROR is 1
47  * this can be toggled in a debugger using the gCheckErrorGL global. The initial
48  * value of gCheckErrorGL is controlled by by GR_GL_CHECK_ERROR_START.
49  *
50  * GR_GL_CHECK_ERROR_START: controls the initial value of gCheckErrorGL
51  * when GR_GL_CHECK_ERROR is 1.  Defaults to 1.
52  *
53  */
54 
55 #if !defined(GR_GL_LOG_CALLS)
56     #ifdef SK_DEBUG
57         #define GR_GL_LOG_CALLS 1
58     #else
59         #define GR_GL_LOG_CALLS 0
60     #endif
61 #endif
62 
63 #if !defined(GR_GL_LOG_CALLS_START)
64     #define GR_GL_LOG_CALLS_START                       0
65 #endif
66 
67 #if !defined(GR_GL_CHECK_ERROR)
68     #ifdef SK_DEBUG
69         #define GR_GL_CHECK_ERROR 1
70     #else
71         #define GR_GL_CHECK_ERROR 0
72     #endif
73 #endif
74 
75 #if !defined(GR_GL_CHECK_ERROR_START)
76     #define GR_GL_CHECK_ERROR_START                     1
77 #endif
78 
79 #endif
80