blob: 055cd4d1d19eba0f37b93a12952ca73db5e69a99 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@android.com8a1c16f2008-12-17 15:59:43 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2006 The Android Open Source Project
reed@android.com8a1c16f2008-12-17 15:59:43 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
reed@android.com8a1c16f2008-12-17 15:59:43 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
reed@android.com8a1c16f2008-12-17 15:59:43 +000010#ifndef SkUserConfig_DEFINED
11#define SkUserConfig_DEFINED
12
reed@android.com5c80ea12009-01-08 17:49:50 +000013/* SkTypes.h, the root of the public header files, does the following trick:
reed@google.com9d0d1952011-01-28 22:19:22 +000014
reed@android.com5c80ea12009-01-08 17:49:50 +000015 #include "SkPreConfig.h"
16 #include "SkUserConfig.h"
17 #include "SkPostConfig.h"
reed@google.com9d0d1952011-01-28 22:19:22 +000018
reed@android.com5c80ea12009-01-08 17:49:50 +000019 SkPreConfig.h runs first, and it is responsible for initializing certain
20 skia defines.
reed@google.com9d0d1952011-01-28 22:19:22 +000021
reed@android.com5c80ea12009-01-08 17:49:50 +000022 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.com9d0d1952011-01-28 22:19:22 +000025
reed@android.com5c80ea12009-01-08 17:49:50 +000026 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.com8a1c16f2008-12-17 15:59:43 +000029
reed@android.com5c80ea12009-01-08 17:49:50 +000030 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.com8a1c16f2008-12-17 15:59:43 +000033
reed@android.com5c80ea12009-01-08 17:49:50 +000034 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.com8a1c16f2008-12-17 15:59:43 +000036*/
37
reed@android.com5c80ea12009-01-08 17:49:50 +000038///////////////////////////////////////////////////////////////////////////////
reed@android.com8a1c16f2008-12-17 15:59:43 +000039
reed@android.com5c80ea12009-01-08 17:49:50 +000040/* 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.com9d0d1952011-01-28 22:19:22 +000044
reed@android.com5c80ea12009-01-08 17:49:50 +000045 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.com077348c2012-10-22 20:23:32 +000052/* 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.com000dea72012-11-30 16:19:32 +000058//#define SK_DEBUG_GLYPH_CACHE
djsollen@google.com077348c2012-10-22 20:23:32 +000059//#define SK_DEBUG_PATH
60
reed@android.com5c80ea12009-01-08 17:49:50 +000061/* preconfig will have attempted to determine the endianness of the system,
62 but you can change these mutually exclusive flags here.
63 */
64//#define SK_CPU_BENDIAN
65//#define SK_CPU_LENDIAN
66
bungeman@google.comf8d1aee2012-02-02 19:15:21 +000067/* Most compilers use the same bit endianness for bit flags in a byte as the
68 system byte endianness, and this is the default. If for some reason this
69 needs to be overridden, specify which of the mutually exclusive flags to
70 use. For example, some atom processors in certain configurations have big
71 endian byte order but little endian bit orders.
72*/
73//#define SK_UINT8_BITFIELD_BENDIAN
74//#define SK_UINT8_BITFIELD_LENDIAN
75
robertphillips@google.com0e6e8cc2013-08-15 13:43:23 +000076
reed@android.com5c80ea12009-01-08 17:49:50 +000077/* To write debug messages to a console, skia will call SkDebugf(...) following
78 printf conventions (e.g. const char* format, ...). If you want to redirect
79 this to something other than printf, define yours here
80 */
81//#define SkDebugf(...) MyFunction(__VA_ARGS__)
82
reed@google.com77407ca2011-11-08 13:48:32 +000083/*
84 * To specify a different default font cache limit, define this. If this is
85 * undefined, skia will use a built-in value.
86 */
87//#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024)
88
reed@google.com602a1d72013-07-23 19:13:54 +000089/*
90 * To specify the default size of the image cache, undefine this and set it to
91 * the desired value (in bytes). SkGraphics.h as a runtime API to set this
92 * value as well. If this is undefined, a built-in value will be used.
93 */
94//#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024)
95
reed@google.comc27b7412011-09-13 17:20:30 +000096/* Define this to set the upper limit for text to support LCD. Values that
97 are very large increase the cost in the font cache and draw slower, without
98 improving readability. If this is undefined, Skia will use its default
99 value (e.g. 48)
100 */
101//#define SK_MAX_SIZE_FOR_LCDTEXT 48
102
reed@android.com5c80ea12009-01-08 17:49:50 +0000103/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
104 which will run additional self-tests at startup. These can take a long time,
105 so this flag is optional.
106 */
reed@android.com8a1c16f2008-12-17 15:59:43 +0000107#ifdef SK_DEBUG
reed@android.com0f0cfae2009-10-13 13:33:16 +0000108//#define SK_SUPPORT_UNITTEST
reed@android.com8a1c16f2008-12-17 15:59:43 +0000109#endif
110
scroggob66365f2011-03-18 21:43:03 +0000111/* Change the ordering to work in X windows.
112 */
113#ifdef SK_SAMPLES_FOR_X
114 #define SK_R32_SHIFT 16
115 #define SK_G32_SHIFT 8
116 #define SK_B32_SHIFT 0
117 #define SK_A32_SHIFT 24
118#endif
119
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +0000120
121/* Determines whether to build code that supports the GPU backend. Some classes
122 that are not GPU-specific, such as SkShader subclasses, have optional code
123 that is used allows them to interact with the GPU backend. If you'd like to
124 omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu
125 directories from your include search path when you're not building the GPU
126 backend. Defaults to 1 (build the GPU code).
127 */
128//#define SK_SUPPORT_GPU 1
sugoi@google.com7775fd52012-11-21 15:47:04 +0000129
ericrk369e9372016-02-05 15:32:36 -0800130/* Skia makes use of histogram logging macros to trace the frequency of
131 * events. By default, Skia provides no-op versions of these macros.
132 * Skia consumers can provide their own definitions of these macros to
133 * integrate with their histogram collection backend.
134 */
135//#define SK_HISTOGRAM_BOOLEAN(name, value)
136//#define SK_HISTOGRAM_ENUMERATION(name, value, boundary_value)
137
reed@android.com8a1c16f2008-12-17 15:59:43 +0000138#endif