| 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 * | |
| 55 * GR_GL_USE_BUFFER_DATA_NULL_HINT: When specifing new data for a vertex/index | 49 * GR_GL_USE_BUFFER_DATA_NULL_HINT: When specifing new data for a vertex/index |
| 56 * buffer that replaces old data Ganesh can give a hint to the driver that the | 50 * buffer that replaces old data Ganesh can give a hint to the driver that the |
| 57 * previous data will not be used in future draws like this: | 51 * previous data will not be used in future draws like this: |
| 58 * glBufferData(GL_..._BUFFER, size, NULL, usage); //<--hint, NULL means | 52 * glBufferData(GL_..._BUFFER, size, NULL, usage); //<--hint, NULL means |
| 59 * glBufferSubData(GL_..._BUFFER, 0, lessThanSize, data) // old data can't be | 53 * glBufferSubData(GL_..._BUFFER, 0, lessThanSize, data) // old data can't be |
| 60 * // used again. | 54 * // used again. |
| 61 * However, this can be an unoptimization on some platforms, esp. Chrome. | 55 * However, this can be an unoptimization on some platforms, esp. Chrome. |
| 62 * Chrome's cmd buffer will create a new allocation and memset the whole thing | 56 * Chrome's cmd buffer will create a new allocation and memset the whole thing |
| 63 * to zero (for security reasons). Defaults to 1 (enabled). | 57 * to zero (for security reasons). Defaults to 1 (enabled). |
| 64 * | 58 * |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 #define GR_GL_CHECK_ERROR 1 | 113 #define GR_GL_CHECK_ERROR 1 |
| 120 #else | 114 #else |
| 121 #define GR_GL_CHECK_ERROR 0 | 115 #define GR_GL_CHECK_ERROR 0 |
| 122 #endif | 116 #endif |
| 123 #endif | 117 #endif |
| 124 | 118 |
| 125 #if !defined(GR_GL_CHECK_ERROR_START) | 119 #if !defined(GR_GL_CHECK_ERROR_START) |
| 126 #define GR_GL_CHECK_ERROR_START 1 | 120 #define GR_GL_CHECK_ERROR_START 1 |
| 127 #endif | 121 #endif |
| 128 | 122 |
| 129 #if !defined(GR_GL_NO_CONSTANT_ATTRIBUTES) | |
| 130 #define GR_GL_NO_CONSTANT_ATTRIBUTES 0 | |
| 131 #endif | |
| 132 | |
| 133 #if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) | 123 #if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) |
| 134 #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 | 124 #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 |
| 135 #endif | 125 #endif |
| 136 | 126 |
| 137 #if !defined(GR_GL_PER_GL_FUNC_CALLBACK) | 127 #if !defined(GR_GL_PER_GL_FUNC_CALLBACK) |
| 138 #define GR_GL_PER_GL_FUNC_CALLBACK 0 | 128 #define GR_GL_PER_GL_FUNC_CALLBACK 0 |
| 139 #endif | 129 #endif |
| 140 | 130 |
| 141 #if !defined(GR_GL_RGBA_8888_PIXEL_OPS_SLOW) | 131 #if !defined(GR_GL_RGBA_8888_PIXEL_OPS_SLOW) |
| 142 #define GR_GL_RGBA_8888_PIXEL_OPS_SLOW 0 | 132 #define GR_GL_RGBA_8888_PIXEL_OPS_SLOW 0 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 * trick every 128 array buffer uploads. | 175 * trick every 128 array buffer uploads. |
| 186 * | 176 * |
| 187 * Hopefully we will understand this better and have a cleaner fix or get a | 177 * Hopefully we will understand this better and have a cleaner fix or get a |
| 188 * OS/driver level fix. | 178 * OS/driver level fix. |
| 189 */ | 179 */ |
| 190 #define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND \ | 180 #define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND \ |
| 191 (defined(SK_BUILD_FOR_MAC) && \ | 181 (defined(SK_BUILD_FOR_MAC) && \ |
| 192 !GR_GL_USE_BUFFER_DATA_NULL_HINT) | 182 !GR_GL_USE_BUFFER_DATA_NULL_HINT) |
| 193 | 183 |
| 194 #endif | 184 #endif |
| OLD | NEW |