OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 | 8 |
9 | 9 |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 * GR_GL_LOG_CALLS is 1. Defaults to 0. | 39 * GR_GL_LOG_CALLS is 1. Defaults to 0. |
40 * | 40 * |
41 * GR_GL_CHECK_ERROR: if enabled Gr can do a glGetError() after every GL call. | 41 * GR_GL_CHECK_ERROR: if enabled Gr can do a glGetError() after every GL call. |
42 * Defaults to 1 if SK_DEBUG is set, otherwise 0. When GR_GL_CHECK_ERROR is 1 | 42 * Defaults to 1 if SK_DEBUG is set, otherwise 0. When GR_GL_CHECK_ERROR is 1 |
43 * this can be toggled in a debugger using the gCheckErrorGL global. The initial | 43 * this can be toggled in a debugger using the gCheckErrorGL global. The initial |
44 * value of gCheckErrorGL is controlled by by GR_GL_CHECK_ERROR_START. | 44 * value of gCheckErrorGL is controlled by by GR_GL_CHECK_ERROR_START. |
45 * | 45 * |
46 * GR_GL_CHECK_ERROR_START: controls the initial value of gCheckErrorGL | 46 * GR_GL_CHECK_ERROR_START: controls the initial value of gCheckErrorGL |
47 * when GR_GL_CHECK_ERROR is 1. Defaults to 1. | 47 * when GR_GL_CHECK_ERROR is 1. Defaults to 1. |
48 * | 48 * |
| 49 * GR_GL_NO_CONSTANT_ATTRIBUTES: if this evaluates to true then the GL backend |
| 50 * will use uniforms instead of attributes in all cases when there is not |
| 51 * per-vertex data. This is important when the underlying GL implementation |
| 52 * doesn't actually support immediate style attribute values (e.g. when |
| 53 * the GL stream is converted to DX as in ANGLE on Chrome). Defaults to 0. |
| 54 * |
49 * GR_GL_USE_BUFFER_DATA_NULL_HINT: When specifing new data for a vertex/index | 55 * GR_GL_USE_BUFFER_DATA_NULL_HINT: When specifing new data for a vertex/index |
50 * buffer that replaces old data Ganesh can give a hint to the driver that the | 56 * buffer that replaces old data Ganesh can give a hint to the driver that the |
51 * previous data will not be used in future draws like this: | 57 * previous data will not be used in future draws like this: |
52 * glBufferData(GL_..._BUFFER, size, NULL, usage); //<--hint, NULL means | 58 * glBufferData(GL_..._BUFFER, size, NULL, usage); //<--hint, NULL means |
53 * glBufferSubData(GL_..._BUFFER, 0, lessThanSize, data) // old data can't be | 59 * glBufferSubData(GL_..._BUFFER, 0, lessThanSize, data) // old data can't be |
54 * // used again. | 60 * // used again. |
55 * However, this can be an unoptimization on some platforms, esp. Chrome. | 61 * However, this can be an unoptimization on some platforms, esp. Chrome. |
56 * Chrome's cmd buffer will create a new allocation and memset the whole thing | 62 * Chrome's cmd buffer will create a new allocation and memset the whole thing |
57 * to zero (for security reasons). Defaults to 1 (enabled). | 63 * to zero (for security reasons). Defaults to 1 (enabled). |
58 * | 64 * |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 #define GR_GL_CHECK_ERROR 1 | 119 #define GR_GL_CHECK_ERROR 1 |
114 #else | 120 #else |
115 #define GR_GL_CHECK_ERROR 0 | 121 #define GR_GL_CHECK_ERROR 0 |
116 #endif | 122 #endif |
117 #endif | 123 #endif |
118 | 124 |
119 #if !defined(GR_GL_CHECK_ERROR_START) | 125 #if !defined(GR_GL_CHECK_ERROR_START) |
120 #define GR_GL_CHECK_ERROR_START 1 | 126 #define GR_GL_CHECK_ERROR_START 1 |
121 #endif | 127 #endif |
122 | 128 |
| 129 #if !defined(GR_GL_NO_CONSTANT_ATTRIBUTES) |
| 130 #define GR_GL_NO_CONSTANT_ATTRIBUTES 0 |
| 131 #endif |
| 132 |
123 #if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) | 133 #if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) |
124 #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 | 134 #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 |
125 #endif | 135 #endif |
126 | 136 |
127 #if !defined(GR_GL_PER_GL_FUNC_CALLBACK) | 137 #if !defined(GR_GL_PER_GL_FUNC_CALLBACK) |
128 #define GR_GL_PER_GL_FUNC_CALLBACK 0 | 138 #define GR_GL_PER_GL_FUNC_CALLBACK 0 |
129 #endif | 139 #endif |
130 | 140 |
131 #if !defined(GR_GL_RGBA_8888_PIXEL_OPS_SLOW) | 141 #if !defined(GR_GL_RGBA_8888_PIXEL_OPS_SLOW) |
132 #define GR_GL_RGBA_8888_PIXEL_OPS_SLOW 0 | 142 #define GR_GL_RGBA_8888_PIXEL_OPS_SLOW 0 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 * trick every 128 array buffer uploads. | 185 * trick every 128 array buffer uploads. |
176 * | 186 * |
177 * Hopefully we will understand this better and have a cleaner fix or get a | 187 * Hopefully we will understand this better and have a cleaner fix or get a |
178 * OS/driver level fix. | 188 * OS/driver level fix. |
179 */ | 189 */ |
180 #define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND \ | 190 #define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND \ |
181 (defined(SK_BUILD_FOR_MAC) && \ | 191 (defined(SK_BUILD_FOR_MAC) && \ |
182 !GR_GL_USE_BUFFER_DATA_NULL_HINT) | 192 !GR_GL_USE_BUFFER_DATA_NULL_HINT) |
183 | 193 |
184 #endif | 194 #endif |
OLD | NEW |