epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2006 The Android Open Source Project |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 4 | * |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 9 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 10 | #ifndef SkUserConfig_DEFINED |
| 11 | #define SkUserConfig_DEFINED |
| 12 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 13 | /* SkTypes.h, the root of the public header files, does the following trick: |
reed@google.com | 9d0d195 | 2011-01-28 22:19:22 +0000 | [diff] [blame] | 14 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 15 | #include "SkPreConfig.h" |
| 16 | #include "SkUserConfig.h" |
| 17 | #include "SkPostConfig.h" |
reed@google.com | 9d0d195 | 2011-01-28 22:19:22 +0000 | [diff] [blame] | 18 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 19 | SkPreConfig.h runs first, and it is responsible for initializing certain |
| 20 | skia defines. |
reed@google.com | 9d0d195 | 2011-01-28 22:19:22 +0000 | [diff] [blame] | 21 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 22 | SkPostConfig.h runs last, and its job is to just check that the final |
| 23 | defines are consistent (i.e. that we don't have mutually conflicting |
| 24 | defines). |
reed@google.com | 9d0d195 | 2011-01-28 22:19:22 +0000 | [diff] [blame] | 25 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 26 | SkUserConfig.h (this file) runs in the middle. It gets to change or augment |
| 27 | the list of flags initially set in preconfig, and then postconfig checks |
| 28 | that everything still makes sense. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 29 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 30 | Below are optional defines that add, subtract, or change default behavior |
| 31 | in Skia. Your port can locally edit this file to enable/disable flags as |
| 32 | you choose, or these can be delared on your command line (i.e. -Dfoo). |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 33 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 34 | By default, this include file will always default to having all of the flags |
| 35 | commented out, so including it will have no effect. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 36 | */ |
| 37 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 38 | /////////////////////////////////////////////////////////////////////////////// |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 39 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 40 | /* Skia has lots of debug-only code. Often this is just null checks or other |
| 41 | parameter checking, but sometimes it can be quite intrusive (e.g. check that |
| 42 | each 32bit pixel is in premultiplied form). This code can be very useful |
| 43 | during development, but will slow things down in a shipping product. |
reed@google.com | 9d0d195 | 2011-01-28 22:19:22 +0000 | [diff] [blame] | 44 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 45 | By default, these mutually exclusive flags are defined in SkPreConfig.h, |
| 46 | based on the presence or absence of NDEBUG, but that decision can be changed |
| 47 | here. |
| 48 | */ |
| 49 | //#define SK_DEBUG |
| 50 | //#define SK_RELEASE |
| 51 | |
djsollen@google.com | 077348c | 2012-10-22 20:23:32 +0000 | [diff] [blame] | 52 | /* Skia has certain debug-only code that is extremely intensive even for debug |
| 53 | builds. This code is useful for diagnosing specific issues, but is not |
| 54 | generally applicable, therefore it must be explicitly enabled to avoid |
| 55 | the performance impact. By default these flags are undefined, but can be |
| 56 | enabled by uncommenting them below. |
| 57 | */ |
djsollen@google.com | 000dea7 | 2012-11-30 16:19:32 +0000 | [diff] [blame] | 58 | //#define SK_DEBUG_GLYPH_CACHE |
djsollen@google.com | 077348c | 2012-10-22 20:23:32 +0000 | [diff] [blame] | 59 | //#define SK_DEBUG_PATH |
| 60 | |
robertphillips@google.com | b74af87 | 2012-06-27 19:41:42 +0000 | [diff] [blame] | 61 | /* To assist debugging, Skia provides an instance counting utility in |
| 62 | include/core/SkInstCount.h. This flag turns on and off that utility to |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 63 | allow instance count tracking in either debug or release builds. By |
robertphillips@google.com | b74af87 | 2012-06-27 19:41:42 +0000 | [diff] [blame] | 64 | default it is enabled in debug but disabled in release. |
| 65 | */ |
bsalomon@google.com | 4e23068 | 2013-01-15 20:37:04 +0000 | [diff] [blame] | 66 | //#define SK_ENABLE_INST_COUNT 1 |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 67 | |
| 68 | /* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger) |
| 69 | it will call SK_CRASH(). If this is not defined it, it is defined in |
| 70 | SkPostConfig.h to write to an illegal address |
| 71 | */ |
| 72 | //#define SK_CRASH() *(int *)(uintptr_t)0 = 0 |
| 73 | |
| 74 | |
| 75 | /* preconfig will have attempted to determine the endianness of the system, |
| 76 | but you can change these mutually exclusive flags here. |
| 77 | */ |
| 78 | //#define SK_CPU_BENDIAN |
| 79 | //#define SK_CPU_LENDIAN |
| 80 | |
bungeman@google.com | f8d1aee | 2012-02-02 19:15:21 +0000 | [diff] [blame] | 81 | /* Most compilers use the same bit endianness for bit flags in a byte as the |
| 82 | system byte endianness, and this is the default. If for some reason this |
| 83 | needs to be overridden, specify which of the mutually exclusive flags to |
| 84 | use. For example, some atom processors in certain configurations have big |
| 85 | endian byte order but little endian bit orders. |
| 86 | */ |
| 87 | //#define SK_UINT8_BITFIELD_BENDIAN |
| 88 | //#define SK_UINT8_BITFIELD_LENDIAN |
| 89 | |
robertphillips@google.com | 0e6e8cc | 2013-08-15 13:43:23 +0000 | [diff] [blame] | 90 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 91 | /* To write debug messages to a console, skia will call SkDebugf(...) following |
| 92 | printf conventions (e.g. const char* format, ...). If you want to redirect |
| 93 | this to something other than printf, define yours here |
| 94 | */ |
| 95 | //#define SkDebugf(...) MyFunction(__VA_ARGS__) |
| 96 | |
reed@google.com | 77407ca | 2011-11-08 13:48:32 +0000 | [diff] [blame] | 97 | /* |
| 98 | * To specify a different default font cache limit, define this. If this is |
| 99 | * undefined, skia will use a built-in value. |
| 100 | */ |
| 101 | //#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024) |
| 102 | |
reed@google.com | 602a1d7 | 2013-07-23 19:13:54 +0000 | [diff] [blame] | 103 | /* |
| 104 | * To specify the default size of the image cache, undefine this and set it to |
| 105 | * the desired value (in bytes). SkGraphics.h as a runtime API to set this |
| 106 | * value as well. If this is undefined, a built-in value will be used. |
| 107 | */ |
| 108 | //#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024) |
| 109 | |
vandebo@chromium.org | 094316b | 2011-03-04 03:15:13 +0000 | [diff] [blame] | 110 | /* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow |
| 111 | them, but modern PDF interpreters should handle them just fine. |
| 112 | */ |
| 113 | //#define SK_ALLOW_LARGE_PDF_SCALARS |
| 114 | |
vandebo@chromium.org | 1f16589 | 2011-07-26 02:11:41 +0000 | [diff] [blame] | 115 | /* Define this to provide font subsetter in PDF generation. |
| 116 | */ |
| 117 | //#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h" |
| 118 | |
reed@google.com | c27b741 | 2011-09-13 17:20:30 +0000 | [diff] [blame] | 119 | /* Define this to set the upper limit for text to support LCD. Values that |
| 120 | are very large increase the cost in the font cache and draw slower, without |
| 121 | improving readability. If this is undefined, Skia will use its default |
| 122 | value (e.g. 48) |
| 123 | */ |
| 124 | //#define SK_MAX_SIZE_FOR_LCDTEXT 48 |
| 125 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 126 | /* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST |
| 127 | which will run additional self-tests at startup. These can take a long time, |
| 128 | so this flag is optional. |
| 129 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 130 | #ifdef SK_DEBUG |
reed@android.com | 0f0cfae | 2009-10-13 13:33:16 +0000 | [diff] [blame] | 131 | //#define SK_SUPPORT_UNITTEST |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 132 | #endif |
| 133 | |
scroggo | b66365f | 2011-03-18 21:43:03 +0000 | [diff] [blame] | 134 | /* Change the ordering to work in X windows. |
| 135 | */ |
| 136 | #ifdef SK_SAMPLES_FOR_X |
| 137 | #define SK_R32_SHIFT 16 |
| 138 | #define SK_G32_SHIFT 8 |
| 139 | #define SK_B32_SHIFT 0 |
| 140 | #define SK_A32_SHIFT 24 |
| 141 | #endif |
| 142 | |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 143 | |
| 144 | /* Determines whether to build code that supports the GPU backend. Some classes |
| 145 | that are not GPU-specific, such as SkShader subclasses, have optional code |
| 146 | that is used allows them to interact with the GPU backend. If you'd like to |
| 147 | omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu |
| 148 | directories from your include search path when you're not building the GPU |
| 149 | backend. Defaults to 1 (build the GPU code). |
| 150 | */ |
| 151 | //#define SK_SUPPORT_GPU 1 |
sugoi@google.com | 7775fd5 | 2012-11-21 15:47:04 +0000 | [diff] [blame] | 152 | |
commit-bot@chromium.org | 92ffe7d | 2013-07-31 22:54:31 +0000 | [diff] [blame] | 153 | |
fmalita | 632e92f | 2015-04-22 15:02:03 -0700 | [diff] [blame^] | 154 | /* The PDF generation code uses Path Ops to handle complex clipping paths, |
| 155 | * but at this time, Path Ops is not release ready yet. So, the code is |
| 156 | * hidden behind this #define guard. If you are feeling adventurous and |
| 157 | * want the latest and greatest PDF generation code, uncomment the #define. |
commit-bot@chromium.org | 92ffe7d | 2013-07-31 22:54:31 +0000 | [diff] [blame] | 158 | * When Path Ops is release ready, the define guards and this user config |
| 159 | * define should be removed entirely. |
| 160 | */ |
fmalita | 632e92f | 2015-04-22 15:02:03 -0700 | [diff] [blame^] | 161 | //#define SK_PDF_USE_PATHOPS_CLIPPING |
commit-bot@chromium.org | 92ffe7d | 2013-07-31 22:54:31 +0000 | [diff] [blame] | 162 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 163 | #endif |