1cb93a386Sopenharmony_ci 2cb93a386Sopenharmony_ci/* 3cb93a386Sopenharmony_ci * Copyright 2006 The Android Open Source Project 4cb93a386Sopenharmony_ci * 5cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be 6cb93a386Sopenharmony_ci * found in the LICENSE file. 7cb93a386Sopenharmony_ci */ 8cb93a386Sopenharmony_ci 9cb93a386Sopenharmony_ci 10cb93a386Sopenharmony_ci#ifndef SkUserConfig_DEFINED 11cb93a386Sopenharmony_ci#define SkUserConfig_DEFINED 12cb93a386Sopenharmony_ci 13cb93a386Sopenharmony_ci/* SkTypes.h, the root of the public header files, includes this file 14cb93a386Sopenharmony_ci SkUserConfig.h after first initializing certain Skia defines, letting 15cb93a386Sopenharmony_ci this file change or augment those flags. 16cb93a386Sopenharmony_ci 17cb93a386Sopenharmony_ci Below are optional defines that add, subtract, or change default behavior 18cb93a386Sopenharmony_ci in Skia. Your port can locally edit this file to enable/disable flags as 19cb93a386Sopenharmony_ci you choose, or these can be delared on your command line (i.e. -Dfoo). 20cb93a386Sopenharmony_ci 21cb93a386Sopenharmony_ci By default, this include file will always default to having all of the flags 22cb93a386Sopenharmony_ci commented out, so including it will have no effect. 23cb93a386Sopenharmony_ci*/ 24cb93a386Sopenharmony_ci 25cb93a386Sopenharmony_ci/////////////////////////////////////////////////////////////////////////////// 26cb93a386Sopenharmony_ci 27cb93a386Sopenharmony_ci/* Skia has lots of debug-only code. Often this is just null checks or other 28cb93a386Sopenharmony_ci parameter checking, but sometimes it can be quite intrusive (e.g. check that 29cb93a386Sopenharmony_ci each 32bit pixel is in premultiplied form). This code can be very useful 30cb93a386Sopenharmony_ci during development, but will slow things down in a shipping product. 31cb93a386Sopenharmony_ci 32cb93a386Sopenharmony_ci By default, these mutually exclusive flags are defined in SkTypes.h, 33cb93a386Sopenharmony_ci based on the presence or absence of NDEBUG, but that decision can be changed 34cb93a386Sopenharmony_ci here. 35cb93a386Sopenharmony_ci */ 36cb93a386Sopenharmony_ci//#define SK_DEBUG 37cb93a386Sopenharmony_ci//#define SK_RELEASE 38cb93a386Sopenharmony_ci 39cb93a386Sopenharmony_ci/* To write debug messages to a console, skia will call SkDebugf(...) following 40cb93a386Sopenharmony_ci printf conventions (e.g. const char* format, ...). If you want to redirect 41cb93a386Sopenharmony_ci this to something other than printf, define yours here 42cb93a386Sopenharmony_ci */ 43cb93a386Sopenharmony_ci//#define SkDebugf(...) MyFunction(__VA_ARGS__) 44cb93a386Sopenharmony_ci 45cb93a386Sopenharmony_ci/* 46cb93a386Sopenharmony_ci * To specify a different default font cache limit, define this. If this is 47cb93a386Sopenharmony_ci * undefined, skia will use a built-in value. 48cb93a386Sopenharmony_ci */ 49cb93a386Sopenharmony_ci//#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024) 50cb93a386Sopenharmony_ci 51cb93a386Sopenharmony_ci/* 52cb93a386Sopenharmony_ci * To specify the default size of the image cache, undefine this and set it to 53cb93a386Sopenharmony_ci * the desired value (in bytes). SkGraphics.h as a runtime API to set this 54cb93a386Sopenharmony_ci * value as well. If this is undefined, a built-in value will be used. 55cb93a386Sopenharmony_ci */ 56cb93a386Sopenharmony_ci//#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024) 57cb93a386Sopenharmony_ci 58cb93a386Sopenharmony_ci/* Define this to set the upper limit for text to support LCD. Values that 59cb93a386Sopenharmony_ci are very large increase the cost in the font cache and draw slower, without 60cb93a386Sopenharmony_ci improving readability. If this is undefined, Skia will use its default 61cb93a386Sopenharmony_ci value (e.g. 48) 62cb93a386Sopenharmony_ci */ 63cb93a386Sopenharmony_ci//#define SK_MAX_SIZE_FOR_LCDTEXT 48 64cb93a386Sopenharmony_ci 65cb93a386Sopenharmony_ci/* Change the kN32_SkColorType ordering to BGRA to work in X windows. 66cb93a386Sopenharmony_ci */ 67cb93a386Sopenharmony_ci//#define SK_R32_SHIFT 16 68cb93a386Sopenharmony_ci 69cb93a386Sopenharmony_ci 70cb93a386Sopenharmony_ci/* Determines whether to build code that supports the GPU backend. Some classes 71cb93a386Sopenharmony_ci that are not GPU-specific, such as SkShader subclasses, have optional code 72cb93a386Sopenharmony_ci that is used allows them to interact with the GPU backend. If you'd like to 73cb93a386Sopenharmony_ci omit this code set SK_SUPPORT_GPU to 0. This also allows you to omit the gpu 74cb93a386Sopenharmony_ci directories from your include search path when you're not building the GPU 75cb93a386Sopenharmony_ci backend. Defaults to 1 (build the GPU code). 76cb93a386Sopenharmony_ci */ 77cb93a386Sopenharmony_ci//#define SK_SUPPORT_GPU 1 78cb93a386Sopenharmony_ci 79cb93a386Sopenharmony_ci/* Skia makes use of histogram logging macros to trace the frequency of 80cb93a386Sopenharmony_ci * events. By default, Skia provides no-op versions of these macros. 81cb93a386Sopenharmony_ci * Skia consumers can provide their own definitions of these macros to 82cb93a386Sopenharmony_ci * integrate with their histogram collection backend. 83cb93a386Sopenharmony_ci */ 84cb93a386Sopenharmony_ci//#define SK_HISTOGRAM_BOOLEAN(name, sample) 85cb93a386Sopenharmony_ci//#define SK_HISTOGRAM_ENUMERATION(name, sample, enum_size) 86cb93a386Sopenharmony_ci//#define SK_HISTOGRAM_EXACT_LINEAR(name, sample, value_max) 87cb93a386Sopenharmony_ci//#define SK_HISTOGRAM_MEMORY_KB(name, sample) 88cb93a386Sopenharmony_ci 89cb93a386Sopenharmony_ci#ifndef SK_GAMMA_APPLY_TO_A8 90cb93a386Sopenharmony_ci#define SK_GAMMA_APPLY_TO_A8 91cb93a386Sopenharmony_ci#endif 92cb93a386Sopenharmony_ci 93cb93a386Sopenharmony_ci#ifndef SK_GAMMA_CONTRAST 94cb93a386Sopenharmony_ci#define SK_GAMMA_CONTRAST 0.0 95cb93a386Sopenharmony_ci#endif 96cb93a386Sopenharmony_ci 97cb93a386Sopenharmony_ci#ifndef SK_GAMMA_EXPONENT 98cb93a386Sopenharmony_ci#define SK_GAMMA_EXPONENT 1.0 99cb93a386Sopenharmony_ci#endif 100cb93a386Sopenharmony_ci 101cb93a386Sopenharmony_ci#endif 102