1 2 /* 3 * Copyright 2006 The Android Open Source Project 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9 10 #ifndef SkUserConfig_DEFINED 11 #define SkUserConfig_DEFINED 12 13 /* SkTypes.h, the root of the public header files, does the following trick: 14 15 #include "SkPreConfig.h" 16 #include "SkUserConfig.h" 17 #include "SkPostConfig.h" 18 19 SkPreConfig.h runs first, and it is responsible for initializing certain 20 skia defines. 21 22 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). 25 26 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. 29 30 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). 33 34 By default, this include file will always default to having all of the flags 35 commented out, so including it will have no effect. 36 */ 37 38 /////////////////////////////////////////////////////////////////////////////// 39 40 // 41 // ANDROID Specific changes - NO NOT CHECK BACK INTO code.google.com/p/skia 42 // 43 44 #define PICTURE_VERSION_ICS 1 // r1562 of Skia 45 #define PICTURE_VERSION_JB 2 46 47 // do this build check for other tools that still read this header 48 #ifdef ANDROID 49 #include <utils/misc.h> 50 #endif 51 52 #define SK_USE_POSIX_THREADS 53 54 /* Scalars (the fractional value type in skia) can be implemented either as 55 floats or 16.16 integers (fixed). Exactly one of these two symbols must be 56 defined. 57 */ 58 #define SK_SCALAR_IS_FLOAT 59 #undef SK_SCALAR_IS_FIXED 60 61 62 /* Somewhat independent of how SkScalar is implemented, Skia also wants to know 63 if it can use floats at all. Naturally, if SK_SCALAR_IS_FLOAT is defined, 64 SK_CAN_USE_FLOAT must be too; but if scalars are fixed, SK_CAN_USE_FLOAT 65 can go either way. 66 */ 67 #define SK_CAN_USE_FLOAT 68 69 /* For some performance-critical scalar operations, skia will optionally work 70 around the standard float operators if it knows that the CPU does not have 71 native support for floats. If your environment uses software floating point, 72 define this flag. 73 */ 74 //#define SK_SOFTWARE_FLOAT 75 76 77 /* Skia has lots of debug-only code. Often this is just null checks or other 78 parameter checking, but sometimes it can be quite intrusive (e.g. check that 79 each 32bit pixel is in premultiplied form). This code can be very useful 80 during development, but will slow things down in a shipping product. 81 82 By default, these mutually exclusive flags are defined in SkPreConfig.h, 83 based on the presence or absence of NDEBUG, but that decision can be changed 84 here. 85 */ 86 //#define SK_DEBUG 87 //#define SK_RELEASE 88 89 90 /* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger) 91 it will call SK_CRASH(). If this is not defined it, it is defined in 92 SkPostConfig.h to write to an illegal address 93 */ 94 //#define SK_CRASH() *(int *)(uintptr_t)0 = 0 95 96 97 /* preconfig will have attempted to determine the endianness of the system, 98 but you can change these mutually exclusive flags here. 99 */ 100 #if __BYTE_ORDER == __BIG_ENDIAN 101 #define SK_CPU_BENDIAN 102 #undef SK_CPU_LENDIAN 103 #else 104 #define SK_CPU_LENDIAN 105 #undef SK_CPU_BENDIAN 106 #endif 107 108 109 /* Some compilers don't support long long for 64bit integers. If yours does 110 not, define this to the appropriate type. 111 */ 112 #define SkLONGLONG int64_t 113 114 115 /* To write debug messages to a console, skia will call SkDebugf(...) following 116 printf conventions (e.g. const char* format, ...). If you want to redirect 117 this to something other than printf, define yours here 118 */ 119 //#define SkDebugf(...) MyFunction(__VA_ARGS__) 120 121 /* 122 * To specify a different default font cache limit, define this. If this is 123 * undefined, skia will use a built-in value. 124 */ 125 #define SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024) 126 127 /* If defined, use CoreText instead of ATSUI on OS X. 128 */ 129 //#define SK_USE_MAC_CORE_TEXT 130 131 132 /* If zlib is available and you want to support the flate compression 133 algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the 134 include path. 135 */ 136 //#define SK_ZLIB_INCLUDE <zlib.h> 137 138 /* 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 143 /* Define this to provide font subsetter in PDF generation. 144 */ 145 //#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h" 146 147 /* 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 */ 150 //#define SK_ALLOW_OVER_32K_BITMAPS 151 152 /* Define this to set the upper limit for text to support LCD. Values that 153 are very large increase the cost in the font cache and draw slower, without 154 improving readability. If this is undefined, Skia will use its default 155 value (e.g. 48) 156 */ 157 //#define SK_MAX_SIZE_FOR_LCDTEXT 48 158 159 /* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST 160 which will run additional self-tests at startup. These can take a long time, 161 so this flag is optional. 162 */ 163 #ifdef SK_DEBUG 164 #define SK_SUPPORT_UNITTEST 165 #endif 166 167 /* If your system embeds skia and has complex event logging, define this 168 symbol to name a file that maps the following macros to your system's 169 equivalents: 170 SK_TRACE_EVENT0(event) 171 SK_TRACE_EVENT1(event, name1, value1) 172 SK_TRACE_EVENT2(event, name1, value1, name2, value2) 173 src/utils/SkDebugTrace.h has a trivial implementation that writes to 174 the debug output stream. If SK_USER_TRACE_INCLUDE_FILE is not defined, 175 SkTrace.h will define the above three macros to do nothing. 176 */ 177 //#undef SK_USER_TRACE_INCLUDE_FILE 178 179 /* Change the ordering to work in X windows. 180 */ 181 #ifdef SK_SAMPLES_FOR_X 182 #define SK_R32_SHIFT 16 183 #define SK_G32_SHIFT 8 184 #define SK_B32_SHIFT 0 185 #define SK_A32_SHIFT 24 186 #endif 187 188 #endif 189