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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 * | 58 * |
59 * GR_GL_PER_GL_FUNC_CALLBACK: When set to 1 the GrGLInterface object provides | 59 * GR_GL_PER_GL_FUNC_CALLBACK: When set to 1 the GrGLInterface object provides |
60 * a function pointer that is called just before every gl function. The ptr must | 60 * a function pointer that is called just before every gl function. The ptr must |
61 * be valid (i.e. there is no NULL check). However, by default the callback will | 61 * be valid (i.e. there is no NULL check). However, by default the callback will |
62 * be set to a function that does nothing. The signature of the function is: | 62 * be set to a function that does nothing. The signature of the function is: |
63 * void function(const GrGLInterface*) | 63 * void function(const GrGLInterface*) |
64 * It is not extern "C". | 64 * It is not extern "C". |
65 * The GrGLInterface field fCallback specifies the function ptr and there is an | 65 * The GrGLInterface field fCallback specifies the function ptr and there is an |
66 * additional field fCallbackData of type intptr_t for client data. | 66 * additional field fCallbackData of type intptr_t for client data. |
67 * | 67 * |
| 68 * GR_GL_RGBA_8888_PIXEL_OPS_SLOW: Set this to 1 if it is known that performing |
| 69 * glReadPixels / glTex(Sub)Image with format=GL_RGBA, type=GL_UNISIGNED_BYTE is |
| 70 * significantly slower than format=GL_BGRA, type=GL_UNISIGNED_BYTE. |
| 71 * |
68 * GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL: Set this to 1 if calling | 72 * GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL: Set this to 1 if calling |
69 * glReadPixels to read the entire framebuffer is faster than calling it with | 73 * glReadPixels to read the entire framebuffer is faster than calling it with |
70 * the same sized rectangle but with a framebuffer bound that is larger than | 74 * the same sized rectangle but with a framebuffer bound that is larger than |
71 * the rectangle read. | 75 * the rectangle read. |
72 * | 76 * |
73 * GR_GL_CHECK_ALLOC_WITH_GET_ERROR: If set to 1 this will then glTexImage, | 77 * GR_GL_CHECK_ALLOC_WITH_GET_ERROR: If set to 1 this will then glTexImage, |
74 * glBufferData, glRenderbufferStorage, etc will be checked for errors. This | 78 * glBufferData, glRenderbufferStorage, etc will be checked for errors. This |
75 * amounts to ensuring the error is GL_NO_ERROR, calling the allocating | 79 * amounts to ensuring the error is GL_NO_ERROR, calling the allocating |
76 * function, and then checking that the error is still GL_NO_ERROR. When the | 80 * function, and then checking that the error is still GL_NO_ERROR. When the |
77 * value is 0 we will assume no error was generated without checking. | 81 * value is 0 we will assume no error was generated without checking. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 #endif | 121 #endif |
118 | 122 |
119 #if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) | 123 #if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) |
120 #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 | 124 #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 |
121 #endif | 125 #endif |
122 | 126 |
123 #if !defined(GR_GL_PER_GL_FUNC_CALLBACK) | 127 #if !defined(GR_GL_PER_GL_FUNC_CALLBACK) |
124 #define GR_GL_PER_GL_FUNC_CALLBACK 0 | 128 #define GR_GL_PER_GL_FUNC_CALLBACK 0 |
125 #endif | 129 #endif |
126 | 130 |
| 131 #if !defined(GR_GL_RGBA_8888_PIXEL_OPS_SLOW) |
| 132 #define GR_GL_RGBA_8888_PIXEL_OPS_SLOW 0 |
| 133 #endif |
| 134 |
127 #if !defined(GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL) | 135 #if !defined(GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL) |
128 #define GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL 0 | 136 #define GR_GL_FULL_READPIXELS_FASTER_THAN_PARTIAL 0 |
129 #endif | 137 #endif |
130 | 138 |
131 #if !defined(GR_GL_CHECK_ALLOC_WITH_GET_ERROR) | 139 #if !defined(GR_GL_CHECK_ALLOC_WITH_GET_ERROR) |
132 #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 1 | 140 #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 1 |
133 #endif | 141 #endif |
134 | 142 |
135 #if !defined(GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT) | 143 #if !defined(GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT) |
136 #define GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 0 | 144 #define GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 0 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 * 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 |
170 * OS/driver level fix. | 178 * OS/driver level fix. |
171 */ | 179 */ |
172 #if (defined(SK_BUILD_FOR_MAC) && !GR_GL_USE_BUFFER_DATA_NULL_HINT) | 180 #if (defined(SK_BUILD_FOR_MAC) && !GR_GL_USE_BUFFER_DATA_NULL_HINT) |
173 # define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND 1 | 181 # define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND 1 |
174 #else | 182 #else |
175 # define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND 0 | 183 # define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND 0 |
176 #endif | 184 #endif |
177 | 185 |
178 #endif | 186 #endif |
OLD | NEW |