blob: 63fc90db7203f18682a80e7b200e51bd5bf57ef0 [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/* Scalars (the fractional value type in skia) can be implemented either as
41 floats or 16.16 integers (fixed). Exactly one of these two symbols must be
42 defined.
43*/
44//#define SK_SCALAR_IS_FLOAT
45//#define SK_SCALAR_IS_FIXED
46
47
reed@android.com5c80ea12009-01-08 17:49:50 +000048/* For some performance-critical scalar operations, skia will optionally work
49 around the standard float operators if it knows that the CPU does not have
50 native support for floats. If your environment uses software floating point,
51 define this flag.
52 */
53//#define SK_SOFTWARE_FLOAT
54
55
56/* Skia has lots of debug-only code. Often this is just null checks or other
57 parameter checking, but sometimes it can be quite intrusive (e.g. check that
58 each 32bit pixel is in premultiplied form). This code can be very useful
59 during development, but will slow things down in a shipping product.
reed@google.com9d0d1952011-01-28 22:19:22 +000060
reed@android.com5c80ea12009-01-08 17:49:50 +000061 By default, these mutually exclusive flags are defined in SkPreConfig.h,
62 based on the presence or absence of NDEBUG, but that decision can be changed
63 here.
64 */
65//#define SK_DEBUG
66//#define SK_RELEASE
67
djsollen@google.com077348c2012-10-22 20:23:32 +000068/* Skia has certain debug-only code that is extremely intensive even for debug
69 builds. This code is useful for diagnosing specific issues, but is not
70 generally applicable, therefore it must be explicitly enabled to avoid
71 the performance impact. By default these flags are undefined, but can be
72 enabled by uncommenting them below.
73 */
djsollen@google.com000dea72012-11-30 16:19:32 +000074//#define SK_DEBUG_GLYPH_CACHE
djsollen@google.com077348c2012-10-22 20:23:32 +000075//#define SK_DEBUG_PATH
76
robertphillips@google.comb74af872012-06-27 19:41:42 +000077/* To assist debugging, Skia provides an instance counting utility in
78 include/core/SkInstCount.h. This flag turns on and off that utility to
rmistry@google.comfbfcd562012-08-23 18:09:54 +000079 allow instance count tracking in either debug or release builds. By
robertphillips@google.comb74af872012-06-27 19:41:42 +000080 default it is enabled in debug but disabled in release.
81 */
bsalomon@google.com4e230682013-01-15 20:37:04 +000082//#define SK_ENABLE_INST_COUNT 1
reed@android.com5c80ea12009-01-08 17:49:50 +000083
84/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
85 it will call SK_CRASH(). If this is not defined it, it is defined in
86 SkPostConfig.h to write to an illegal address
87 */
88//#define SK_CRASH() *(int *)(uintptr_t)0 = 0
89
90
91/* preconfig will have attempted to determine the endianness of the system,
92 but you can change these mutually exclusive flags here.
93 */
94//#define SK_CPU_BENDIAN
95//#define SK_CPU_LENDIAN
96
bungeman@google.comf8d1aee2012-02-02 19:15:21 +000097/* Most compilers use the same bit endianness for bit flags in a byte as the
98 system byte endianness, and this is the default. If for some reason this
99 needs to be overridden, specify which of the mutually exclusive flags to
100 use. For example, some atom processors in certain configurations have big
101 endian byte order but little endian bit orders.
102*/
103//#define SK_UINT8_BITFIELD_BENDIAN
104//#define SK_UINT8_BITFIELD_LENDIAN
105
reed@android.com5c80ea12009-01-08 17:49:50 +0000106
107/* Some compilers don't support long long for 64bit integers. If yours does
108 not, define this to the appropriate type.
109 */
110//#define SkLONGLONG int64_t
111
112
reed@android.com5c80ea12009-01-08 17:49:50 +0000113/* To write debug messages to a console, skia will call SkDebugf(...) following
114 printf conventions (e.g. const char* format, ...). If you want to redirect
115 this to something other than printf, define yours here
116 */
117//#define SkDebugf(...) MyFunction(__VA_ARGS__)
118
reed@google.com77407ca2011-11-08 13:48:32 +0000119/*
120 * To specify a different default font cache limit, define this. If this is
121 * undefined, skia will use a built-in value.
122 */
123//#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024)
124
caryclark@google.com1eeaf0b2011-06-22 13:19:43 +0000125/* If defined, use CoreText instead of ATSUI on OS X.
126*/
127//#define SK_USE_MAC_CORE_TEXT
128
129
vandebo@chromium.orga09ef972010-12-01 22:17:20 +0000130/* If zlib is available and you want to support the flate compression
131 algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the
justinlin@google.comfffb2f12012-04-16 19:10:21 +0000132 include path. Alternatively, define SK_SYSTEM_ZLIB to use the system zlib
133 library specified as "#include <zlib.h>".
vandebo@chromium.orga09ef972010-12-01 22:17:20 +0000134 */
reed@google.comd6423292010-12-20 20:53:13 +0000135//#define SK_ZLIB_INCLUDE <zlib.h>
justinlin@google.comfffb2f12012-04-16 19:10:21 +0000136//#define SK_SYSTEM_ZLIB
vandebo@chromium.orga09ef972010-12-01 22:17:20 +0000137
vandebo@chromium.org094316b2011-03-04 03:15:13 +0000138/* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow
139 them, but modern PDF interpreters should handle them just fine.
140 */
141//#define SK_ALLOW_LARGE_PDF_SCALARS
142
vandebo@chromium.org1f165892011-07-26 02:11:41 +0000143/* Define this to provide font subsetter in PDF generation.
144 */
145//#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h"
146
reed@google.com9d0d1952011-01-28 22:19:22 +0000147/* Define this to remove dimension checks on bitmaps. Not all blits will be
148 correct yet, so this is mostly for debugging the implementation.
149 */
reed@google.com4b475d52012-08-07 13:19:01 +0000150#define SK_ALLOW_OVER_32K_BITMAPS
reed@google.com9d0d1952011-01-28 22:19:22 +0000151
reed@google.com34dc9a22012-09-27 15:46:45 +0000152/**
153 * To revert to int-only srcrect behavior in drawBitmapRect(ToRect),
154 * define this symbol.
155 */
156//#define SK_SUPPORT_INT_SRCRECT_DRAWBITMAPRECT
157
reed@google.comc27b7412011-09-13 17:20:30 +0000158/* Define this to set the upper limit for text to support LCD. Values that
159 are very large increase the cost in the font cache and draw slower, without
160 improving readability. If this is undefined, Skia will use its default
161 value (e.g. 48)
162 */
163//#define SK_MAX_SIZE_FOR_LCDTEXT 48
164
reed@android.com5c80ea12009-01-08 17:49:50 +0000165/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
166 which will run additional self-tests at startup. These can take a long time,
167 so this flag is optional.
168 */
reed@android.com8a1c16f2008-12-17 15:59:43 +0000169#ifdef SK_DEBUG
reed@android.com0f0cfae2009-10-13 13:33:16 +0000170//#define SK_SUPPORT_UNITTEST
reed@android.com8a1c16f2008-12-17 15:59:43 +0000171#endif
172
tomhudson@google.com0c8d93a2011-07-01 17:08:26 +0000173/* If your system embeds skia and has complex event logging, define this
174 symbol to name a file that maps the following macros to your system's
tomhudson@google.com278cbb42011-06-30 19:37:01 +0000175 equivalents:
176 SK_TRACE_EVENT0(event)
177 SK_TRACE_EVENT1(event, name1, value1)
178 SK_TRACE_EVENT2(event, name1, value1, name2, value2)
tomhudson@google.com278cbb42011-06-30 19:37:01 +0000179 src/utils/SkDebugTrace.h has a trivial implementation that writes to
tomhudson@google.com0c8d93a2011-07-01 17:08:26 +0000180 the debug output stream. If SK_USER_TRACE_INCLUDE_FILE is not defined,
181 SkTrace.h will define the above three macros to do nothing.
tomhudson@google.com278cbb42011-06-30 19:37:01 +0000182*/
tomhudson@google.com0c8d93a2011-07-01 17:08:26 +0000183//#undef SK_USER_TRACE_INCLUDE_FILE
tomhudson@google.com278cbb42011-06-30 19:37:01 +0000184
scroggob66365f2011-03-18 21:43:03 +0000185/* Change the ordering to work in X windows.
186 */
187#ifdef SK_SAMPLES_FOR_X
188 #define SK_R32_SHIFT 16
189 #define SK_G32_SHIFT 8
190 #define SK_B32_SHIFT 0
191 #define SK_A32_SHIFT 24
192#endif
193
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +0000194
195/* Determines whether to build code that supports the GPU backend. Some classes
196 that are not GPU-specific, such as SkShader subclasses, have optional code
197 that is used allows them to interact with the GPU backend. If you'd like to
198 omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu
199 directories from your include search path when you're not building the GPU
200 backend. Defaults to 1 (build the GPU code).
201 */
202//#define SK_SUPPORT_GPU 1
sugoi@google.com7775fd52012-11-21 15:47:04 +0000203
reed@android.com8a1c16f2008-12-17 15:59:43 +0000204#endif