blob: 75e929203c45692a76c0e92fb1c05b5228f99244 [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
48/* Somewhat independent of how SkScalar is implemented, Skia also wants to know
49 if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined,
epoger@google.com2047f002011-05-17 17:36:59 +000050 SK_CAN_USE_FLOAT must be too; but if scalars are fixed, SK_CAN_USE_FLOAT
reed@android.com5c80ea12009-01-08 17:49:50 +000051 can go either way.
52 */
53//#define SK_CAN_USE_FLOAT
54
55/* For some performance-critical scalar operations, skia will optionally work
56 around the standard float operators if it knows that the CPU does not have
57 native support for floats. If your environment uses software floating point,
58 define this flag.
59 */
60//#define SK_SOFTWARE_FLOAT
61
62
63/* Skia has lots of debug-only code. Often this is just null checks or other
64 parameter checking, but sometimes it can be quite intrusive (e.g. check that
65 each 32bit pixel is in premultiplied form). This code can be very useful
66 during development, but will slow things down in a shipping product.
reed@google.com9d0d1952011-01-28 22:19:22 +000067
reed@android.com5c80ea12009-01-08 17:49:50 +000068 By default, these mutually exclusive flags are defined in SkPreConfig.h,
69 based on the presence or absence of NDEBUG, but that decision can be changed
70 here.
71 */
72//#define SK_DEBUG
73//#define SK_RELEASE
74
75
76/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
77 it will call SK_CRASH(). If this is not defined it, it is defined in
78 SkPostConfig.h to write to an illegal address
79 */
80//#define SK_CRASH() *(int *)(uintptr_t)0 = 0
81
82
83/* preconfig will have attempted to determine the endianness of the system,
84 but you can change these mutually exclusive flags here.
85 */
86//#define SK_CPU_BENDIAN
87//#define SK_CPU_LENDIAN
88
bungeman@google.comf8d1aee2012-02-02 19:15:21 +000089/* Most compilers use the same bit endianness for bit flags in a byte as the
90 system byte endianness, and this is the default. If for some reason this
91 needs to be overridden, specify which of the mutually exclusive flags to
92 use. For example, some atom processors in certain configurations have big
93 endian byte order but little endian bit orders.
94*/
95//#define SK_UINT8_BITFIELD_BENDIAN
96//#define SK_UINT8_BITFIELD_LENDIAN
97
reed@android.com5c80ea12009-01-08 17:49:50 +000098
99/* Some compilers don't support long long for 64bit integers. If yours does
100 not, define this to the appropriate type.
101 */
102//#define SkLONGLONG int64_t
103
104
reed@android.com5c80ea12009-01-08 17:49:50 +0000105/* To write debug messages to a console, skia will call SkDebugf(...) following
106 printf conventions (e.g. const char* format, ...). If you want to redirect
107 this to something other than printf, define yours here
108 */
109//#define SkDebugf(...) MyFunction(__VA_ARGS__)
110
reed@google.com77407ca2011-11-08 13:48:32 +0000111/*
112 * To specify a different default font cache limit, define this. If this is
113 * undefined, skia will use a built-in value.
114 */
115//#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024)
116
caryclark@google.com1eeaf0b2011-06-22 13:19:43 +0000117/* If defined, use CoreText instead of ATSUI on OS X.
118*/
119//#define SK_USE_MAC_CORE_TEXT
120
121
vandebo@chromium.orga09ef972010-12-01 22:17:20 +0000122/* If zlib is available and you want to support the flate compression
123 algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the
124 include path.
125 */
reed@google.comd6423292010-12-20 20:53:13 +0000126//#define SK_ZLIB_INCLUDE <zlib.h>
vandebo@chromium.orga09ef972010-12-01 22:17:20 +0000127
vandebo@chromium.org094316b2011-03-04 03:15:13 +0000128/* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow
129 them, but modern PDF interpreters should handle them just fine.
130 */
131//#define SK_ALLOW_LARGE_PDF_SCALARS
132
vandebo@chromium.org1f165892011-07-26 02:11:41 +0000133/* Define this to provide font subsetter in PDF generation.
134 */
135//#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h"
136
reed@google.com9d0d1952011-01-28 22:19:22 +0000137/* Define this to remove dimension checks on bitmaps. Not all blits will be
138 correct yet, so this is mostly for debugging the implementation.
139 */
140//#define SK_ALLOW_OVER_32K_BITMAPS
141
reed@google.comc27b7412011-09-13 17:20:30 +0000142/* Define this to set the upper limit for text to support LCD. Values that
143 are very large increase the cost in the font cache and draw slower, without
144 improving readability. If this is undefined, Skia will use its default
145 value (e.g. 48)
146 */
147//#define SK_MAX_SIZE_FOR_LCDTEXT 48
148
reed@android.com5c80ea12009-01-08 17:49:50 +0000149/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
150 which will run additional self-tests at startup. These can take a long time,
151 so this flag is optional.
152 */
reed@android.com8a1c16f2008-12-17 15:59:43 +0000153#ifdef SK_DEBUG
reed@android.com0f0cfae2009-10-13 13:33:16 +0000154//#define SK_SUPPORT_UNITTEST
reed@android.com8a1c16f2008-12-17 15:59:43 +0000155#endif
156
tomhudson@google.com0c8d93a2011-07-01 17:08:26 +0000157/* If your system embeds skia and has complex event logging, define this
158 symbol to name a file that maps the following macros to your system's
tomhudson@google.com278cbb42011-06-30 19:37:01 +0000159 equivalents:
160 SK_TRACE_EVENT0(event)
161 SK_TRACE_EVENT1(event, name1, value1)
162 SK_TRACE_EVENT2(event, name1, value1, name2, value2)
tomhudson@google.com278cbb42011-06-30 19:37:01 +0000163 src/utils/SkDebugTrace.h has a trivial implementation that writes to
tomhudson@google.com0c8d93a2011-07-01 17:08:26 +0000164 the debug output stream. If SK_USER_TRACE_INCLUDE_FILE is not defined,
165 SkTrace.h will define the above three macros to do nothing.
tomhudson@google.com278cbb42011-06-30 19:37:01 +0000166*/
tomhudson@google.com0c8d93a2011-07-01 17:08:26 +0000167//#undef SK_USER_TRACE_INCLUDE_FILE
tomhudson@google.com278cbb42011-06-30 19:37:01 +0000168
scroggob66365f2011-03-18 21:43:03 +0000169/* Change the ordering to work in X windows.
170 */
171#ifdef SK_SAMPLES_FOR_X
172 #define SK_R32_SHIFT 16
173 #define SK_G32_SHIFT 8
174 #define SK_B32_SHIFT 0
175 #define SK_A32_SHIFT 24
176#endif
177
reed@android.com8a1c16f2008-12-17 15:59:43 +0000178#endif