michael@0: michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: #ifndef SkUserConfig_DEFINED michael@0: #define SkUserConfig_DEFINED michael@0: michael@0: /* SkTypes.h, the root of the public header files, does the following trick: michael@0: michael@0: #include "SkPreConfig.h" michael@0: #include "SkUserConfig.h" michael@0: #include "SkPostConfig.h" michael@0: michael@0: SkPreConfig.h runs first, and it is responsible for initializing certain michael@0: skia defines. michael@0: michael@0: SkPostConfig.h runs last, and its job is to just check that the final michael@0: defines are consistent (i.e. that we don't have mutually conflicting michael@0: defines). michael@0: michael@0: SkUserConfig.h (this file) runs in the middle. It gets to change or augment michael@0: the list of flags initially set in preconfig, and then postconfig checks michael@0: that everything still makes sense. michael@0: michael@0: Below are optional defines that add, subtract, or change default behavior michael@0: in Skia. Your port can locally edit this file to enable/disable flags as michael@0: you choose, or these can be delared on your command line (i.e. -Dfoo). michael@0: michael@0: By default, this include file will always default to having all of the flags michael@0: commented out, so including it will have no effect. michael@0: */ michael@0: michael@0: /////////////////////////////////////////////////////////////////////////////// michael@0: michael@0: /* Skia has lots of debug-only code. Often this is just null checks or other michael@0: parameter checking, but sometimes it can be quite intrusive (e.g. check that michael@0: each 32bit pixel is in premultiplied form). This code can be very useful michael@0: during development, but will slow things down in a shipping product. michael@0: michael@0: By default, these mutually exclusive flags are defined in SkPreConfig.h, michael@0: based on the presence or absence of NDEBUG, but that decision can be changed michael@0: here. michael@0: */ michael@0: //#define SK_DEBUG michael@0: //#define SK_RELEASE michael@0: michael@0: /* Skia has certain debug-only code that is extremely intensive even for debug michael@0: builds. This code is useful for diagnosing specific issues, but is not michael@0: generally applicable, therefore it must be explicitly enabled to avoid michael@0: the performance impact. By default these flags are undefined, but can be michael@0: enabled by uncommenting them below. michael@0: */ michael@0: //#define SK_DEBUG_GLYPH_CACHE michael@0: //#define SK_DEBUG_PATH michael@0: michael@0: /* To assist debugging, Skia provides an instance counting utility in michael@0: include/core/SkInstCount.h. This flag turns on and off that utility to michael@0: allow instance count tracking in either debug or release builds. By michael@0: default it is enabled in debug but disabled in release. michael@0: */ michael@0: #define SK_ENABLE_INST_COUNT 0 michael@0: michael@0: /* If, in debugging mode, Skia needs to stop (presumably to invoke a debugger) michael@0: it will call SK_CRASH(). If this is not defined it, it is defined in michael@0: SkPostConfig.h to write to an illegal address michael@0: */ michael@0: //#define SK_CRASH() *(int *)(uintptr_t)0 = 0 michael@0: michael@0: michael@0: /* preconfig will have attempted to determine the endianness of the system, michael@0: but you can change these mutually exclusive flags here. michael@0: */ michael@0: //#define SK_CPU_BENDIAN michael@0: //#define SK_CPU_LENDIAN michael@0: michael@0: /* Most compilers use the same bit endianness for bit flags in a byte as the michael@0: system byte endianness, and this is the default. If for some reason this michael@0: needs to be overridden, specify which of the mutually exclusive flags to michael@0: use. For example, some atom processors in certain configurations have big michael@0: endian byte order but little endian bit orders. michael@0: */ michael@0: //#define SK_UINT8_BITFIELD_BENDIAN michael@0: //#define SK_UINT8_BITFIELD_LENDIAN michael@0: michael@0: michael@0: /* To write debug messages to a console, skia will call SkDebugf(...) following michael@0: printf conventions (e.g. const char* format, ...). If you want to redirect michael@0: this to something other than printf, define yours here michael@0: */ michael@0: //#define SkDebugf(...) MyFunction(__VA_ARGS__) michael@0: michael@0: /* michael@0: * To specify a different default font cache limit, define this. If this is michael@0: * undefined, skia will use a built-in value. michael@0: */ michael@0: //#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024) michael@0: michael@0: /* michael@0: * To specify the default size of the image cache, undefine this and set it to michael@0: * the desired value (in bytes). SkGraphics.h as a runtime API to set this michael@0: * value as well. If this is undefined, a built-in value will be used. michael@0: */ michael@0: //#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024) michael@0: michael@0: /* If zlib is available and you want to support the flate compression michael@0: algorithm (used in PDF generation), define SK_ZLIB_INCLUDE to be the michael@0: include path. Alternatively, define SK_SYSTEM_ZLIB to use the system zlib michael@0: library specified as "#include ". michael@0: */ michael@0: //#define SK_ZLIB_INCLUDE michael@0: //#define SK_SYSTEM_ZLIB michael@0: michael@0: /* Define this to allow PDF scalars above 32k. The PDF/A spec doesn't allow michael@0: them, but modern PDF interpreters should handle them just fine. michael@0: */ michael@0: //#define SK_ALLOW_LARGE_PDF_SCALARS michael@0: michael@0: /* Define this to provide font subsetter in PDF generation. michael@0: */ michael@0: //#define SK_SFNTLY_SUBSETTER "sfntly/subsetter/font_subsetter.h" michael@0: michael@0: /* Define this to set the upper limit for text to support LCD. Values that michael@0: are very large increase the cost in the font cache and draw slower, without michael@0: improving readability. If this is undefined, Skia will use its default michael@0: value (e.g. 48) michael@0: */ michael@0: //#define SK_MAX_SIZE_FOR_LCDTEXT 48 michael@0: michael@0: /* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST michael@0: which will run additional self-tests at startup. These can take a long time, michael@0: so this flag is optional. michael@0: */ michael@0: #ifdef SK_DEBUG michael@0: //#define SK_SUPPORT_UNITTEST michael@0: #endif michael@0: michael@0: /* If your system embeds skia and has complex event logging, define this michael@0: symbol to name a file that maps the following macros to your system's michael@0: equivalents: michael@0: SK_TRACE_EVENT0(event) michael@0: SK_TRACE_EVENT1(event, name1, value1) michael@0: SK_TRACE_EVENT2(event, name1, value1, name2, value2) michael@0: src/utils/SkDebugTrace.h has a trivial implementation that writes to michael@0: the debug output stream. If SK_USER_TRACE_INCLUDE_FILE is not defined, michael@0: SkTrace.h will define the above three macros to do nothing. michael@0: */ michael@0: //#undef SK_USER_TRACE_INCLUDE_FILE michael@0: michael@0: /* Change the ordering to work in X windows. michael@0: */ michael@0: #ifdef SK_SAMPLES_FOR_X michael@0: #define SK_R32_SHIFT 16 michael@0: #define SK_G32_SHIFT 8 michael@0: #define SK_B32_SHIFT 0 michael@0: #define SK_A32_SHIFT 24 michael@0: #endif michael@0: michael@0: michael@0: /* Determines whether to build code that supports the GPU backend. Some classes michael@0: that are not GPU-specific, such as SkShader subclasses, have optional code michael@0: that is used allows them to interact with the GPU backend. If you'd like to michael@0: omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu michael@0: directories from your include search path when you're not building the GPU michael@0: backend. Defaults to 1 (build the GPU code). michael@0: */ michael@0: //#define SK_SUPPORT_GPU 1 michael@0: michael@0: michael@0: /* The PDF generation code uses Path Ops to generate inverse fills and complex michael@0: * clipping paths, but at this time, Path Ops is not release ready yet. So, michael@0: * the code is hidden behind this #define guard. If you are feeling adventurous michael@0: * and want the latest and greatest PDF generation code, uncomment the #define. michael@0: * When Path Ops is release ready, the define guards and this user config michael@0: * define should be removed entirely. michael@0: */ michael@0: //#define SK_PDF_USE_PATHOPS michael@0: michael@0: /* Skia uses these defines as the target of include preprocessor directives. michael@0: * The header files pointed to by these defines provide declarations and michael@0: * possibly inline implementations of threading primitives. michael@0: * michael@0: * See SkThread.h for documentation on what these includes must contain. michael@0: */ michael@0: //#define SK_ATOMICS_PLATFORM_H "SkAtomics_xxx.h" michael@0: //#define SK_MUTEX_PLATFORM_H "SkMutex_xxx.h" michael@0: # if defined(_MSC_VER) michael@0: # define SK_ATOMICS_PLATFORM_H "skia/SkAtomics_win.h" michael@0: # elif defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) michael@0: # define SK_ATOMICS_PLATFORM_H "skia/SkAtomics_android.h" michael@0: # else michael@0: # define SK_ATOMICS_PLATFORM_H "skia/SkAtomics_sync.h" michael@0: # endif michael@0: michael@0: # if defined(SK_BUILD_FOR_WIN32) michael@0: # define SK_MUTEX_PLATFORM_H "skia/SkMutex_win.h" michael@0: # else michael@0: # define SK_MUTEX_PLATFORM_H "skia/SkMutex_pthread.h" michael@0: # endif michael@0: #endif michael@0: michael@0: #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0 michael@0: michael@0: #define SK_SUPPORT_LEGACY_LAYERRASTERIZER_API 1 michael@0: #define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG 1 michael@0: #define SK_SUPPORT_LEGACY_GETTOTALCLIP 1