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)
39 #if defined(SK_R32_SHIFT)
41 #elif defined(SK_BUILD_FOR_WIN)
42 #define SK_R32_SHIFT 16
44 #define SK_R32_SHIFT 0
47 #if defined(SK_B32_SHIFT)
50 #define SK_B32_SHIFT (16-SK_R32_SHIFT)
53 #define SK_G32_SHIFT 8
54 #define SK_A32_SHIFT 24
60 # define SK_PMCOLOR_BYTE_ORDER(C0, C1, C2, C3) \
61 (SK_ ## C3 ## 32_SHIFT == 0 && \
62 SK_ ## C2 ## 32_SHIFT == 8 && \
63 SK_ ## C1 ## 32_SHIFT == 16 && \
64 SK_ ## C0 ## 32_SHIFT == 24)
66 # define SK_PMCOLOR_BYTE_ORDER(C0, C1, C2, C3) \
67 (SK_ ## C0 ## 32_SHIFT == 0 && \
68 SK_ ## C1 ## 32_SHIFT == 8 && \
69 SK_ ## C2 ## 32_SHIFT == 16 && \
70 SK_ ## C3 ## 32_SHIFT == 24)
73 #if defined SK_DEBUG && defined SK_BUILD_FOR_WIN
81 #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
82 #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
85 #if !defined(SK_GAMMA_EXPONENT)
86 #define SK_GAMMA_EXPONENT (0.0f)
89 #if defined(SK_HISTOGRAM_ENUMERATION) || \
90 defined(SK_HISTOGRAM_BOOLEAN) || \
91 defined(SK_HISTOGRAM_EXACT_LINEAR) || \
92 defined(SK_HISTOGRAM_MEMORY_KB)
93 # define SK_HISTOGRAMS_ENABLED 1
95 # define SK_HISTOGRAMS_ENABLED 0
98 #ifndef SK_HISTOGRAM_BOOLEAN
99 # define SK_HISTOGRAM_BOOLEAN(name, sample)
102 #ifndef SK_HISTOGRAM_ENUMERATION
103 # define SK_HISTOGRAM_ENUMERATION(name, sample, enum_size)
106 #ifndef SK_HISTOGRAM_EXACT_LINEAR
107 # define SK_HISTOGRAM_EXACT_LINEAR(name, sample, value_max)
110 #ifndef SK_HISTOGRAM_MEMORY_KB
111 # define SK_HISTOGRAM_MEMORY_KB(name, sample)
114 #define SK_HISTOGRAM_PERCENTAGE(name, percent_as_int) \
115 SK_HISTOGRAM_EXACT_LINEAR(name, percent_as_int, 101)
118 #if defined(SK_ENABLE_OPTIMIZE_SIZE)
119 #if !defined(SK_FORCE_RASTER_PIPELINE_BLITTER)
120 #define SK_FORCE_RASTER_PIPELINE_BLITTER
122 #define SK_DISABLE_SDF_TEXT
125 #ifndef SK_DISABLE_LEGACY_SHADERCONTEXT
126 # define SK_ENABLE_LEGACY_SHADERCONTEXT
129 #if defined(SK_BUILD_FOR_LIBFUZZER) || defined(SK_BUILD_FOR_AFL_FUZZ)
130 #if !defined(SK_BUILD_FOR_FUZZER)
131 #define SK_BUILD_FOR_FUZZER
140 #if !defined(GR_CACHE_STATS)
141 #if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
142 #define GR_CACHE_STATS 1
144 #define GR_CACHE_STATS 0
148 #if !defined(GR_GPU_STATS)
149 #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || defined(GR_TEST_UTILS)
150 #define GR_GPU_STATS 1
152 #define GR_GPU_STATS 0
160 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:180
int32_t SkUnichar
32 bit integer to hold a unicode value
Definition: SkTypes.h:167
uint16_t SkGlyphID
16 bit unsigned integer to hold a glyph index
Definition: SkTypes.h:171
static constexpr uint32_t SK_InvalidUniqueID
The unique IDs in Skia reserve 0 has an invalid marker.
Definition: SkTypes.h:188
#define SK_R32_SHIFT
Definition: SkTypes.h:44
uint32_t SkFourByteTag
Definition: SkTypes.h:158
#define SK_B32_SHIFT
Definition: SkTypes.h:50
static constexpr uint32_t SK_InvalidGenID
The generation IDs in Skia reserve 0 has an invalid marker.
Definition: SkTypes.h:184
uint32_t SkMSec
32 bit value to hold a millisecond duration Note that SK_MSecMax is about 25 days.
Definition: SkTypes.h:176
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
Definition: SkTypes.h:159