epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 1 | |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 3 | * Copyright 2010 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. |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 9 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 10 | #ifndef GrUserConfig_DEFINED |
| 11 | #define GrUserConfig_DEFINED |
| 12 | |
| 13 | #if defined(GR_USER_CONFIG_FILE) |
| 14 | #error "default user config pulled in but GR_USER_CONFIG_FILE is defined." |
| 15 | #endif |
| 16 | |
| 17 | #if 0 |
| 18 | #undef GR_RELEASE |
| 19 | #undef GR_DEBUG |
| 20 | #define GR_RELEASE 0 |
| 21 | #define GR_DEBUG 1 |
| 22 | #endif |
| 23 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 24 | /* |
bsalomon@google.com | 2fbc7fa | 2011-01-05 16:34:41 +0000 | [diff] [blame] | 25 | * The default 32bit pixel config for texture upload is GL_RGBA on all |
| 26 | * 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] | 27 | * different GL enum, specify that with this define. For portability use |
| 28 | * GR_BGRA rather than GL_BGRA for platforms where this format is an |
| 29 | * extension. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 30 | */ |
bsalomon@google.com | 2fbc7fa | 2011-01-05 16:34:41 +0000 | [diff] [blame] | 31 | //#define GR_GL_32BPP_COLOR_FORMAT GL_RGBA |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 32 | |
| 33 | /* |
| 34 | * To diagnose texture cache performance, define this to 1 if you want to see |
| 35 | * a log statement everytime we upload an image to create a texture. |
| 36 | */ |
| 37 | //#define GR_DUMP_TEXTURE_UPLOAD 1 |
| 38 | |
bsalomon@google.com | e9557f9 | 2010-12-23 20:59:40 +0000 | [diff] [blame] | 39 | /* |
| 40 | * 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] | 41 | * gPrintGL global variable. |
bsalomon@google.com | e9557f9 | 2010-12-23 20:59:40 +0000 | [diff] [blame] | 42 | */ |
| 43 | //#define GR_GL_LOG_CALLS 1 |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 44 | |
bsalomon@google.com | 4333323 | 2011-02-02 19:24:54 +0000 | [diff] [blame] | 45 | /* |
| 46 | * When drawing rects this causes Ganesh to use a vertex buffer containing |
| 47 | * a unit square that is positioned by a matrix. Enable on systems where |
| 48 | * emitting per-rect-draw verts is more expensive than constant/matrix |
| 49 | * updates. Defaults to 0. |
| 50 | */ |
| 51 | //#define GR_STATIC_RECT_VB 1 |
| 52 | |
bsalomon@google.com | d16983b | 2011-02-02 22:42:20 +0000 | [diff] [blame] | 53 | /* |
| 54 | * This causes more aggressive shader optimization. May hurt performance if |
| 55 | * switching shaders is expensive. |
| 56 | */ |
| 57 | //#define GR_AGGRESSIVE_SHADER_OPTS 1 |
| 58 | |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 59 | /* |
| 60 | * This gives a threshold in bytes of when to lock a GrGeometryBuffer vs using |
| 61 | * updateData or updateSubData. (Note the depending on the underlying 3D API |
| 62 | * the update functions may always be implemented using a lock) |
| 63 | */ |
| 64 | //#define GR_GEOM_BUFFER_LOCK_THRESHOLD (1<<15) |
| 65 | |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 66 | /////////////////////////////////////////////////////////////////////////////// |
| 67 | /* |
| 68 | * temporary flags (may go away soon) |
| 69 | */ |
| 70 | |
reed@google.com | 117cc39 | 2011-01-19 13:19:27 +0000 | [diff] [blame] | 71 | /////////////////////////////////////////////////////////////////////////////// |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 72 | // Decide Ganesh types |
| 73 | |
| 74 | #define GR_SCALAR_IS_FIXED 0 |
| 75 | #define GR_SCALAR_IS_FLOAT 1 |
| 76 | |
| 77 | #define GR_TEXT_SCALAR_IS_USHORT 0 |
| 78 | #define GR_TEXT_SCALAR_IS_FIXED 0 |
| 79 | #define GR_TEXT_SCALAR_IS_FLOAT 1 |
| 80 | |
| 81 | #endif |
| 82 | |
| 83 | |