blob: 80ecdb6433eb96f8764c683f3037684c43201479 [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef SkUserConfig_DEFINED
18#define SkUserConfig_DEFINED
19
reed@android.com5c80ea12009-01-08 17:49:50 +000020/* SkTypes.h, the root of the public header files, does the following trick:
reed@google.com9d0d1952011-01-28 22:19:22 +000021
reed@android.com5c80ea12009-01-08 17:49:50 +000022 #include "SkPreConfig.h"
23 #include "SkUserConfig.h"
24 #include "SkPostConfig.h"
reed@google.com9d0d1952011-01-28 22:19:22 +000025
reed@android.com5c80ea12009-01-08 17:49:50 +000026 SkPreConfig.h runs first, and it is responsible for initializing certain
27 skia defines.
reed@google.com9d0d1952011-01-28 22:19:22 +000028
reed@android.com5c80ea12009-01-08 17:49:50 +000029 SkPostConfig.h runs last, and its job is to just check that the final
30 defines are consistent (i.e. that we don't have mutually conflicting
31 defines).
reed@google.com9d0d1952011-01-28 22:19:22 +000032
reed@android.com5c80ea12009-01-08 17:49:50 +000033 SkUserConfig.h (this file) runs in the middle. It gets to change or augment
34 the list of flags initially set in preconfig, and then postconfig checks
35 that everything still makes sense.
reed@android.com8a1c16f2008-12-17 15:59:43 +000036
reed@android.com5c80ea12009-01-08 17:49:50 +000037 Below are optional defines that add, subtract, or change default behavior
38 in Skia. Your port can locally edit this file to enable/disable flags as
39 you choose, or these can be delared on your command line (i.e. -Dfoo).
reed@android.com8a1c16f2008-12-17 15:59:43 +000040
reed@android.com5c80ea12009-01-08 17:49:50 +000041 By default, this include file will always default to having all of the flags
42 commented out, so including it will have no effect.
reed@android.com8a1c16f2008-12-17 15:59:43 +000043*/
44
reed@android.com5c80ea12009-01-08 17:49:50 +000045///////////////////////////////////////////////////////////////////////////////
reed@android.com8a1c16f2008-12-17 15:59:43 +000046
reed@android.com5c80ea12009-01-08 17:49:50 +000047/* Scalars (the fractional value type in skia) can be implemented either as
48 floats or 16.16 integers (fixed). Exactly one of these two symbols must be
49 defined.
50*/
51//#define SK_SCALAR_IS_FLOAT
52//#define SK_SCALAR_IS_FIXED
53
54
55/* Somewhat independent of how SkScalar is implemented, Skia also wants to know
56 if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined,
epoger@google.com2047f002011-05-17 17:36:59 +000057 SK_CAN_USE_FLOAT must be too; but if scalars are fixed, SK_CAN_USE_FLOAT
reed@android.com5c80ea12009-01-08 17:49:50 +000058 can go either way.
59 */
60//#define SK_CAN_USE_FLOAT
61
62/* For some performance-critical scalar operations, skia will optionally work
63 around the standard float operators if it knows that the CPU does not have
64 native support for floats. If your environment uses software floating point,
65 define this flag.
66 */
67//#define SK_SOFTWARE_FLOAT
68
69
70/* Skia has lots of debug-only code. Often this is just null checks or other
71 parameter checking, but sometimes it can be quite intrusive (e.g. check that
72 each 32bit pixel is in premultiplied form). This code can be very useful
73 during development, but will slow things down in a shipping product.
reed@google.com9d0d1952011-01-28 22:19:22 +000074
reed@android.com5c80ea12009-01-08 17:49:50 +000075 By default, these mutually exclusive flags are defined in SkPreConfig.h,
76 based on the presence or absence of NDEBUG, but that decision can be changed
77 here.
78 */
79//#define SK_DEBUG
80//#define SK_RELEASE
81
82
83/* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger)
84 it will call SK_CRASH(). If this is not defined it, it is defined in
85 SkPostConfig.h to write to an illegal address
86 */
87//#define SK_CRASH() *(int *)(uintptr_t)0 = 0
88
89
90/* preconfig will have attempted to determine the endianness of the system,
91 but you can change these mutually exclusive flags here.
92 */
93//#define SK_CPU_BENDIAN
94//#define SK_CPU_LENDIAN
95
96
97/* Some compilers don't support long long for 64bit integers. If yours does
98 not, define this to the appropriate type.
99 */
100//#define SkLONGLONG int64_t
101
102
103/* Some envorinments do not suport writable globals (eek!). If yours does not,
104 define this flag.
105 */
106//#define SK_USE_RUNTIME_GLOBALS
107
108
109/* To write debug messages to a console, skia will call SkDebugf(...) following
110 printf conventions (e.g. const char* format, ...). If you want to redirect
111 this to something other than printf, define yours here
112 */
113//#define SkDebugf(...) MyFunction(__VA_ARGS__)
114
reed@android.comf5493692009-07-22 19:21:01 +0000115/* To enable additional blitters (and fontscaler code) to support separate
116 alpha channels for R G B channels, define SK_SUPPORT_LCDTEXT
117 */
reed@android.com36a4c2a2009-07-22 19:52:11 +0000118//#define SK_SUPPORT_LCDTEXT
reed@android.com5c80ea12009-01-08 17:49:50 +0000119
caryclark@google.com1eeaf0b2011-06-22 13:19:43 +0000120/* Define this to pack glyphs using 8 bits per component instead of 5-6-5.
121 This will double the size of the font cache, but will produce fonts with
122 gray levels closer to the designer's intent.
123*/
124//#define SK_SUPPORT_888_TEXT
125
126/* If defined, use CoreText instead of ATSUI on OS X.
127*/
128//#define SK_USE_MAC_CORE_TEXT
129
130
vandebo@chromium.orga09ef972010-12-01 22:17:20 +0000131/* If zlib is available and you want to support the flate compression
132 algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the
133 include path.
134 */
reed@google.comd6423292010-12-20 20:53:13 +0000135//#define SK_ZLIB_INCLUDE <zlib.h>
vandebo@chromium.orga09ef972010-12-01 22:17:20 +0000136
vandebo@chromium.org094316b2011-03-04 03:15:13 +0000137/* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow
138 them, but modern PDF interpreters should handle them just fine.
139 */
140//#define SK_ALLOW_LARGE_PDF_SCALARS
141
reed@google.com9d0d1952011-01-28 22:19:22 +0000142/* Define this to remove dimension checks on bitmaps. Not all blits will be
143 correct yet, so this is mostly for debugging the implementation.
144 */
145//#define SK_ALLOW_OVER_32K_BITMAPS
146
reed@android.com5c80ea12009-01-08 17:49:50 +0000147/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
148 which will run additional self-tests at startup. These can take a long time,
149 so this flag is optional.
150 */
reed@android.com8a1c16f2008-12-17 15:59:43 +0000151#ifdef SK_DEBUG
reed@android.com0f0cfae2009-10-13 13:33:16 +0000152//#define SK_SUPPORT_UNITTEST
reed@android.com8a1c16f2008-12-17 15:59:43 +0000153#endif
154
scroggob66365f2011-03-18 21:43:03 +0000155/* Change the ordering to work in X windows.
156 */
157#ifdef SK_SAMPLES_FOR_X
158 #define SK_R32_SHIFT 16
159 #define SK_G32_SHIFT 8
160 #define SK_B32_SHIFT 0
161 #define SK_A32_SHIFT 24
162#endif
163
reed@android.com8a1c16f2008-12-17 15:59:43 +0000164#endif