Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
SkPdfiumUserConfig.h
Go to the documentation of this file.
1/*
2 * Copyright 2006 The PDFium Authors
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#ifndef SKIA_CONFIG_SKUSERCONFIG_H_
8#define SKIA_CONFIG_SKUSERCONFIG_H_
9
10/* SkTypes.h, the root of the public header files, does the following trick:
11
12 #include "SkPreConfig.h"
13 #include "SkUserConfig.h"
14 #include "SkPostConfig.h"
15
16 SkPreConfig.h runs first, and it is responsible for initializing certain
17 skia defines.
18
19 SkPostConfig.h runs last, and its job is to just check that the final
20 defines are consistent (i.e. that we don't have mutually conflicting
21 defines).
22
23 SkUserConfig.h (this file) runs in the middle. It gets to change or augment
24 the list of flags initially set in preconfig, and then postconfig checks
25 that everything still makes sense.
26
27 Below are optional defines that add, subtract, or change default behavior
28 in Skia. Your port can locally edit this file to enable/disable flags as
29 you choose, or these can be delared on your command line (i.e. -Dfoo).
30
31 By default, this include file will always default to having all of the flags
32 commented out, so including it will have no effect.
33*/
34
35///////////////////////////////////////////////////////////////////////////////
36
37/* Skia has lots of debug-only code. Often this is just null checks or other
38 parameter checking, but sometimes it can be quite intrusive (e.g. check that
39 each 32bit pixel is in premultiplied form). This code can be very useful
40 during development, but will slow things down in a shipping product.
41
42 By default, these mutually exclusive flags are defined in SkPreConfig.h,
43 based on the presence or absence of NDEBUG, but that decision can be changed
44 here.
45 */
46// #define SK_DEBUG
47// #define SK_RELEASE
48
49/* Skia has certain debug-only code that is extremely intensive even for debug
50 builds. This code is useful for diagnosing specific issues, but is not
51 generally applicable, therefore it must be explicitly enabled to avoid
52 the performance impact. By default these flags are undefined, but can be
53 enabled by uncommenting them below.
54 */
55// #define SK_DEBUG_GLYPH_CACHE
56// #define SK_DEBUG_PATH
57
58/* preconfig will have attempted to determine the endianness of the system,
59 but you can change these mutually exclusive flags here.
60 */
61// #define SK_CPU_BENDIAN
62// #define SK_CPU_LENDIAN
63
64/* Most compilers use the same bit endianness for bit flags in a byte as the
65 system byte endianness, and this is the default. If for some reason this
66 needs to be overridden, specify which of the mutually exclusive flags to
67 use. For example, some atom processors in certain configurations have big
68 endian byte order but little endian bit orders.
69*/
70// #define SK_UINT8_BITFIELD_BENDIAN
71// #define SK_UINT8_BITFIELD_LENDIAN
72
73
74/* To write debug messages to a console, skia will call SkDebugf(...) following
75 printf conventions (e.g. const char* format, ...). If you want to redirect
76 this to something other than printf, define yours here
77 */
78// #define SkDebugf(...) MyFunction(__VA_ARGS__)
79
80/*
81 * To specify a different default font cache limit, define this. If this is
82 * undefined, skia will use a built-in value.
83 */
84// #define SK_DEFAULT_FONT_CACHE_LIMIT (1024 * 1024)
85
86/*
87 * To specify the default size of the image cache, undefine this and set it to
88 * the desired value (in bytes). SkGraphics.h as a runtime API to set this
89 * value as well. If this is undefined, a built-in value will be used.
90 */
91// #define SK_DEFAULT_IMAGE_CACHE_LIMIT (1024 * 1024)
92
93/* Define this to set the upper limit for text to support LCD. Values that
94 are very large increase the cost in the font cache and draw slower, without
95 improving readability. If this is undefined, Skia will use its default
96 value (e.g. 48)
97 */
98// #define SK_MAX_SIZE_FOR_LCDTEXT 48
99
100/* Change the ordering to work in X windows.
101 */
102// #ifdef SK_SAMPLES_FOR_X
103// #define SK_R32_SHIFT 16
104// #define SK_G32_SHIFT 8
105// #define SK_B32_SHIFT 0
106// #define SK_A32_SHIFT 24
107// #endif
108
109
110/* Determines whether to build code that supports the Ganesh GPU backend. Some classes
111 that are not GPU-specific, such as SkShader subclasses, have optional code
112 that is used to interact with this GPU backend. If you'd like to
113 include this code, include -DSK_GANESH in your cflags or uncomment below.
114 Defaults to not set (No Ganesh GPU backend).
115 This define affects the ABI of Skia, so make sure it matches the client which uses
116 the compiled version of Skia.
117*/
118// #define SK_GANESH
119
120/* Skia makes use of histogram logging macros to trace the frequency of
121 * events. By default, Skia provides no-op versions of these macros.
122 * Skia consumers can provide their own definitions of these macros to
123 * integrate with their histogram collection backend.
124 */
125// #define SK_HISTOGRAM_BOOLEAN(name, value)
126// #define SK_HISTOGRAM_ENUMERATION(name, value, boundary_value)
127#include "third_party/base/component_export.h"
128
129// ===== Begin Chrome-specific definitions =====
130
131#define SK_MSCALAR_IS_FLOAT
132#undef SK_MSCALAR_IS_DOUBLE
133
134#define GR_MAX_OFFSCREEN_AA_DIM 512
135
136// Handle exporting using base/component_export.h
137#define SK_API COMPONENT_EXPORT(SKIA)
138
139// Log the file and line number for assertions.
140#if defined(SK_BUILD_FOR_WIN) && !defined(__clang__)
141// String formatting with this toolchain not supported.
142#define SkDebugf(...) SkDebugf_FileLineOnly(__FILE__, __LINE__)
143SK_API void SkDebugf_FileLineOnly(const char* file, int line);
144#else
145#define SkDebugf(...) SkDebugf_FileLine(__FILE__, __LINE__, __VA_ARGS__)
146SK_API void SkDebugf_FileLine(const char* file,
147 int line,
148 const char* format,
149 ...);
150#endif
151
152#if !defined(ANDROID) // On Android, we use the skia default settings.
153#define SK_A32_SHIFT 24
154#define SK_R32_SHIFT 16
155#define SK_G32_SHIFT 8
156#define SK_B32_SHIFT 0
157#endif
158
159#if defined(SK_BUILD_FOR_WIN32)
160
161#define SK_BUILD_FOR_WIN
162
163// Skia uses this deprecated bzero function to fill zeros into a string.
164#define bzero(str, len) memset(str, 0, len)
165
166#elif defined(SK_BUILD_FOR_MAC)
167
168#define SK_CPU_LENDIAN
169#undef SK_CPU_BENDIAN
170
171#elif defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
172
173// Prefer FreeType's emboldening algorithm to Skia's
174// TODO: skia used to just use hairline, but has improved since then, so
175// we should revisit this choice...
176#define SK_USE_FREETYPE_EMBOLDEN
177
178#if defined(SK_BUILD_FOR_UNIX) && defined(SK_CPU_BENDIAN)
179// Above we set the order for ARGB channels in registers. I suspect that, on
180// big endian machines, you can keep this the same and everything will work.
181// The in-memory order will be different, of course, but as long as everything
182// is reading memory as words rather than bytes, it will all work. However, if
183// you find that colours are messed up I thought that I would leave a helpful
184// locator for you. Also see the comments in
185// base/gfx/bitmap_platform_device_linux.h
186#error Read the comment at this location
187#endif
188
189#endif
190
191// Workaround for poor anisotropic mipmap quality,
192// pending Skia ripmap support.
193// (https://bugs.chromium.org/p/skia/issues/detail?id=4863)
194#ifndef SK_SUPPORT_LEGACY_ANISOTROPIC_MIPMAP_SCALE
195#define SK_SUPPORT_LEGACY_ANISOTROPIC_MIPMAP_SCALE
196#endif
197
198///////////////////////// Imported from BUILD.gn
199
200/* In some places Skia can use static initializers for global initialization,
201 * or fall back to lazy runtime initialization. Chrome always wants the latter.
202 */
203#define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
204
205/* This flag forces Skia not to use typographic metrics with GDI.
206 */
207#define SK_GDI_ALWAYS_USE_TEXTMETRICS_FOR_FONT_METRICS
208
209#define SK_IGNORE_BLURRED_RRECT_OPT
210#define SK_USE_DISCARDABLE_SCALEDIMAGECACHE
211#define SK_WILL_NEVER_DRAW_PERSPECTIVE_TEXT
212
213#define SK_ATTR_DEPRECATED SK_NOTHING_ARG1
214#define SK_ENABLE_INST_COUNT 0
215#define GR_GL_CUSTOM_SETUP_HEADER "GrGLConfig_chrome.h"
216
217// Blink layout tests are baselined to Clang optimizing through the UB in
218// SkDivBits.
219#define SK_SUPPORT_LEGACY_DIVBITS_UB
220
221// mtklein's fiddling with Src / SrcOver. Will rebaseline these only once when
222// done.
223#define SK_SUPPORT_LEGACY_X86_BLITS
224
225#define SK_DISABLE_TILE_IMAGE_FILTER_OPTIMIZATION
226
227#if defined(SK_BUILD_FOR_WIN) && !defined(__clang__)
228#define SK_ABORT(format, ...)
229 SkAbort_FileLine(__FILE__, __LINE__, format, ##__VA_ARGS__)
230[[noreturn]] SK_API void SkAbort_FileLine(const char* file,
231 int line,
232 const char* format,
233 ...);
234#endif
235
236// ===== End Chrome-specific definitions =====
237
238#endif // SKIA_CONFIG_SKUSERCONFIG_H_
#define SK_API
void SkDebugf_FileLine(const char *file, int line, const char *format,...)