| 1 |
/* |
| 2 |
* Copyright 2006 The Android Open Source Project |
| 3 |
* |
| 4 |
* Use of this source code is governed by a BSD-style license that can be |
| 5 |
* found in the LICENSE file. |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef SkUserConfig_DEFINED |
| 9 |
#define SkUserConfig_DEFINED |
| 10 |
|
| 11 |
/* SkTypes.h, the root of the public header files, includes this file |
| 12 |
SkUserConfig.h after first initializing certain Skia defines, letting |
| 13 |
this file change or augment those flags. |
| 14 |
|
| 15 |
Below are optional defines that add, subtract, or change default behavior |
| 16 |
in Skia. Your port can locally edit this file to enable/disable flags as |
| 17 |
you choose, or these can be declared on your command line (i.e. -Dfoo). |
| 18 |
|
| 19 |
By default, this #include file will always default to having all the flags |
| 20 |
commented out, so including it will have no effect. |
| 21 |
*/ |
| 22 |
|
| 23 |
/////////////////////////////////////////////////////////////////////////////// |
| 24 |
|
| 25 |
/* Skia has lots of debug-only code. Often this is just null checks or other |
| 26 |
parameter checking, but sometimes it can be quite intrusive (e.g. check that |
| 27 |
each 32bit pixel is in premultiplied form). This code can be very useful |
| 28 |
during development, but will slow things down in a shipping product. |
| 29 |
|
| 30 |
By default, these mutually exclusive flags are defined in SkTypes.h, |
| 31 |
based on the presence or absence of NDEBUG, but that decision can be changed |
| 32 |
here. |
| 33 |
*/ |
| 34 |
//#define SK_DEBUG |
| 35 |
//#define SK_RELEASE |
| 36 |
|
| 37 |
/* To write debug messages to a console, skia will call SkDebugf(...) following |
| 38 |
printf conventions (e.g. const char* format, ...). If you want to redirect |
| 39 |
this to something other than printf, define yours here |
| 40 |
*/ |
| 41 |
//#define SkDebugf(...) MyFunction(__VA_ARGS__) |
| 42 |
|
| 43 |
/* Skia has both debug and release asserts. When an assert fails SK_ABORT will |
| 44 |
be used to report an abort message. SK_ABORT is expected not to return. Skia |
| 45 |
provides a default implementation which will print the message with SkDebugf |
| 46 |
and then call sk_abort_no_print. |
| 47 |
*/ |
| 48 |
//#define SK_ABORT(message, ...) |
| 49 |
|
| 50 |
/* To specify a different default font strike cache memory limit, define this. If this is |
| 51 |
undefined, skia will use a built-in value. |
| 52 |
*/ |
| 53 |
//#define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024) |
| 54 |
|
| 55 |
/* To specify a different default font strike cache count limit, define this. If this is |
| 56 |
undefined, skia will use a built-in value. |
| 57 |
*/ |
| 58 |
// #define SK_DEFAULT_FONT_CACHE_COUNT_LIMIT 2048 |
| 59 |
|
| 60 |
/* To specify the default size of the image cache, undefine this and set it to |
| 61 |
the desired value (in bytes). SkGraphics.h as a runtime API to set this |
| 62 |
value as well. If this is undefined, a built-in value will be used. |
| 63 |
*/ |
| 64 |
//#define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024) |
| 65 |
|
| 66 |
/* Define this to set the upper limit for text to support LCD. Values that |
| 67 |
are very large increase the cost in the font cache and draw slower, without |
| 68 |
improving readability. If this is undefined, Skia will use its default |
| 69 |
value (e.g. 48) |
| 70 |
*/ |
| 71 |
//#define SK_MAX_SIZE_FOR_LCDTEXT 48 |
| 72 |
|
| 73 |
/* Change the kN32_SkColorType ordering to BGRA to work in X windows. |
| 74 |
*/ |
| 75 |
//#define SK_R32_SHIFT 16 |
| 76 |
|
| 77 |
/* This controls how much space should be pre-allocated in an SkCanvas object |
| 78 |
to store the SkMatrix and clip via calls to SkCanvas::save() (and balanced with |
| 79 |
SkCanvas::restore()). |
| 80 |
*/ |
| 81 |
//#define SK_CANVAS_SAVE_RESTORE_PREALLOC_COUNT 32 |
| 82 |
|
| 83 |
/* Skia makes use of histogram logging macros to trace the frequency of |
| 84 |
events. By default, Skia provides no-op versions of these macros. |
| 85 |
Skia consumers can provide their own definitions of these macros to |
| 86 |
integrate with their histogram collection backend. |
| 87 |
*/ |
| 88 |
//#define SK_HISTOGRAM_BOOLEAN(name, sample) |
| 89 |
//#define SK_HISTOGRAM_ENUMERATION(name, sampleEnum, enumSize) |
| 90 |
//#define SK_HISTOGRAM_EXACT_LINEAR(name, sample, valueMax) |
| 91 |
//#define SK_HISTOGRAM_CUSTOM_EXACT_LINEAR(name, sample, value_min, value_max, bucket_count) |
| 92 |
//#define SK_HISTOGRAM_MEMORY_KB(name, sample) |
| 93 |
//#define SK_HISTOGRAM_CUSTOM_COUNTS(name, sample, countMin, countMax, bucketCount) |
| 94 |
//#define SK_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(name, sampleUSec, minUSec, maxUSec, bucketCount) |
| 95 |
|
| 96 |
/* |
| 97 |
* Skia can provide extensive logging of Graphite Pipeline lifetimes. |
| 98 |
*/ |
| 99 |
//#define SK_PIPELINE_LIFETIME_LOGGING |
| 100 |
|
| 101 |
// To use smaller but slower mipmap builder |
| 102 |
//#define SK_USE_DRAWING_MIPMAP_DOWNSAMPLER |
| 103 |
|
| 104 |
/* Skia tries to make use of some non-standard C++ language extensions. |
| 105 |
By default, Skia provides msvc and clang/gcc versions of these macros. |
| 106 |
Skia consumers can provide their own definitions of these macros to |
| 107 |
integrate with their own compilers and build system. |
| 108 |
*/ |
| 109 |
//#define SK_ALWAYS_INLINE inline __attribute__((always_inline)) |
| 110 |
//#define SK_NEVER_INLINE __attribute__((noinline)) |
| 111 |
//#define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B)))) |
| 112 |
//#define SK_NO_SANITIZE(A) __attribute__((no_sanitize(A))) |
| 113 |
//#define SK_TRIVIAL_ABI [[clang::trivial_abi]] |
| 114 |
|
| 115 |
/* |
| 116 |
* If compiling Skia as a DLL, public APIs should be exported. Skia will set |
| 117 |
* SK_API to something sensible for Clang and MSVC, but if clients need to |
| 118 |
* customize it for their build system or compiler, they may. |
| 119 |
* If a client needs to use SK_API (e.g. overriding SK_ABORT), then they |
| 120 |
* *must* define their own, the default will not be defined prior to loading |
| 121 |
* this file. |
| 122 |
*/ |
| 123 |
//#define SK_API __declspec(dllexport) |
| 124 |
|
| 125 |
/* |
| 126 |
* If using DNG support, set the version of the dng_sdk being compiled against here |
| 127 |
* following the versioning scheme of dng_tag_valus.h |
| 128 |
* eg, DNG 1.4 is 0x01040000, DNG 1.7.1 is 0x01070100, etc... |
| 129 |
* If unspecified, DNG SDK 1.4 is assumed |
| 130 |
*/ |
| 131 |
// #define SK_DNG_VERSION 0x01040000 |
| 132 |
|
| 133 |
#endif |