reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2010 Google Inc. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 17 | #ifndef GrUserConfig_DEFINED |
| 18 | #define GrUserConfig_DEFINED |
| 19 | |
| 20 | #if defined(GR_USER_CONFIG_FILE) |
| 21 | #error "default user config pulled in but GR_USER_CONFIG_FILE is defined." |
| 22 | #endif |
| 23 | |
| 24 | #if 0 |
| 25 | #undef GR_RELEASE |
| 26 | #undef GR_DEBUG |
| 27 | #define GR_RELEASE 0 |
| 28 | #define GR_DEBUG 1 |
| 29 | #endif |
| 30 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 31 | //#define GR_FORCE_GLCHECKERR 1 |
| 32 | |
| 33 | /* |
bsalomon@google.com | 2fbc7fa | 2011-01-05 16:34:41 +0000 | [diff] [blame] | 34 | * The default 32bit pixel config for texture upload is GL_RGBA on all |
| 35 | * platforms except on Windows where it is GL_BGRA. If your bitmaps map to a |
bsalomon@google.com | ed3a068 | 2011-01-18 16:54:04 +0000 | [diff] [blame] | 36 | * different GL enum, specify that with this define. For portability use |
| 37 | * GR_BGRA rather than GL_BGRA for platforms where this format is an |
| 38 | * extension. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 39 | */ |
bsalomon@google.com | 2fbc7fa | 2011-01-05 16:34:41 +0000 | [diff] [blame] | 40 | //#define GR_GL_32BPP_COLOR_FORMAT GL_RGBA |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 41 | |
| 42 | /* |
| 43 | * To diagnose texture cache performance, define this to 1 if you want to see |
| 44 | * a log statement everytime we upload an image to create a texture. |
| 45 | */ |
| 46 | //#define GR_DUMP_TEXTURE_UPLOAD 1 |
| 47 | |
bsalomon@google.com | e9557f9 | 2010-12-23 20:59:40 +0000 | [diff] [blame] | 48 | /* |
| 49 | * To log all GL calls define this. Can be turned on and off at runtime by |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 50 | * gPrintGL global variable. |
bsalomon@google.com | e9557f9 | 2010-12-23 20:59:40 +0000 | [diff] [blame] | 51 | */ |
| 52 | //#define GR_GL_LOG_CALLS 1 |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 53 | |
bsalomon@google.com | 4333323 | 2011-02-02 19:24:54 +0000 | [diff] [blame] | 54 | /* |
| 55 | * When drawing rects this causes Ganesh to use a vertex buffer containing |
| 56 | * a unit square that is positioned by a matrix. Enable on systems where |
| 57 | * emitting per-rect-draw verts is more expensive than constant/matrix |
| 58 | * updates. Defaults to 0. |
| 59 | */ |
| 60 | //#define GR_STATIC_RECT_VB 1 |
| 61 | |
bsalomon@google.com | d16983b | 2011-02-02 22:42:20 +0000 | [diff] [blame^] | 62 | /* |
| 63 | * This causes more aggressive shader optimization. May hurt performance if |
| 64 | * switching shaders is expensive. |
| 65 | */ |
| 66 | //#define GR_AGGRESSIVE_SHADER_OPTS 1 |
| 67 | |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 68 | /////////////////////////////////////////////////////////////////////////////// |
| 69 | /* |
| 70 | * temporary flags (may go away soon) |
| 71 | */ |
| 72 | |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 73 | // disable 2-point-radial gradient shader programs |
| 74 | //#define GR_SKIP_2POINTRADIAL_PROGRAMS |
| 75 | |
| 76 | /////////////////////////////////////////////////////////////////////////////// |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 77 | // Decide Ganesh types |
| 78 | |
| 79 | #define GR_SCALAR_IS_FIXED 0 |
| 80 | #define GR_SCALAR_IS_FLOAT 1 |
| 81 | |
| 82 | #define GR_TEXT_SCALAR_IS_USHORT 0 |
| 83 | #define GR_TEXT_SCALAR_IS_FIXED 0 |
| 84 | #define GR_TEXT_SCALAR_IS_FLOAT 1 |
| 85 | |
| 86 | #endif |
| 87 | |
| 88 | |