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 | |
Mike Klein | fe0aeb3 | 2019-05-20 10:55:11 -0500 | [diff] [blame] | 13 | /* SkTypes.h, the root of the public header files, includes SkPreConfig.h, |
| 14 | then SkUserConfig.h, then SkPostConfig.h. |
reed@google.com | 9d0d195 | 2011-01-28 22:19:22 +0000 | [diff] [blame] | 15 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 16 | SkPreConfig.h runs first, and it is responsible for initializing certain |
| 17 | skia defines. |
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 | SkPostConfig.h runs last, and its job is to just check that the final |
| 20 | defines are consistent (i.e. that we don't have mutually conflicting |
| 21 | defines). |
reed@google.com | 9d0d195 | 2011-01-28 22:19:22 +0000 | [diff] [blame] | 22 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 23 | SkUserConfig.h (this file) runs in the middle. It gets to change or augment |
| 24 | the list of flags initially set in preconfig, and then postconfig checks |
| 25 | that everything still makes sense. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 26 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 27 | Below are optional defines that add, subtract, or change default behavior |
| 28 | in Skia. Your port can locally edit this file to enable/disable flags as |
| 29 | 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] | 30 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 31 | By default, this include file will always default to having all of the flags |
| 32 | commented out, so including it will have no effect. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 33 | */ |
| 34 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 35 | /////////////////////////////////////////////////////////////////////////////// |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 36 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 37 | /* Skia has lots of debug-only code. Often this is just null checks or other |
| 38 | parameter checking, but sometimes it can be quite intrusive (e.g. check that |
| 39 | each 32bit pixel is in premultiplied form). This code can be very useful |
| 40 | during development, but will slow things down in a shipping product. |
reed@google.com | 9d0d195 | 2011-01-28 22:19:22 +0000 | [diff] [blame] | 41 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 42 | By default, these mutually exclusive flags are defined in SkPreConfig.h, |
| 43 | based on the presence or absence of NDEBUG, but that decision can be changed |
| 44 | here. |
| 45 | */ |
| 46 | //#define SK_DEBUG |
| 47 | //#define SK_RELEASE |
| 48 | |
reed@android.com | 5c80ea1 | 2009-01-08 17:49:50 +0000 | [diff] [blame] | 49 | /* To write debug messages to a console, skia will call SkDebugf(...) following |
| 50 | printf conventions (e.g. const char* format, ...). If you want to redirect |
| 51 | this to something other than printf, define yours here |
| 52 | */ |
| 53 | //#define SkDebugf(...) MyFunction(__VA_ARGS__) |
| 54 | |
reed@google.com | 77407ca | 2011-11-08 13:48:32 +0000 | [diff] [blame] | 55 | /* |
| 56 | * To specify a different default font cache limit, define this. If this is |
| 57 | * undefined, skia will use a built-in value. |
| 58 | */ |
| 59 | //#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024) |
| 60 | |
reed@google.com | 602a1d7 | 2013-07-23 19:13:54 +0000 | [diff] [blame] | 61 | /* |
| 62 | * To specify the default size of the image cache, undefine this and set it to |
| 63 | * the desired value (in bytes). SkGraphics.h as a runtime API to set this |
| 64 | * value as well. If this is undefined, a built-in value will be used. |
| 65 | */ |
| 66 | //#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024) |
| 67 | |
reed@google.com | c27b741 | 2011-09-13 17:20:30 +0000 | [diff] [blame] | 68 | /* Define this to set the upper limit for text to support LCD. Values that |
| 69 | are very large increase the cost in the font cache and draw slower, without |
| 70 | improving readability. If this is undefined, Skia will use its default |
| 71 | value (e.g. 48) |
| 72 | */ |
| 73 | //#define SK_MAX_SIZE_FOR_LCDTEXT 48 |
| 74 | |
Mike Klein | f0a5369 | 2019-04-24 11:42:40 -0500 | [diff] [blame] | 75 | /* Change the kN32_SkColorType ordering to BGRA to work in X windows. |
scroggo | b66365f | 2011-03-18 21:43:03 +0000 | [diff] [blame] | 76 | */ |
Mike Klein | f0a5369 | 2019-04-24 11:42:40 -0500 | [diff] [blame] | 77 | //#define SK_R32_SHIFT 16 |
scroggo | b66365f | 2011-03-18 21:43:03 +0000 | [diff] [blame] | 78 | |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 79 | |
| 80 | /* Determines whether to build code that supports the GPU backend. Some classes |
| 81 | that are not GPU-specific, such as SkShader subclasses, have optional code |
| 82 | that is used allows them to interact with the GPU backend. If you'd like to |
| 83 | omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu |
| 84 | directories from your include search path when you're not building the GPU |
| 85 | backend. Defaults to 1 (build the GPU code). |
| 86 | */ |
| 87 | //#define SK_SUPPORT_GPU 1 |
sugoi@google.com | 7775fd5 | 2012-11-21 15:47:04 +0000 | [diff] [blame] | 88 | |
ericrk | 369e937 | 2016-02-05 15:32:36 -0800 | [diff] [blame] | 89 | /* Skia makes use of histogram logging macros to trace the frequency of |
| 90 | * events. By default, Skia provides no-op versions of these macros. |
| 91 | * Skia consumers can provide their own definitions of these macros to |
| 92 | * integrate with their histogram collection backend. |
| 93 | */ |
| 94 | //#define SK_HISTOGRAM_BOOLEAN(name, value) |
| 95 | //#define SK_HISTOGRAM_ENUMERATION(name, value, boundary_value) |
| 96 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 97 | #endif |