8 #ifndef SkTypes_DEFINED
9 #define SkTypes_DEFINED
14 #include "include/private/base/SkFeatures.h"
17 #include "include/private/base/SkLoadUserConfig.h"
20 #include "include/private/base/SkAPI.h"
21 #include "include/private/base/SkAssert.h"
22 #include "include/private/base/SkAttributes.h"
23 #include "include/private/base/SkDebug.h"
29 #if defined(SK_GANESH) || defined(SK_GRAPHITE)
30 # if !defined(SK_ENABLE_SKSL)
31 # define SK_ENABLE_SKSL
43 #if defined(SK_R32_SHIFT)
45 #elif defined(SK_BUILD_FOR_WIN)
46 #define SK_R32_SHIFT 16
48 #define SK_R32_SHIFT 0
51 #if defined(SK_B32_SHIFT)
54 #define SK_B32_SHIFT (16-SK_R32_SHIFT)
57 #define SK_G32_SHIFT 8
58 #define SK_A32_SHIFT 24
64 # define SK_PMCOLOR_BYTE_ORDER(C0, C1, C2, C3) \
65 (SK_ ## C3 ## 32_SHIFT == 0 && \
66 SK_ ## C2 ## 32_SHIFT == 8 && \
67 SK_ ## C1 ## 32_SHIFT == 16 && \
68 SK_ ## C0 ## 32_SHIFT == 24)
70 # define SK_PMCOLOR_BYTE_ORDER(C0, C1, C2, C3) \
71 (SK_ ## C0 ## 32_SHIFT == 0 && \
72 SK_ ## C1 ## 32_SHIFT == 8 && \
73 SK_ ## C2 ## 32_SHIFT == 16 && \
74 SK_ ## C3 ## 32_SHIFT == 24)
77 #if defined SK_DEBUG && defined SK_BUILD_FOR_WIN
85 #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
86 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
89 #if !defined(SK_GAMMA_EXPONENT)
90 #define SK_GAMMA_EXPONENT (0.0f)
94 # define GR_TEST_UTILS 0
98 #if defined(SK_HISTOGRAM_ENUMERATION) || \
99 defined(SK_HISTOGRAM_BOOLEAN) || \
100 defined(SK_HISTOGRAM_EXACT_LINEAR) || \
101 defined(SK_HISTOGRAM_MEMORY_KB)
102 # define SK_HISTOGRAMS_ENABLED 1
104 # define SK_HISTOGRAMS_ENABLED 0
107 #ifndef SK_HISTOGRAM_BOOLEAN
108 # define SK_HISTOGRAM_BOOLEAN(name, sample)
111 #ifndef SK_HISTOGRAM_ENUMERATION
112 # define SK_HISTOGRAM_ENUMERATION(name, sample, enum_size)
115 #ifndef SK_HISTOGRAM_EXACT_LINEAR
116 # define SK_HISTOGRAM_EXACT_LINEAR(name, sample, value_max)
119 #ifndef SK_HISTOGRAM_MEMORY_KB
120 # define SK_HISTOGRAM_MEMORY_KB(name, sample)
123 #define SK_HISTOGRAM_PERCENTAGE(name, percent_as_int) \
124 SK_HISTOGRAM_EXACT_LINEAR(name, percent_as_int, 101)
127 #if defined(SK_ENABLE_OPTIMIZE_SIZE)
128 # define SK_FORCE_RASTER_PIPELINE_BLITTER
129 # define SK_DISABLE_SDF_TEXT
132 #ifndef SK_DISABLE_LEGACY_SHADERCONTEXT
133 # define SK_ENABLE_LEGACY_SHADERCONTEXT
136 #if defined(SK_BUILD_FOR_LIBFUZZER) || defined(SK_BUILD_FOR_AFL_FUZZ)
137 #if !defined(SK_BUILD_FOR_FUZZER)
138 #define SK_BUILD_FOR_FUZZER
146 #if !defined(GR_CACHE_STATS)
147 #if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
148 #define GR_CACHE_STATS 1
150 #define GR_CACHE_STATS 0
154 #if !defined(GR_GPU_STATS)
155 #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || GR_TEST_UTILS
156 #define GR_GPU_STATS 1
158 #define GR_GPU_STATS 0
166 return (((uint32_t)a << 24) | ((uint32_t)b << 16) | ((uint32_t)c << 8) | (uint32_t)d);
static constexpr SkMSec SK_MSecMax
Maximum representable milliseconds; 24d 20h 31m 23.647s.
Definition: SkTypes.h:186
int32_t SkUnichar
32 bit integer to hold a unicode value
Definition: SkTypes.h:173
uint16_t SkGlyphID
16 bit unsigned integer to hold a glyph index
Definition: SkTypes.h:177
static constexpr uint32_t SK_InvalidUniqueID
The unique IDs in Skia reserve 0 has an invalid marker.
Definition: SkTypes.h:194
#define SK_R32_SHIFT
Definition: SkTypes.h:48
uint32_t SkFourByteTag
Definition: SkTypes.h:164
#define SK_B32_SHIFT
Definition: SkTypes.h:54
static constexpr uint32_t SK_InvalidGenID
The generation IDs in Skia reserve 0 has an invalid marker.
Definition: SkTypes.h:190
uint32_t SkMSec
32 bit value to hold a millisecond duration Note that SK_MSecMax is about 25 days.
Definition: SkTypes.h:182
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
Definition: SkTypes.h:165