Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkUserConfig.h
Go to the documentation of this file.
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/* Determines whether to build code that supports the Ganesh GPU backend. Some classes
78 that are not GPU-specific, such as SkShader subclasses, have optional code
79 that is used allows them to interact with this GPU backend. If you'd like to
80 include this code, include -DSK_GANESH in your cflags or uncomment below.
81 Defaults to not set (No Ganesh GPU backend).
82 This define affects the ABI of Skia, so make sure it matches the client which uses
83 the compiled version of Skia.
84*/
85//#define SK_GANESH
86
87/* Skia makes use of histogram logging macros to trace the frequency of
88 events. By default, Skia provides no-op versions of these macros.
89 Skia consumers can provide their own definitions of these macros to
90 integrate with their histogram collection backend.
91*/
92//#define SK_HISTOGRAM_BOOLEAN(name, sample)
93//#define SK_HISTOGRAM_ENUMERATION(name, sample, enum_size)
94//#define SK_HISTOGRAM_EXACT_LINEAR(name, sample, value_max)
95//#define SK_HISTOGRAM_MEMORY_KB(name, sample)
96
97// To use smaller but slower mipmap builder
98//#define SK_USE_DRAWING_MIPMAP_DOWNSAMPLER
99
100/* Skia tries to make use of some non-standard C++ language extensions.
101 By default, Skia provides msvc and clang/gcc versions of these macros.
102 Skia consumers can provide their own definitions of these macros to
103 integrate with their own compilers and build system.
104*/
105//#define SK_ALWAYS_INLINE inline __attribute__((always_inline))
106//#define SK_NEVER_INLINE __attribute__((noinline))
107//#define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B))))
108//#define SK_NO_SANITIZE(A) __attribute__((no_sanitize(A)))
109//#define SK_TRIVIAL_ABI [[clang::trivial_abi]]
110
111/*
112 * If compiling Skia as a DLL, public APIs should be exported. Skia will set
113 * SK_API to something sensible for Clang and MSVC, but if clients need to
114 * customize it for their build system or compiler, they may.
115 * If a client needs to use SK_API (e.g. overriding SK_ABORT), then they
116 * *must* define their own, the default will not be defined prior to loading
117 * this file.
118 */
119//#define SK_API __declspec(dllexport)
120
121#endif