Merge branch 'chrome/m59' into update-m59
[platform/upstream/libSkiaSharp.git] / src / c / sk_enums.cpp
1 /*
2  * Copyright 2016 Xamarin Inc.
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 #include "sk_types_priv.h"
9 #include "SkMatrix44.h"
10 #include "SkBitmapScaler.h"
11 #include "SkBlurMaskFilter.h"
12
13 #if SK_SUPPORT_GPU
14 #include "GrContextOptions.h"
15 #endif
16
17 #if __cplusplus >= 199711L
18
19 #define STRINGIFY(x) #x
20 #define TOSTRING(x) STRINGIFY(x)
21 #define ASSERT_MSG(SK, C) "ABI changed, you must write a enumeration mapper for " TOSTRING(#SK) " to " TOSTRING(#C) "."
22
23 // sk_typeface_style_t
24 static_assert ((int)SkTypeface::Style::kNormal       == (int)NORMAL_TYPEFACE_STYLE,        ASSERT_MSG(SkTypeface::Style, sk_typeface_style_t));
25 static_assert ((int)SkTypeface::Style::kBold         == (int)BOLD_TYPEFACE_STYLE,          ASSERT_MSG(SkTypeface::Style, sk_typeface_style_t));
26 static_assert ((int)SkTypeface::Style::kItalic       == (int)ITALIC_TYPEFACE_STYLE,        ASSERT_MSG(SkTypeface::Style, sk_typeface_style_t));
27 static_assert ((int)SkTypeface::Style::kBoldItalic   == (int)BOLD_ITALIC_TYPEFACE_STYLE,   ASSERT_MSG(SkTypeface::Style, sk_typeface_style_t));
28
29 // sk_encoding_t
30 static_assert ((int)SkTypeface::Encoding::kUTF8_Encoding    == (int)UTF8_ENCODING,    ASSERT_MSG(SkTypeface::Encoding, sk_encoding_t));
31 static_assert ((int)SkTypeface::Encoding::kUTF16_Encoding   == (int)UTF16_ENCODING,   ASSERT_MSG(SkTypeface::Encoding, sk_encoding_t));
32 static_assert ((int)SkTypeface::Encoding::kUTF32_Encoding   == (int)UTF32_ENCODING,   ASSERT_MSG(SkTypeface::Encoding, sk_encoding_t));
33
34 // sk_font_style_slant_t
35 static_assert ((int)SkFontStyle::Slant::kUpright_Slant   == (int)UPRIGHT_SK_FONT_STYLE_SLANT,   ASSERT_MSG(SkFontStyle::Slant, sk_font_style_slant_t));
36 static_assert ((int)SkFontStyle::Slant::kItalic_Slant    == (int)ITALIC_SK_FONT_STYLE_SLANT,    ASSERT_MSG(SkFontStyle::Slant, sk_font_style_slant_t));
37 static_assert ((int)SkFontStyle::Slant::kOblique_Slant   == (int)OBLIQUE_SK_FONT_STYLE_SLANT,   ASSERT_MSG(SkFontStyle::Slant, sk_font_style_slant_t));
38
39 // sk_path_verb_t
40 static_assert ((int)SkPath::Verb::kMove_Verb    == (int)MOVE_SK_PATH_VERB,    ASSERT_MSG(SkPath::Verb, sk_path_verb_t));
41 static_assert ((int)SkPath::Verb::kLine_Verb    == (int)LINE_SK_PATH_VERB,    ASSERT_MSG(SkPath::Verb, sk_path_verb_t));
42 static_assert ((int)SkPath::Verb::kQuad_Verb    == (int)QUAD_SK_PATH_VERB,    ASSERT_MSG(SkPath::Verb, sk_path_verb_t));
43 static_assert ((int)SkPath::Verb::kConic_Verb   == (int)CONIC_SK_PATH_VERB,   ASSERT_MSG(SkPath::Verb, sk_path_verb_t));
44 static_assert ((int)SkPath::Verb::kCubic_Verb   == (int)CUBIC_SK_PATH_VERB,   ASSERT_MSG(SkPath::Verb, sk_path_verb_t));
45 static_assert ((int)SkPath::Verb::kClose_Verb   == (int)CLOSE_SK_PATH_VERB,   ASSERT_MSG(SkPath::Verb, sk_path_verb_t));
46 static_assert ((int)SkPath::Verb::kDone_Verb    == (int)DONE_SK_PATH_VERB,    ASSERT_MSG(SkPath::Verb, sk_path_verb_t));
47
48 // sk_path_add_mode_t
49 static_assert ((int)SkPath::AddPathMode::kAppend_AddPathMode   == (int)APPEND_SK_PATH_ADD_MODE,   ASSERT_MSG(SkPath::AddPathMode, sk_path_add_mode_t));
50 static_assert ((int)SkPath::AddPathMode::kExtend_AddPathMode   == (int)EXTEND_SK_PATH_ADD_MODE,   ASSERT_MSG(SkPath::AddPathMode, sk_path_add_mode_t));
51
52 // sk_path_direction_t
53 static_assert ((int)SkPath::Direction::kCCW_Direction   == (int)CCW_SK_PATH_DIRECTION,   ASSERT_MSG(SkPath::Direction, sk_path_direction_t));
54 static_assert ((int)SkPath::Direction::kCW_Direction    == (int)CW_SK_PATH_DIRECTION,    ASSERT_MSG(SkPath::Direction, sk_path_direction_t));
55
56 // sk_path_arc_size_t
57 static_assert ((int)SkPath::ArcSize::kLarge_ArcSize   == (int)LARGE_SK_PATH_ARC_SIZE,   ASSERT_MSG(SkPath::ArcSize, sk_path_arc_size_t));
58 static_assert ((int)SkPath::ArcSize::kSmall_ArcSize   == (int)SMALL_SK_PATH_ARC_SIZE,   ASSERT_MSG(SkPath::ArcSize, sk_path_arc_size_t));
59
60 // sk_path_filltype_t
61 static_assert ((int)SkPath::FillType::kWinding_FillType          == (int)WINDING_SK_PATH_FILLTYPE,           ASSERT_MSG(SkPath::FillType, sk_path_filltype_t));
62 static_assert ((int)SkPath::FillType::kEvenOdd_FillType          == (int)EVENODD_SK_PATH_FILLTYPE,           ASSERT_MSG(SkPath::FillType, sk_path_filltype_t));
63 static_assert ((int)SkPath::FillType::kInverseWinding_FillType   == (int)INVERSE_WINDING_SK_PATH_FILLTYPE,   ASSERT_MSG(SkPath::FillType, sk_path_filltype_t));
64 static_assert ((int)SkPath::FillType::kInverseEvenOdd_FillType   == (int)INVERSE_EVENODD_SK_PATH_FILLTYPE,   ASSERT_MSG(SkPath::FillType, sk_path_filltype_t));
65
66 // sk_path_segment_mask_t
67 static_assert ((int)SkPath::SegmentMask::kLine_SegmentMask    == (int)LINE_SK_PATH_SEGMENT_MASK,    ASSERT_MSG(SkPath::SegmentMask, sk_path_segment_mask_t));
68 static_assert ((int)SkPath::SegmentMask::kQuad_SegmentMask    == (int)QUAD_SK_PATH_SEGMENT_MASK,    ASSERT_MSG(SkPath::SegmentMask, sk_path_segment_mask_t));
69 static_assert ((int)SkPath::SegmentMask::kConic_SegmentMask   == (int)CONIC_SK_PATH_SEGMENT_MASK,   ASSERT_MSG(SkPath::SegmentMask, sk_path_segment_mask_t));
70 static_assert ((int)SkPath::SegmentMask::kCubic_SegmentMask   == (int)CUBIC_SK_PATH_SEGMENT_MASK,   ASSERT_MSG(SkPath::SegmentMask, sk_path_segment_mask_t));
71
72 // sk_text_align_t
73 static_assert ((int)SkPaint::Align::kLeft_Align     == (int)LEFT_SK_TEXT_ALIGN,     ASSERT_MSG(SkPaint::Align, sk_text_align_t));
74 static_assert ((int)SkPaint::Align::kCenter_Align   == (int)CENTER_SK_TEXT_ALIGN,   ASSERT_MSG(SkPaint::Align, sk_text_align_t));
75 static_assert ((int)SkPaint::Align::kRight_Align    == (int)RIGHT_SK_TEXT_ALIGN,    ASSERT_MSG(SkPaint::Align, sk_text_align_t));
76
77 // sk_text_encoding_t
78 static_assert ((int)SkPaint::TextEncoding::kUTF8_TextEncoding      == (int)UTF8_SK_TEXT_ENCODING,       ASSERT_MSG(SkPaint::TextEncoding, sk_text_encoding_t));
79 static_assert ((int)SkPaint::TextEncoding::kUTF16_TextEncoding     == (int)UTF16_SK_TEXT_ENCODING,      ASSERT_MSG(SkPaint::TextEncoding, sk_text_encoding_t));
80 static_assert ((int)SkPaint::TextEncoding::kUTF32_TextEncoding     == (int)UTF32_SK_TEXT_ENCODING,      ASSERT_MSG(SkPaint::TextEncoding, sk_text_encoding_t));
81 static_assert ((int)SkPaint::TextEncoding::kGlyphID_TextEncoding   == (int)GLYPH_ID_SK_TEXT_ENCODING,   ASSERT_MSG(SkPaint::TextEncoding, sk_text_encoding_t));
82
83 // sk_filter_quality_t
84 static_assert ((int)SkFilterQuality::kNone_SkFilterQuality     == (int)NONE_SK_FILTER_QUALITY,     ASSERT_MSG(SkFilterQuality, sk_filter_quality_t));
85 static_assert ((int)SkFilterQuality::kLow_SkFilterQuality      == (int)LOW_SK_FILTER_QUALITY,      ASSERT_MSG(SkFilterQuality, sk_filter_quality_t));
86 static_assert ((int)SkFilterQuality::kMedium_SkFilterQuality   == (int)MEDIUM_SK_FILTER_QUALITY,   ASSERT_MSG(SkFilterQuality, sk_filter_quality_t));
87 static_assert ((int)SkFilterQuality::kHigh_SkFilterQuality     == (int)HIGH_SK_FILTER_QUALITY,     ASSERT_MSG(SkFilterQuality, sk_filter_quality_t));
88
89 // sk_crop_rect_flags_t
90 static_assert ((int)SkImageFilter::CropRect::CropEdge::kHasLeft_CropEdge     == (int)HAS_LEFT_SK_CROP_RECT_FLAG,     ASSERT_MSG(SkImageFilter::CropRect::CropEdge, sk_crop_rect_flags_t));
91 static_assert ((int)SkImageFilter::CropRect::CropEdge::kHasTop_CropEdge      == (int)HAS_TOP_SK_CROP_RECT_FLAG,      ASSERT_MSG(SkImageFilter::CropRect::CropEdge, sk_crop_rect_flags_t));
92 static_assert ((int)SkImageFilter::CropRect::CropEdge::kHasWidth_CropEdge    == (int)HAS_WIDTH_SK_CROP_RECT_FLAG,    ASSERT_MSG(SkImageFilter::CropRect::CropEdge, sk_crop_rect_flags_t));
93 static_assert ((int)SkImageFilter::CropRect::CropEdge::kHasHeight_CropEdge   == (int)HAS_HEIGHT_SK_CROP_RECT_FLAG,   ASSERT_MSG(SkImageFilter::CropRect::CropEdge, sk_crop_rect_flags_t));
94 static_assert ((int)SkImageFilter::CropRect::CropEdge::kHasAll_CropEdge      == (int)HAS_ALL_SK_CROP_RECT_FLAG,      ASSERT_MSG(SkImageFilter::CropRect::CropEdge, sk_crop_rect_flags_t));
95
96 // sk_drop_shadow_image_filter_shadow_mode_t
97 static_assert ((int)SkDropShadowImageFilter::ShadowMode::kDrawShadowAndForeground_ShadowMode   == (int)DRAW_SHADOW_AND_FOREGROUND_SK_DROP_SHADOW_IMAGE_FILTER_SHADOW_MODE,   ASSERT_MSG(SkDropShadowImageFilter::ShadowMode, sk_drop_shadow_image_filter_shadow_mode_t));
98 static_assert ((int)SkDropShadowImageFilter::ShadowMode::kDrawShadowOnly_ShadowMode            == (int)DRAW_SHADOW_ONLY_SK_DROP_SHADOW_IMAGE_FILTER_SHADOW_MODE,             ASSERT_MSG(SkDropShadowImageFilter::ShadowMode, sk_drop_shadow_image_filter_shadow_mode_t));
99
100 // sk_displacement_map_effect_channel_selector_type_t
101 static_assert ((int)SkDisplacementMapEffect::ChannelSelectorType::kUnknown_ChannelSelectorType   == (int)UNKNOWN_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,   ASSERT_MSG(SkDisplacementMapEffect::ChannelSelectorType, sk_displacement_map_effect_channel_selector_type_t));
102 static_assert ((int)SkDisplacementMapEffect::ChannelSelectorType::kR_ChannelSelectorType         == (int)R_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,         ASSERT_MSG(SkDisplacementMapEffect::ChannelSelectorType, sk_displacement_map_effect_channel_selector_type_t));
103 static_assert ((int)SkDisplacementMapEffect::ChannelSelectorType::kG_ChannelSelectorType         == (int)G_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,         ASSERT_MSG(SkDisplacementMapEffect::ChannelSelectorType, sk_displacement_map_effect_channel_selector_type_t));
104 static_assert ((int)SkDisplacementMapEffect::ChannelSelectorType::kB_ChannelSelectorType         == (int)B_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,         ASSERT_MSG(SkDisplacementMapEffect::ChannelSelectorType, sk_displacement_map_effect_channel_selector_type_t));
105 static_assert ((int)SkDisplacementMapEffect::ChannelSelectorType::kA_ChannelSelectorType         == (int)A_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,         ASSERT_MSG(SkDisplacementMapEffect::ChannelSelectorType, sk_displacement_map_effect_channel_selector_type_t));
106
107 // sk_matrix_convolution_tilemode_t
108 static_assert ((int)SkMatrixConvolutionImageFilter::TileMode::kClamp_TileMode          == (int)CLAMP_SK_MATRIX_CONVOLUTION_TILEMODE,            ASSERT_MSG(SkMatrixConvolutionImageFilter::TileMode, sk_matrix_convolution_tilemode_t));
109 static_assert ((int)SkMatrixConvolutionImageFilter::TileMode::kRepeat_TileMode         == (int)REPEAT_SK_MATRIX_CONVOLUTION_TILEMODE,           ASSERT_MSG(SkMatrixConvolutionImageFilter::TileMode, sk_matrix_convolution_tilemode_t));
110 static_assert ((int)SkMatrixConvolutionImageFilter::TileMode::kClampToBlack_TileMode   == (int)CLAMP_TO_BLACK_SK_MATRIX_CONVOLUTION_TILEMODE,   ASSERT_MSG(SkMatrixConvolutionImageFilter::TileMode, sk_matrix_convolution_tilemode_t));
111
112 // sk_blendmode_t
113 static_assert ((int)SkBlendMode::kClear        == (int)CLEAR_SK_BLENDMODE,        ASSERT_MSG(SkBlendMode, sk_blendmode_t));
114 static_assert ((int)SkBlendMode::kSrc          == (int)SRC_SK_BLENDMODE,          ASSERT_MSG(SkBlendMode, sk_blendmode_t));
115 static_assert ((int)SkBlendMode::kDst          == (int)DST_SK_BLENDMODE,          ASSERT_MSG(SkBlendMode, sk_blendmode_t));
116 static_assert ((int)SkBlendMode::kSrcOver      == (int)SRCOVER_SK_BLENDMODE,      ASSERT_MSG(SkBlendMode, sk_blendmode_t));
117 static_assert ((int)SkBlendMode::kDstOver      == (int)DSTOVER_SK_BLENDMODE,      ASSERT_MSG(SkBlendMode, sk_blendmode_t));
118 static_assert ((int)SkBlendMode::kSrcIn        == (int)SRCIN_SK_BLENDMODE,        ASSERT_MSG(SkBlendMode, sk_blendmode_t));
119 static_assert ((int)SkBlendMode::kDstIn        == (int)DSTIN_SK_BLENDMODE,        ASSERT_MSG(SkBlendMode, sk_blendmode_t));
120 static_assert ((int)SkBlendMode::kSrcOut       == (int)SRCOUT_SK_BLENDMODE,       ASSERT_MSG(SkBlendMode, sk_blendmode_t));
121 static_assert ((int)SkBlendMode::kDstOut       == (int)DSTOUT_SK_BLENDMODE,       ASSERT_MSG(SkBlendMode, sk_blendmode_t));
122 static_assert ((int)SkBlendMode::kSrcATop      == (int)SRCATOP_SK_BLENDMODE,      ASSERT_MSG(SkBlendMode, sk_blendmode_t));
123 static_assert ((int)SkBlendMode::kDstATop      == (int)DSTATOP_SK_BLENDMODE,      ASSERT_MSG(SkBlendMode, sk_blendmode_t));
124 static_assert ((int)SkBlendMode::kXor          == (int)XOR_SK_BLENDMODE,          ASSERT_MSG(SkBlendMode, sk_blendmode_t));
125 static_assert ((int)SkBlendMode::kPlus         == (int)PLUS_SK_BLENDMODE,         ASSERT_MSG(SkBlendMode, sk_blendmode_t));
126 static_assert ((int)SkBlendMode::kModulate     == (int)MODULATE_SK_BLENDMODE,     ASSERT_MSG(SkBlendMode, sk_blendmode_t));
127 static_assert ((int)SkBlendMode::kScreen       == (int)SCREEN_SK_BLENDMODE,       ASSERT_MSG(SkBlendMode, sk_blendmode_t));
128 static_assert ((int)SkBlendMode::kOverlay      == (int)OVERLAY_SK_BLENDMODE,      ASSERT_MSG(SkBlendMode, sk_blendmode_t));
129 static_assert ((int)SkBlendMode::kDarken       == (int)DARKEN_SK_BLENDMODE,       ASSERT_MSG(SkBlendMode, sk_blendmode_t));
130 static_assert ((int)SkBlendMode::kLighten      == (int)LIGHTEN_SK_BLENDMODE,      ASSERT_MSG(SkBlendMode, sk_blendmode_t));
131 static_assert ((int)SkBlendMode::kColorDodge   == (int)COLORDODGE_SK_BLENDMODE,   ASSERT_MSG(SkBlendMode, sk_blendmode_t));
132 static_assert ((int)SkBlendMode::kColorBurn    == (int)COLORBURN_SK_BLENDMODE,    ASSERT_MSG(SkBlendMode, sk_blendmode_t));
133 static_assert ((int)SkBlendMode::kHardLight    == (int)HARDLIGHT_SK_BLENDMODE,    ASSERT_MSG(SkBlendMode, sk_blendmode_t));
134 static_assert ((int)SkBlendMode::kSoftLight    == (int)SOFTLIGHT_SK_BLENDMODE,    ASSERT_MSG(SkBlendMode, sk_blendmode_t));
135 static_assert ((int)SkBlendMode::kDifference   == (int)DIFFERENCE_SK_BLENDMODE,   ASSERT_MSG(SkBlendMode, sk_blendmode_t));
136 static_assert ((int)SkBlendMode::kExclusion    == (int)EXCLUSION_SK_BLENDMODE,    ASSERT_MSG(SkBlendMode, sk_blendmode_t));
137 static_assert ((int)SkBlendMode::kMultiply     == (int)MULTIPLY_SK_BLENDMODE,     ASSERT_MSG(SkBlendMode, sk_blendmode_t));
138 static_assert ((int)SkBlendMode::kHue          == (int)HUE_SK_BLENDMODE,          ASSERT_MSG(SkBlendMode, sk_blendmode_t));
139 static_assert ((int)SkBlendMode::kSaturation   == (int)SATURATION_SK_BLENDMODE,   ASSERT_MSG(SkBlendMode, sk_blendmode_t));
140 static_assert ((int)SkBlendMode::kColor        == (int)COLOR_SK_BLENDMODE,        ASSERT_MSG(SkBlendMode, sk_blendmode_t));
141 static_assert ((int)SkBlendMode::kLuminosity   == (int)LUMINOSITY_SK_BLENDMODE,   ASSERT_MSG(SkBlendMode, sk_blendmode_t));
142
143 // sk_colortype_t
144 static_assert ((int)SkColorType::kUnknown_SkColorType     == (int)UNKNOWN_SK_COLORTYPE,     ASSERT_MSG(SkColorType, sk_colortype_t));
145 static_assert ((int)SkColorType::kAlpha_8_SkColorType     == (int)ALPHA_8_SK_COLORTYPE,     ASSERT_MSG(SkColorType, sk_colortype_t));
146 static_assert ((int)SkColorType::kRGB_565_SkColorType     == (int)RGB_565_SK_COLORTYPE,     ASSERT_MSG(SkColorType, sk_colortype_t));
147 static_assert ((int)SkColorType::kARGB_4444_SkColorType   == (int)ARGB_4444_SK_COLORTYPE,   ASSERT_MSG(SkColorType, sk_colortype_t));
148 static_assert ((int)SkColorType::kRGBA_8888_SkColorType   == (int)RGBA_8888_SK_COLORTYPE,   ASSERT_MSG(SkColorType, sk_colortype_t));
149 static_assert ((int)SkColorType::kBGRA_8888_SkColorType   == (int)BGRA_8888_SK_COLORTYPE,   ASSERT_MSG(SkColorType, sk_colortype_t));
150 static_assert ((int)SkColorType::kIndex_8_SkColorType     == (int)Index_8_SK_COLORTYPE,     ASSERT_MSG(SkColorType, sk_colortype_t));
151 static_assert ((int)SkColorType::kGray_8_SkColorType      == (int)Gray_8_SK_COLORTYPE,      ASSERT_MSG(SkColorType, sk_colortype_t));
152 static_assert ((int)SkColorType::kRGBA_F16_SkColorType    == (int)RGBA_F16_SK_COLORTYPE,    ASSERT_MSG(SkColorType, sk_colortype_t));
153
154 // sk_alphatype_t
155 static_assert ((int)SkAlphaType::kUnknown_SkAlphaType    == (int)UNKNOWN_SK_ALPHATYPE,    ASSERT_MSG(SkAlphaType, sk_alphatype_t));
156 static_assert ((int)SkAlphaType::kOpaque_SkAlphaType     == (int)OPAQUE_SK_ALPHATYPE,     ASSERT_MSG(SkAlphaType, sk_alphatype_t));
157 static_assert ((int)SkAlphaType::kPremul_SkAlphaType     == (int)PREMUL_SK_ALPHATYPE,     ASSERT_MSG(SkAlphaType, sk_alphatype_t));
158 static_assert ((int)SkAlphaType::kUnpremul_SkAlphaType   == (int)UNPREMUL_SK_ALPHATYPE,   ASSERT_MSG(SkAlphaType, sk_alphatype_t));
159
160 // sk_pixelgeometry_t
161 static_assert ((int)SkPixelGeometry::kUnknown_SkPixelGeometry   == (int)UNKNOWN_SK_PIXELGEOMETRY,   ASSERT_MSG(SkPixelGeometry, sk_pixelgeometry_t));
162 static_assert ((int)SkPixelGeometry::kRGB_H_SkPixelGeometry     == (int)RGB_H_SK_PIXELGEOMETRY,     ASSERT_MSG(SkPixelGeometry, sk_pixelgeometry_t));
163 static_assert ((int)SkPixelGeometry::kBGR_H_SkPixelGeometry     == (int)BGR_H_SK_PIXELGEOMETRY,     ASSERT_MSG(SkPixelGeometry, sk_pixelgeometry_t));
164 static_assert ((int)SkPixelGeometry::kRGB_V_SkPixelGeometry     == (int)RGB_V_SK_PIXELGEOMETRY,     ASSERT_MSG(SkPixelGeometry, sk_pixelgeometry_t));
165 static_assert ((int)SkPixelGeometry::kBGR_V_SkPixelGeometry     == (int)BGR_V_SK_PIXELGEOMETRY,     ASSERT_MSG(SkPixelGeometry, sk_pixelgeometry_t));
166
167 // sk_shader_tilemode_t
168 static_assert ((int)SkShader::TileMode::kClamp_TileMode    == (int)CLAMP_SK_SHADER_TILEMODE,    ASSERT_MSG(SkShader::TileMode, sk_shader_tilemode_t));
169 static_assert ((int)SkShader::TileMode::kRepeat_TileMode   == (int)REPEAT_SK_SHADER_TILEMODE,   ASSERT_MSG(SkShader::TileMode, sk_shader_tilemode_t));
170 static_assert ((int)SkShader::TileMode::kMirror_TileMode   == (int)MIRROR_SK_SHADER_TILEMODE,   ASSERT_MSG(SkShader::TileMode, sk_shader_tilemode_t));
171
172 // sk_blurstyle_t
173 static_assert ((int)SkBlurStyle::kNormal_SkBlurStyle   == (int)NORMAL_SK_BLUR_STYLE,   ASSERT_MSG(SkBlurStyle, sk_blurstyle_t));
174 static_assert ((int)SkBlurStyle::kSolid_SkBlurStyle    == (int)SOLID_SK_BLUR_STYLE,    ASSERT_MSG(SkBlurStyle, sk_blurstyle_t));
175 static_assert ((int)SkBlurStyle::kOuter_SkBlurStyle    == (int)OUTER_SK_BLUR_STYLE,    ASSERT_MSG(SkBlurStyle, sk_blurstyle_t));
176 static_assert ((int)SkBlurStyle::kInner_SkBlurStyle    == (int)INNER_SK_BLUR_STYLE,    ASSERT_MSG(SkBlurStyle, sk_blurstyle_t));
177
178 // sk_blurmaskfilter_blurflags_t
179 static_assert ((int)SkBlurMaskFilter::BlurFlags::kNone_BlurFlag               == (int)NONE_SK_BLUR_MASK_FILTER_BLUR_FLAGS,                ASSERT_MSG(SkBlurMaskFilter::BlurFlags, sk_blurmaskfilter_blurflags_t));
180 static_assert ((int)SkBlurMaskFilter::BlurFlags::kIgnoreTransform_BlurFlag    == (int)IGNORE_TRANSFORM_SK_BLUR_MASK_FILTER_BLUR_FLAGS,    ASSERT_MSG(SkBlurMaskFilter::BlurFlags, sk_blurmaskfilter_blurflags_t));
181 static_assert ((int)SkBlurMaskFilter::BlurFlags::kHighQuality_BlurFlag        == (int)HIGHT_QUALITY_SK_BLUR_MASK_FILTER_BLUR_FLAGS,       ASSERT_MSG(SkBlurMaskFilter::BlurFlags, sk_blurmaskfilter_blurflags_t));
182 static_assert ((int)SkBlurMaskFilter::BlurFlags::kAll_BlurFlag                == (int)ALL_SK_BLUR_MASK_FILTER_BLUR_FLAGS,                 ASSERT_MSG(SkBlurMaskFilter::BlurFlags, sk_blurmaskfilter_blurflags_t));
183
184 // sk_stroke_cap_t
185 static_assert ((int)SkPaint::Cap::kButt_Cap     == (int)BUTT_SK_STROKE_CAP,     ASSERT_MSG(SkPaint::Cap, sk_stroke_cap_t));
186 static_assert ((int)SkPaint::Cap::kRound_Cap    == (int)ROUND_SK_STROKE_CAP,    ASSERT_MSG(SkPaint::Cap, sk_stroke_cap_t));
187 static_assert ((int)SkPaint::Cap::kSquare_Cap   == (int)SQUARE_SK_STROKE_CAP,   ASSERT_MSG(SkPaint::Cap, sk_stroke_cap_t));
188
189 // sk_stroke_join_t
190 static_assert ((int)SkPaint::Join::kMiter_Join   == (int)MITER_SK_STROKE_JOIN,   ASSERT_MSG(SkPaint::Join, sk_stroke_join_t));
191 static_assert ((int)SkPaint::Join::kRound_Join   == (int)ROUND_SK_STROKE_JOIN,   ASSERT_MSG(SkPaint::Join, sk_stroke_join_t));
192 static_assert ((int)SkPaint::Join::kBevel_Join   == (int)BEVEL_SK_STROKE_JOIN,   ASSERT_MSG(SkPaint::Join, sk_stroke_join_t));
193
194 // sk_region_op_t
195 static_assert ((int)SkRegion::Op::kDifference_Op          == (int)DIFFERENCE_SK_REGION_OP,           ASSERT_MSG(SkRegion::Op, sk_region_op_t));
196 static_assert ((int)SkRegion::Op::kIntersect_Op           == (int)INTERSECT_SK_REGION_OP,            ASSERT_MSG(SkRegion::Op, sk_region_op_t));
197 static_assert ((int)SkRegion::Op::kUnion_Op               == (int)UNION_SK_REGION_OP,                ASSERT_MSG(SkRegion::Op, sk_region_op_t));
198 static_assert ((int)SkRegion::Op::kXOR_Op                 == (int)XOR_SK_REGION_OP,                  ASSERT_MSG(SkRegion::Op, sk_region_op_t));
199 static_assert ((int)SkRegion::Op::kReverseDifference_Op   == (int)REVERSE_DIFFERENCE_SK_REGION_OP,   ASSERT_MSG(SkRegion::Op, sk_region_op_t));
200 static_assert ((int)SkRegion::Op::kReplace_Op             == (int)REPLACE_SK_REGION_OP,              ASSERT_MSG(SkRegion::Op, sk_region_op_t));
201
202 // sk_clipop_t
203 static_assert ((int)SkClipOp::kDifference   == (int)DIFFERENCE_SK_CLIPOP,           ASSERT_MSG(SkClipOp, sk_clipop_t));
204 static_assert ((int)SkClipOp::kIntersect    == (int)INTERSECT_SK_CLIPOP,            ASSERT_MSG(SkClipOp, sk_clipop_t));
205
206 // sk_encoded_image_format_t
207 static_assert ((int)SkEncodedImageFormat::kBMP       == (int)BMP_SK_ENCODED_FORMAT,       ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
208 static_assert ((int)SkEncodedImageFormat::kGIF       == (int)GIF_SK_ENCODED_FORMAT,       ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
209 static_assert ((int)SkEncodedImageFormat::kICO       == (int)ICO_SK_ENCODED_FORMAT,       ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
210 static_assert ((int)SkEncodedImageFormat::kJPEG      == (int)JPEG_SK_ENCODED_FORMAT,      ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
211 static_assert ((int)SkEncodedImageFormat::kPNG       == (int)PNG_SK_ENCODED_FORMAT,       ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
212 static_assert ((int)SkEncodedImageFormat::kWBMP      == (int)WBMP_SK_ENCODED_FORMAT,      ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
213 static_assert ((int)SkEncodedImageFormat::kWEBP      == (int)WEBP_SK_ENCODED_FORMAT,      ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
214 static_assert ((int)SkEncodedImageFormat::kPKM       == (int)PKM_SK_ENCODED_FORMAT,       ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
215 static_assert ((int)SkEncodedImageFormat::kKTX       == (int)KTX_SK_ENCODED_FORMAT,       ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
216 static_assert ((int)SkEncodedImageFormat::kASTC      == (int)ASTC_SK_ENCODED_FORMAT,      ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
217 static_assert ((int)SkEncodedImageFormat::kDNG       == (int)DNG_SK_ENCODED_FORMAT,       ASSERT_MSG(SkEncodedImageFormat, sk_encoded_image_format_t));
218
219 // sk_codec_origin_t
220 static_assert ((int)SkCodec::Origin::kTopLeft_Origin       == (int)TOP_LEFT_SK_CODEC_ORIGIN,       ASSERT_MSG(SkCodec::Origin, sk_codec_origin_t));
221 static_assert ((int)SkCodec::Origin::kTopRight_Origin      == (int)TOP_RIGHT_SK_CODEC_ORIGIN,      ASSERT_MSG(SkCodec::Origin, sk_codec_origin_t));
222 static_assert ((int)SkCodec::Origin::kBottomRight_Origin   == (int)BOTTOM_RIGHT_SK_CODEC_ORIGIN,   ASSERT_MSG(SkCodec::Origin, sk_codec_origin_t));
223 static_assert ((int)SkCodec::Origin::kBottomLeft_Origin    == (int)BOTTOM_LEFT_SK_CODEC_ORIGIN,    ASSERT_MSG(SkCodec::Origin, sk_codec_origin_t));
224 static_assert ((int)SkCodec::Origin::kLeftTop_Origin       == (int)LEFT_TOP_SK_CODEC_ORIGIN,       ASSERT_MSG(SkCodec::Origin, sk_codec_origin_t));
225 static_assert ((int)SkCodec::Origin::kRightTop_Origin      == (int)RIGHT_TOP_SK_CODEC_ORIGIN,      ASSERT_MSG(SkCodec::Origin, sk_codec_origin_t));
226 static_assert ((int)SkCodec::Origin::kRightBottom_Origin   == (int)RIGHT_BOTTOM_SK_CODEC_ORIGIN,   ASSERT_MSG(SkCodec::Origin, sk_codec_origin_t));
227 static_assert ((int)SkCodec::Origin::kLeftBottom_Origin    == (int)LEFT_BOTTOM_SK_CODEC_ORIGIN,    ASSERT_MSG(SkCodec::Origin, sk_codec_origin_t));
228
229 // sk_codec_result_t
230 static_assert ((int)SkCodec::Result::kSuccess             == (int)SUCCESS_SK_CODEC_RESULT,              ASSERT_MSG(SkCodec::Result, sk_codec_result_t));
231 static_assert ((int)SkCodec::Result::kIncompleteInput     == (int)INCOMPLETE_INPUT_SK_CODEC_RESULT,     ASSERT_MSG(SkCodec::Result, sk_codec_result_t));
232 static_assert ((int)SkCodec::Result::kInvalidConversion   == (int)INVALID_CONVERSION_SK_CODEC_RESULT,   ASSERT_MSG(SkCodec::Result, sk_codec_result_t));
233 static_assert ((int)SkCodec::Result::kInvalidScale        == (int)INVALID_SCALE_SK_CODEC_RESULT,        ASSERT_MSG(SkCodec::Result, sk_codec_result_t));
234 static_assert ((int)SkCodec::Result::kInvalidParameters   == (int)INVALID_PARAMETERS_SK_CODEC_RESULT,   ASSERT_MSG(SkCodec::Result, sk_codec_result_t));
235 static_assert ((int)SkCodec::Result::kInvalidInput        == (int)INVALID_INPUT_SK_CODEC_RESULT,        ASSERT_MSG(SkCodec::Result, sk_codec_result_t));
236 static_assert ((int)SkCodec::Result::kCouldNotRewind      == (int)COULD_NOT_REWIND_SK_CODEC_RESULT,     ASSERT_MSG(SkCodec::Result, sk_codec_result_t));
237 static_assert ((int)SkCodec::Result::kUnimplemented       == (int)UNIMPLEMENTED_SK_CODEC_RESULT,        ASSERT_MSG(SkCodec::Result, sk_codec_result_t));
238
239 // sk_codec_zero_initialized_t
240 static_assert ((int)SkCodec::ZeroInitialized::kYes_ZeroInitialized   == (int)YES_SK_CODEC_ZERO_INITIALIZED,   ASSERT_MSG(SkCodec::ZeroInitialized, sk_codec_zero_initialized_t));
241 static_assert ((int)SkCodec::ZeroInitialized::kNo_ZeroInitialized    == (int)NO_SK_CODEC_ZERO_INITIALIZED,    ASSERT_MSG(SkCodec::ZeroInitialized, sk_codec_zero_initialized_t));
242
243 // sk_codec_scanline_order_t
244 static_assert ((int)SkCodec::SkScanlineOrder::kTopDown_SkScanlineOrder    == (int)TOP_DOWN_SK_CODEC_SCANLINE_ORDER,    ASSERT_MSG(SkCodec::SkScanlineOrder, sk_codec_scanline_order_t));
245 static_assert ((int)SkCodec::SkScanlineOrder::kBottomUp_SkScanlineOrder   == (int)BOTTOM_UP_SK_CODEC_SCANLINE_ORDER,   ASSERT_MSG(SkCodec::SkScanlineOrder, sk_codec_scanline_order_t));
246
247 // sk_path_effect_1d_style_t
248 static_assert ((int)SkPath1DPathEffect::Style::kTranslate_Style   == (int)TRANSLATE_SK_PATH_EFFECT_1D_STYLE,   ASSERT_MSG(SkPath1DPathEffect::Style, sk_path_effect_1d_style_t));
249 static_assert ((int)SkPath1DPathEffect::Style::kRotate_Style      == (int)ROTATE_SK_PATH_EFFECT_1D_STYLE,      ASSERT_MSG(SkPath1DPathEffect::Style, sk_path_effect_1d_style_t));
250 static_assert ((int)SkPath1DPathEffect::Style::kMorph_Style       == (int)MORPH_SK_PATH_EFFECT_1D_STYLE,       ASSERT_MSG(SkPath1DPathEffect::Style, sk_path_effect_1d_style_t));
251
252 // sk_path_effect_1d_style_t
253 static_assert ((int)SkPaint::Style::kFill_Style            == (int)FILL_SK_PAINT_STYLE,              ASSERT_MSG(SkPaint::Style, sk_paint_style_t));
254 static_assert ((int)SkPaint::Style::kStrokeAndFill_Style   == (int)STROKE_AND_FILL_SK_PAINT_STYLE,   ASSERT_MSG(SkPaint::Style, sk_paint_style_t));
255 static_assert ((int)SkPaint::Style::kStroke_Style          == (int)STROKE_SK_PAINT_STYLE,            ASSERT_MSG(SkPaint::Style, sk_paint_style_t));
256
257 // sk_path_effect_1d_style_t
258 static_assert ((int)SkPaint::Hinting::kNo_Hinting       == (int)NO_HINTING_SK_PAINT_HINTING,       ASSERT_MSG(SkPaint::Hinting, sk_paint_style_t));
259 static_assert ((int)SkPaint::Hinting::kSlight_Hinting   == (int)SLIGHT_HINTING_SK_PAINT_HINTING,   ASSERT_MSG(SkPaint::Hinting, sk_paint_style_t));
260 static_assert ((int)SkPaint::Hinting::kNormal_Hinting   == (int)NORMAL_HINTING_SK_PAINT_HINTING,   ASSERT_MSG(SkPaint::Hinting, sk_paint_style_t));
261 static_assert ((int)SkPaint::Hinting::kFull_Hinting     == (int)FULL_HINTING_SK_PAINT_HINTING,     ASSERT_MSG(SkPaint::Hinting, sk_paint_style_t));
262
263 // sk_point_mode_t
264 static_assert ((int)SkCanvas::PointMode::kPoints_PointMode    == (int)POINTS_SK_POINT_MODE,    ASSERT_MSG(SkCanvas::PointMode, sk_point_mode_t));
265 static_assert ((int)SkCanvas::PointMode::kLines_PointMode     == (int)LINES_SK_POINT_MODE,     ASSERT_MSG(SkCanvas::PointMode, sk_point_mode_t));
266 static_assert ((int)SkCanvas::PointMode::kPolygon_PointMode   == (int)POLYGON_SK_POINT_MODE,   ASSERT_MSG(SkCanvas::PointMode, sk_point_mode_t));
267
268 // sk_surfaceprops_flags_t
269 static_assert ((int)SkSurfaceProps::Flags::kUseDeviceIndependentFonts_Flag   == (int)USE_DEVICE_INDEPENDENT_FONTS_GR_SURFACE_PROPS_FLAGS,   ASSERT_MSG(SkSurfaceProps::Flags, sk_surfaceprops_flags_t));
270
271 // sk_bitmapscaler_resizemethod_t
272 static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_BOX        == (int)BOX_SK_BITMAP_SCALER_RESIZE_METHOD,        ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
273 static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_TRIANGLE   == (int)TRIANGLE_SK_BITMAP_SCALER_RESIZE_METHOD,   ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
274 static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_LANCZOS3   == (int)LANCZOS3_SK_BITMAP_SCALER_RESIZE_METHOD,   ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
275 static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_HAMMING    == (int)HAMMING_SK_BITMAP_SCALER_RESIZE_METHOD,    ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
276 static_assert ((int)SkBitmapScaler::ResizeMethod::RESIZE_MITCHELL   == (int)MITCHELL_SK_BITMAP_SCALER_RESIZE_METHOD,   ASSERT_MSG(SkBitmapScaler::ResizeMethod, sk_bitmapscaler_resizemethod_t));
277
278 // SkBudgeted
279 static_assert ((bool)SkBudgeted::kNo    == (bool)false,   ASSERT_MSG(SkBudgeted, bool));
280 static_assert ((bool)SkBudgeted::kYes   == (bool)true,    ASSERT_MSG(SkBudgeted, bool));
281
282 // sk_pathop_t
283 static_assert ((int)SkPathOp::kDifference_SkPathOp          == (int)DIFFERENCE_SK_PATHOP,           ASSERT_MSG(SkPathOp, sk_pathop_t));
284 static_assert ((int)SkPathOp::kIntersect_SkPathOp           == (int)INTERSECT_SK_PATHOP,            ASSERT_MSG(SkPathOp, sk_pathop_t));
285 static_assert ((int)SkPathOp::kUnion_SkPathOp               == (int)UNION_SK_PATHOP,                ASSERT_MSG(SkPathOp, sk_pathop_t));
286 static_assert ((int)SkPathOp::kXOR_SkPathOp                 == (int)XOR_SK_PATHOP,                  ASSERT_MSG(SkPathOp, sk_pathop_t));
287 static_assert ((int)SkPathOp::kReverseDifference_SkPathOp   == (int)REVERSE_DIFFERENCE_SK_PATHOP,   ASSERT_MSG(SkPathOp, sk_pathop_t));
288
289 // sk_path_convexity_t
290 static_assert ((int)SkPath::Convexity::kUnknown_Convexity   == (int)UNKNOWN_SK_PATH_CONVEXITY,   ASSERT_MSG(SkPath::Convexity, sk_path_convexity_t));
291 static_assert ((int)SkPath::Convexity::kConvex_Convexity    == (int)CONVEX_SK_PATH_CONVEXITY,    ASSERT_MSG(SkPath::Convexity, sk_path_convexity_t));
292 static_assert ((int)SkPath::Convexity::kConcave_Convexity   == (int)CONCAVE_SK_PATH_CONVEXITY,   ASSERT_MSG(SkPath::Convexity, sk_path_convexity_t));
293
294 // gr_backendtexture_flags_t
295 static_assert ((int)0                                              == (int)DEFAULT_SK_LATTICE_FLAGS,       ASSERT_MSG(SkCanvas::Lattice::Flags, sk_lattice_flags_t));
296 static_assert ((int)SkCanvas::Lattice::Flags::kTransparent_Flags   == (int)TRANSPARENT_SK_LATTICE_FLAGS,   ASSERT_MSG(SkCanvas::Lattice::Flags, sk_lattice_flags_t));
297
298 // sk_pathmeasure_matrixflags_t
299 static_assert ((int)SkPathMeasure::MatrixFlags::kGetPosition_MatrixFlag    == (int)GET_POSITION_SK_PATHMEASURE_MATRIXFLAGS,      ASSERT_MSG(SkPathMeasure::MatrixFlags, sk_pathmeasure_matrixflags_t));
300 static_assert ((int)SkPathMeasure::MatrixFlags::kGetTangent_MatrixFlag     == (int)GET_TANGENT_SK_PATHMEASURE_MATRIXFLAGS,       ASSERT_MSG(SkPathMeasure::MatrixFlags, sk_pathmeasure_matrixflags_t));
301 static_assert ((int)SkPathMeasure::MatrixFlags::kGetPosAndTan_MatrixFlag   == (int)GET_POS_AND_TAN_SK_PATHMEASURE_MATRIXFLAGS,   ASSERT_MSG(SkPathMeasure::MatrixFlags, sk_pathmeasure_matrixflags_t));
302
303 // sk_encodedinfo_alpha_t
304 static_assert ((int)SkEncodedInfo::Alpha::kOpaque_Alpha     == (int)OPAQUE_SK_ENCODEDINFO_ALPHA,     ASSERT_MSG(SkEncodedInfo::Alpha, sk_encodedinfo_alpha_t));
305 static_assert ((int)SkEncodedInfo::Alpha::kUnpremul_Alpha   == (int)UNPREMUL_SK_ENCODEDINFO_ALPHA,   ASSERT_MSG(SkEncodedInfo::Alpha, sk_encodedinfo_alpha_t));
306 static_assert ((int)SkEncodedInfo::Alpha::kBinary_Alpha     == (int)BINARY_SK_ENCODEDINFO_ALPHA,     ASSERT_MSG(SkEncodedInfo::Alpha, sk_encodedinfo_alpha_t));
307
308 // sk_encodedinfo_color_t
309 static_assert ((int)SkEncodedInfo::Color::kGray_Color           == (int)GRAY_SK_ENCODEDINFO_COLOR,            ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
310 static_assert ((int)SkEncodedInfo::Color::kGrayAlpha_Color      == (int)GRAY_ALPHA_SK_ENCODEDINFO_COLOR,      ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
311 static_assert ((int)SkEncodedInfo::Color::kPalette_Color        == (int)PALETTE_SK_ENCODEDINFO_COLOR,         ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
312 static_assert ((int)SkEncodedInfo::Color::kRGB_Color            == (int)RGB_SK_ENCODEDINFO_COLOR,             ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
313 static_assert ((int)SkEncodedInfo::Color::kRGBA_Color           == (int)RGBA_SK_ENCODEDINFO_COLOR,            ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
314 static_assert ((int)SkEncodedInfo::Color::kBGR_Color            == (int)BGR_SK_ENCODEDINFO_COLOR,             ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
315 static_assert ((int)SkEncodedInfo::Color::kBGRX_Color           == (int)BGRX_SK_ENCODEDINFO_COLOR,            ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
316 static_assert ((int)SkEncodedInfo::Color::kBGRA_Color           == (int)BGRA_SK_ENCODEDINFO_COLOR,            ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
317 static_assert ((int)SkEncodedInfo::Color::kYUV_Color            == (int)YUV_SK_ENCODEDINFO_COLOR,             ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
318 static_assert ((int)SkEncodedInfo::Color::kYUVA_Color           == (int)YUVA_SK_ENCODEDINFO_COLOR,            ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
319 static_assert ((int)SkEncodedInfo::Color::kInvertedCMYK_Color   == (int)INVERTED_CMYK_SK_ENCODEDINFO_COLOR,   ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
320 static_assert ((int)SkEncodedInfo::Color::kYCCK_Color           == (int)YCCK_SK_ENCODEDINFO_COLOR,            ASSERT_MSG(SkEncodedInfo::Color, sk_encodedinfo_color_t));
321
322 // sk_mask_format_t
323 static_assert ((int)SkMask::Format::kBW_Format       == (int)BW_SK_MASK_FORMAT,        ASSERT_MSG(SkMask::Format, sk_mask_format_t));
324 static_assert ((int)SkMask::Format::kA8_Format       == (int)A8_SK_MASK_FORMAT,        ASSERT_MSG(SkMask::Format, sk_mask_format_t));
325 static_assert ((int)SkMask::Format::k3D_Format       == (int)THREE_D_SK_MASK_FORMAT,   ASSERT_MSG(SkMask::Format, sk_mask_format_t));
326 static_assert ((int)SkMask::Format::kARGB32_Format   == (int)ARGB32_SK_MASK_FORMAT,    ASSERT_MSG(SkMask::Format, sk_mask_format_t));
327 static_assert ((int)SkMask::Format::kLCD16_Format    == (int)LCD16_SK_MASK_FORMAT,     ASSERT_MSG(SkMask::Format, sk_mask_format_t));
328
329 // sk_matrix44_type_mask_t
330 static_assert ((int)SkMatrix44::TypeMask::kIdentity_Mask      == (int)IDENTITY_SK_MATRIX44_TYPE_MASK,      ASSERT_MSG(SkMatrix44::TypeMask, sk_matrix44_type_mask_t));
331 static_assert ((int)SkMatrix44::TypeMask::kTranslate_Mask     == (int)TRANSLATE_SK_MATRIX44_TYPE_MASK,     ASSERT_MSG(SkMatrix44::TypeMask, sk_matrix44_type_mask_t));
332 static_assert ((int)SkMatrix44::TypeMask::kScale_Mask         == (int)SCALE_SK_MATRIX44_TYPE_MASK,         ASSERT_MSG(SkMatrix44::TypeMask, sk_matrix44_type_mask_t));
333 static_assert ((int)SkMatrix44::TypeMask::kAffine_Mask        == (int)AFFINE_SK_MATRIX44_TYPE_MASK,        ASSERT_MSG(SkMatrix44::TypeMask, sk_matrix44_type_mask_t));
334 static_assert ((int)SkMatrix44::TypeMask::kPerspective_Mask   == (int)PERSPECTIVE_SK_MATRIX44_TYPE_MASK,   ASSERT_MSG(SkMatrix44::TypeMask, sk_matrix44_type_mask_t));
335
336 // sk_vertices_vertex_mode_t
337 static_assert ((int)SkVertices::VertexMode::kTriangles_VertexMode       == (int)TRIANGLES_SK_VERTICES_VERTEX_MODE,        ASSERT_MSG(SkVertices::VertexMode, sk_vertices_vertex_mode_t));
338 static_assert ((int)SkVertices::VertexMode::kTriangleStrip_VertexMode   == (int)TRIANGLE_STRIP_SK_VERTICES_VERTEX_MODE,   ASSERT_MSG(SkVertices::VertexMode, sk_vertices_vertex_mode_t));
339 static_assert ((int)SkVertices::VertexMode::kTriangleFan_VertexMode     == (int)TRIANGLE_FAN_SK_VERTICES_VERTEX_MODE,     ASSERT_MSG(SkVertices::VertexMode, sk_vertices_vertex_mode_t));
340
341 // sk_image_caching_hint_t
342 static_assert ((int)SkImage::CachingHint::kAllow_CachingHint      == (int)ALLOW_SK_IMAGE_CACHING_HINT,      ASSERT_MSG(SkImage::CachingHint, sk_image_caching_hint_t));
343 static_assert ((int)SkImage::CachingHint::kDisallow_CachingHint   == (int)DISALLOW_SK_IMAGE_CACHING_HINT,   ASSERT_MSG(SkImage::CachingHint, sk_image_caching_hint_t));
344
345 // sk_bitmap_allocflags_t
346 static_assert ((int)SkBitmap::AllocFlags::kZeroPixels_AllocFlag   == (int)ZERO_PIXELS_SK_BITMAP_ALLOC_FLAGS,   ASSERT_MSG(SkBitmap::AllocFlags, sk_bitmap_allocflags_t));
347
348 #if SK_SUPPORT_GPU
349
350 // gr_surfaceorigin_t
351 static_assert ((int)GrSurfaceOrigin::kBottomLeft_GrSurfaceOrigin   == (int)BOTTOM_LEFT_GR_SURFACE_ORIGIN,   ASSERT_MSG(GrSurfaceOrigin, gr_surfaceorigin_t));
352 static_assert ((int)GrSurfaceOrigin::kTopLeft_GrSurfaceOrigin      == (int)TOP_LEFT_GR_SURFACE_ORIGIN,      ASSERT_MSG(GrSurfaceOrigin, gr_surfaceorigin_t));
353
354 // gr_pixelconfig_t
355 static_assert ((int)GrPixelConfig::kUnknown_GrPixelConfig          == (int)UNKNOWN_GR_PIXEL_CONFIG,          ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
356 static_assert ((int)GrPixelConfig::kAlpha_8_GrPixelConfig          == (int)ALPHA_8_GR_PIXEL_CONFIG,          ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
357 static_assert ((int)GrPixelConfig::kGray_8_GrPixelConfig           == (int)GRAY_8_GR_PIXEL_CONFIG,           ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
358 static_assert ((int)GrPixelConfig::kRGB_565_GrPixelConfig          == (int)RGB_565_GR_PIXEL_CONFIG,          ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
359 static_assert ((int)GrPixelConfig::kRGBA_4444_GrPixelConfig        == (int)RGBA_4444_GR_PIXEL_CONFIG,        ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
360 static_assert ((int)GrPixelConfig::kRGBA_8888_GrPixelConfig        == (int)RGBA_8888_GR_PIXEL_CONFIG,        ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
361 static_assert ((int)GrPixelConfig::kBGRA_8888_GrPixelConfig        == (int)BGRA_8888_GR_PIXEL_CONFIG,        ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
362 static_assert ((int)GrPixelConfig::kSRGBA_8888_GrPixelConfig       == (int)SRGBA_8888_GR_PIXEL_CONFIG,       ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
363 static_assert ((int)GrPixelConfig::kSBGRA_8888_GrPixelConfig       == (int)SBGRA_8888_GR_PIXEL_CONFIG,       ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
364 static_assert ((int)GrPixelConfig::kRGBA_8888_sint_GrPixelConfig   == (int)RGBA_8888_SINT_GR_PIXEL_CONFIG,   ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
365 static_assert ((int)GrPixelConfig::kETC1_GrPixelConfig             == (int)ETC1_GR_PIXEL_CONFIG,             ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
366 static_assert ((int)GrPixelConfig::kRGBA_float_GrPixelConfig       == (int)RGBA_FLOAT_GR_PIXEL_CONFIG,       ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
367 static_assert ((int)GrPixelConfig::kRG_float_GrPixelConfig         == (int)RG_FLOAT_GR_PIXEL_CONFIG,         ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
368 static_assert ((int)GrPixelConfig::kAlpha_half_GrPixelConfig       == (int)ALPHA_HALF_GR_PIXEL_CONFIG,       ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
369 static_assert ((int)GrPixelConfig::kRGBA_half_GrPixelConfig        == (int)RGBA_HALF_GR_PIXEL_CONFIG,        ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
370
371 // gr_backendtexture_flags_t
372 static_assert ((int)GrBackendTextureFlags::kNone_GrBackendTextureFlag           == (int)NONE_GR_BACKEND_TEXTURE_FLAGS,            ASSERT_MSG(GrBackendTextureFlags, gr_backendtexture_flags_t));
373 static_assert ((int)GrBackendTextureFlags::kRenderTarget_GrBackendTextureFlag   == (int)RENDER_TARGET_GR_BACKEND_TEXTURE_FLAGS,   ASSERT_MSG(GrBackendTextureFlags, gr_backendtexture_flags_t));
374
375 // gr_backend_t
376 static_assert ((int)GrBackend::kOpenGL_GrBackend   == (int)OPENGL_GR_BACKEND,   ASSERT_MSG(GrBackend, gr_backend_t));
377 static_assert ((int)GrBackend::kVulkan_GrBackend   == (int)VULKAN_GR_BACKEND,   ASSERT_MSG(GrBackend, gr_backend_t));
378
379 // gr_contextoptions_gpupathrenderers_t
380 static_assert ((int)GrContextOptions::GpuPathRenderers::kNone              == (int)NONE_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,                ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
381 static_assert ((int)GrContextOptions::GpuPathRenderers::kDashLine          == (int)DASHLINE_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,            ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
382 static_assert ((int)GrContextOptions::GpuPathRenderers::kStencilAndCover   == (int)STENCIL_AND_COVER_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,   ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
383 static_assert ((int)GrContextOptions::GpuPathRenderers::kMSAA              == (int)MSAA_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,                ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
384 static_assert ((int)GrContextOptions::GpuPathRenderers::kAAHairline        == (int)AA_HAIRLINE_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,         ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
385 static_assert ((int)GrContextOptions::GpuPathRenderers::kAAConvex          == (int)AA_CONVEX_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,           ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
386 static_assert ((int)GrContextOptions::GpuPathRenderers::kAALinearizing     == (int)AA_LINEARIZING_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,      ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
387 static_assert ((int)GrContextOptions::GpuPathRenderers::kSmall             == (int)SMALL_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,               ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
388 static_assert ((int)GrContextOptions::GpuPathRenderers::kTessellating      == (int)TESSELLATING_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,        ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
389 static_assert ((int)GrContextOptions::GpuPathRenderers::kDefault           == (int)DEFAULT_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,             ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
390 static_assert ((int)GrContextOptions::GpuPathRenderers::kAll               == (int)ALL_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS,                 ASSERT_MSG(GrContextOptions::GpuPathRenderers, gr_contextoptions_gpupathrenderers_t));
391
392 #endif
393
394 #endif