2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9 // DO NOT USE -- FOR INTERNAL TESTING ONLY
11 #ifndef sk_types_DEFINED
12 #define sk_types_DEFINED
18 #define SK_C_PLUS_PLUS_BEGIN_GUARD extern "C" {
19 #define SK_C_PLUS_PLUS_END_GUARD }
22 #define SK_C_PLUS_PLUS_BEGIN_GUARD
23 #define SK_C_PLUS_PLUS_END_GUARD
26 #if !defined(SK_C_API)
27 #if defined(SKIA_C_DLL)
29 #if SKIA_IMPLEMENTATION
30 #define SK_C_API __declspec(dllexport)
32 #define SK_C_API __declspec(dllimport)
35 #define SK_C_API __attribute__((visibility("default")))
42 ///////////////////////////////////////////////////////////////////////////////////////
44 SK_C_PLUS_PLUS_BEGIN_GUARD
46 typedef uint32_t sk_color_t;
47 typedef uint32_t sk_pmcolor_t;
49 /* This macro assumes all arguments are >=0 and <=255. */
50 #define sk_color_set_argb(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
51 #define sk_color_get_a(c) (((c) >> 24) & 0xFF)
52 #define sk_color_get_r(c) (((c) >> 16) & 0xFF)
53 #define sk_color_get_g(c) (((c) >> 8) & 0xFF)
54 #define sk_color_get_b(c) (((c) >> 0) & 0xFF)
57 UNKNOWN_SK_COLORTYPE = 0,
60 ARGB_4444_SK_COLORTYPE,
61 RGBA_8888_SK_COLORTYPE,
62 BGRA_8888_SK_COLORTYPE,
65 RGBA_F16_SK_COLORTYPE,
72 UNPREMUL_SK_ALPHATYPE,
76 UNKNOWN_SK_PIXELGEOMETRY,
77 RGB_H_SK_PIXELGEOMETRY,
78 BGR_H_SK_PIXELGEOMETRY,
79 RGB_V_SK_PIXELGEOMETRY,
80 BGR_V_SK_PIXELGEOMETRY,
86 sk_colortype_t colorType;
87 sk_alphatype_t alphaType;
91 USE_DEVICE_INDEPENDENT_FONTS_GR_SURFACE_PROPS_FLAGS = 1 << 0,
92 } sk_surfaceprops_flags_t;
95 sk_pixelgeometry_t pixelGeometry;
96 sk_surfaceprops_flags_t flags;
104 typedef sk_point_t sk_vector_t;
121 The sk_matrix_t struct holds a 3x3 perspective matrix for
122 transforming coordinates:
125 X = (M[0] * x + M[1] * y + M[2]) / (M[6] * x + M[7] * y + M[8]);
126 Y = (M[3] * x + M[4] * y + M[5]) / (M[6] * x + M[7] * y + M[8]);
128 Therefore, the identity matrix is
130 sk_matrix_t identity = {{1, 0, 0,
134 A matrix that scales by sx and sy is:
136 sk_matrix_t scale = {{sx, 0, 0,
140 A matrix that translates by tx and ty is:
142 sk_matrix_t translate = {{1, 0, tx,
146 A matrix that rotates around the origin by A radians:
148 sk_matrix_t rotate = {{cos(A), -sin(A), 0,
152 Two matrixes can be concatinated by:
154 void concat_matrices(sk_matrix_t* dst,
155 const sk_matrix_t* matrixU,
156 const sk_matrix_t* matrixV) {
157 const float* u = matrixU->mat;
158 const float* v = matrixV->mat;
159 sk_matrix_t result = {{
160 u[0] * v[0] + u[1] * v[3] + u[2] * v[6],
161 u[0] * v[1] + u[1] * v[4] + u[2] * v[7],
162 u[0] * v[2] + u[1] * v[5] + u[2] * v[8],
163 u[3] * v[0] + u[4] * v[3] + u[5] * v[6],
164 u[3] * v[1] + u[4] * v[4] + u[5] * v[7],
165 u[3] * v[2] + u[4] * v[5] + u[5] * v[8],
166 u[6] * v[0] + u[7] * v[3] + u[8] * v[6],
167 u[6] * v[1] + u[7] * v[4] + u[8] * v[7],
168 u[6] * v[2] + u[7] * v[5] + u[8] * v[8]
177 typedef struct sk_matrix44_t sk_matrix44_t;
180 IDENTITY_SK_MATRIX44_TYPE_MASK = 0,
181 TRANSLATE_SK_MATRIX44_TYPE_MASK = 0x01,
182 SCALE_SK_MATRIX44_TYPE_MASK = 0x02,
183 AFFINE_SK_MATRIX44_TYPE_MASK = 0x04,
184 PERSPECTIVE_SK_MATRIX44_TYPE_MASK = 0x08
185 } sk_matrix44_type_mask_t;
188 A sk_canvas_t encapsulates all of the state about drawing into a
189 destination This includes a reference to the destination itself,
190 and a stack of matrix/clip values.
192 typedef struct sk_canvas_t sk_canvas_t;
194 A sk_data_ holds an immutable data buffer.
196 typedef struct sk_data_t sk_data_t;
198 A sk_image_t is an abstraction for drawing a rectagle of pixels.
199 The content of the image is always immutable, though the actual
200 storage may change, if for example that image can be re-created via
201 encoded data or other means.
203 typedef struct sk_image_t sk_image_t;
205 A sk_maskfilter_t is an object that perform transformations on an
206 alpha-channel mask before drawing it; it may be installed into a
207 sk_paint_t. Each time a primitive is drawn, it is first
208 scan-converted into a alpha mask, which os handed to the
209 maskfilter, which may create a new mask is to render into the
212 typedef struct sk_maskfilter_t sk_maskfilter_t;
214 A sk_paint_t holds the style and color information about how to
215 draw geometries, text and bitmaps.
217 typedef struct sk_paint_t sk_paint_t;
219 A sk_path_t encapsulates compound (multiple contour) geometric
220 paths consisting of straight line segments, quadratic curves, and
223 typedef struct sk_path_t sk_path_t;
225 A sk_picture_t holds recorded canvas drawing commands to be played
226 back at a later time.
228 typedef struct sk_picture_t sk_picture_t;
230 A sk_picture_recorder_t holds a sk_canvas_t that records commands
231 to create a sk_picture_t.
233 typedef struct sk_picture_recorder_t sk_picture_recorder_t;
235 A sk_shader_t specifies the source color(s) for what is being drawn. If a
236 paint has no shader, then the paint's color is used. If the paint
237 has a shader, then the shader's color(s) are use instead, but they
238 are modulated by the paint's alpha.
240 typedef struct sk_shader_t sk_shader_t;
242 A sk_surface_t holds the destination for drawing to a canvas. For
243 raster drawing, the destination is an array of pixels in memory.
244 For GPU drawing, the destination is a texture or a framebuffer.
246 typedef struct sk_surface_t sk_surface_t;
248 The sk_region encapsulates the geometric region used to specify
249 clipping areas for drawing.
251 typedef struct sk_region_t sk_region_t;
257 SRCOVER_SK_BLENDMODE,
258 DSTOVER_SK_BLENDMODE,
263 SRCATOP_SK_BLENDMODE,
264 DSTATOP_SK_BLENDMODE,
267 MODULATE_SK_BLENDMODE,
269 OVERLAY_SK_BLENDMODE,
271 LIGHTEN_SK_BLENDMODE,
272 COLORDODGE_SK_BLENDMODE,
273 COLORBURN_SK_BLENDMODE,
274 HARDLIGHT_SK_BLENDMODE,
275 SOFTLIGHT_SK_BLENDMODE,
276 DIFFERENCE_SK_BLENDMODE,
277 EXCLUSION_SK_BLENDMODE,
278 MULTIPLY_SK_BLENDMODE,
280 SATURATION_SK_BLENDMODE,
282 LUMINOSITY_SK_BLENDMODE,
285 //////////////////////////////////////////////////////////////////////////////////////////
309 uint32_t fFlags; // Bit field to identify which values are unknown
310 float fTop; // The greatest distance above the baseline for any glyph (will be <= 0)
311 float fAscent; // The recommended distance above the baseline (will be <= 0)
312 float fDescent; // The recommended distance below the baseline (will be >= 0)
313 float fBottom; // The greatest distance below the baseline for any glyph (will be >= 0)
314 float fLeading; // The recommended distance to add between lines of text (will be >= 0)
315 float fAvgCharWidth; // the average character width (>= 0)
316 float fMaxCharWidth; // the max character width (>= 0)
317 float fXMin; // The minimum bounding box x value for all glyphs
318 float fXMax; // The maximum bounding box x value for all glyphs
319 float fXHeight; // The height of an 'x' in px, or 0 if no 'x' in face
320 float fCapHeight; // The cap height (> 0), or 0 if cannot be determined.
321 float fUnderlineThickness; // underline thickness, or 0 if cannot be determined
322 float fUnderlinePosition; // underline position, or 0 if cannot be determined
325 // Flags for fFlags member of sk_fontmetrics_t
326 #define FONTMETRICS_FLAGS_UNDERLINE_THICKNESS_IS_VALID (1U << 0)
327 #define FONTMETRICS_FLAGS_UNDERLINE_POSITION_IS_VALID (1U << 1)
330 A lightweight managed string.
332 typedef struct sk_string_t sk_string_t;
335 A sk_bitmap_t is an abstraction that specifies a raster bitmap.
337 typedef struct sk_bitmap_t sk_bitmap_t;
338 typedef struct sk_pixmap_t sk_pixmap_t;
339 typedef struct sk_colorfilter_t sk_colorfilter_t;
340 typedef struct sk_imagefilter_t sk_imagefilter_t;
341 typedef struct sk_imagefilter_croprect_t sk_imagefilter_croprect_t;
344 A sk_typeface_t pecifies the typeface and intrinsic style of a font.
345 This is used in the paint, along with optionally algorithmic settings like
346 textSize, textSkewX, textScaleX, kFakeBoldText_Mask, to specify
347 how text appears when drawn (and measured).
349 Typeface objects are immutable, and so they can be shared between threads.
351 typedef struct sk_typeface_t sk_typeface_t;
352 typedef uint32_t sk_font_table_tag_t;
353 typedef struct sk_fontmgr_t sk_fontmgr_t;
355 * Abstraction layer directly on top of an image codec.
357 typedef struct sk_codec_t sk_codec_t;
358 typedef struct sk_colorspace_t sk_colorspace_t;
362 typedef struct sk_stream_t sk_stream_t;
363 typedef struct sk_stream_filestream_t sk_stream_filestream_t;
364 typedef struct sk_stream_asset_t sk_stream_asset_t;
365 typedef struct sk_stream_memorystream_t sk_stream_memorystream_t;
366 typedef struct sk_stream_streamrewindable_t sk_stream_streamrewindable_t;
367 typedef struct sk_wstream_t sk_wstream_t;
368 typedef struct sk_wstream_filestream_t sk_wstream_filestream_t;
369 typedef struct sk_wstream_dynamicmemorystream_t sk_wstream_dynamicmemorystream_t;
371 High-level API for creating a document-based canvas.
373 typedef struct sk_document_t sk_document_t;
382 POINTS_SK_POINT_MODE,
384 POLYGON_SK_POINT_MODE
389 CENTER_SK_TEXT_ALIGN,
394 UTF8_SK_TEXT_ENCODING,
395 UTF16_SK_TEXT_ENCODING,
396 UTF32_SK_TEXT_ENCODING,
397 GLYPH_ID_SK_TEXT_ENCODING
398 } sk_text_encoding_t;
401 WINDING_SK_PATH_FILLTYPE,
402 EVENODD_SK_PATH_FILLTYPE,
403 INVERSE_WINDING_SK_PATH_FILLTYPE,
404 INVERSE_EVENODD_SK_PATH_FILLTYPE,
405 } sk_path_filltype_t;
408 NORMAL_TYPEFACE_STYLE = 0,
409 BOLD_TYPEFACE_STYLE = 0x01,
410 ITALIC_TYPEFACE_STYLE = 0x02,
411 BOLD_ITALIC_TYPEFACE_STYLE = 0x03
412 } sk_typeface_style_t;
415 UPRIGHT_SK_FONT_STYLE_SLANT = 0,
416 ITALIC_SK_FONT_STYLE_SLANT = 1,
417 OBLIQUE_SK_FONT_STYLE_SLANT = 2,
418 } sk_font_style_slant_t;
421 NONE_SK_FILTER_QUALITY,
422 LOW_SK_FILTER_QUALITY,
423 MEDIUM_SK_FILTER_QUALITY,
424 HIGH_SK_FILTER_QUALITY
425 } sk_filter_quality_t;
428 HAS_LEFT_SK_CROP_RECT_FLAG = 0x01,
429 HAS_TOP_SK_CROP_RECT_FLAG = 0x02,
430 HAS_WIDTH_SK_CROP_RECT_FLAG = 0x04,
431 HAS_HEIGHT_SK_CROP_RECT_FLAG = 0x08,
432 HAS_ALL_SK_CROP_RECT_FLAG = 0x0F,
433 } sk_crop_rect_flags_t;
436 DRAW_SHADOW_AND_FOREGROUND_SK_DROP_SHADOW_IMAGE_FILTER_SHADOW_MODE,
437 DRAW_SHADOW_ONLY_SK_DROP_SHADOW_IMAGE_FILTER_SHADOW_MODE,
438 } sk_drop_shadow_image_filter_shadow_mode_t;
441 UNKNOWN_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,
442 R_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,
443 G_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,
444 B_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,
445 A_SK_DISPLACEMENT_MAP_EFFECT_CHANNEL_SELECTOR_TYPE,
446 } sk_displacement_map_effect_channel_selector_type_t;
449 CLAMP_SK_MATRIX_CONVOLUTION_TILEMODE,
450 REPEAT_SK_MATRIX_CONVOLUTION_TILEMODE,
451 CLAMP_TO_BLACK_SK_MATRIX_CONVOLUTION_TILEMODE,
452 } sk_matrix_convolution_tilemode_t;
455 The logical operations that can be performed when combining two regions.
458 DIFFERENCE_SK_REGION_OP, //!< subtract the op region from the first region
459 INTERSECT_SK_REGION_OP, //!< intersect the two regions
460 UNION_SK_REGION_OP, //!< union (inclusive-or) the two regions
461 XOR_SK_REGION_OP, //!< exclusive-or the two regions
462 REVERSE_DIFFERENCE_SK_REGION_OP, //!< subtract the first region from the op region
463 REPLACE_SK_REGION_OP, //!< replace the dst region with the op region
467 DIFFERENCE_SK_CLIPOP,
472 * Enum describing format of encoded data.
475 BMP_SK_ENCODED_FORMAT,
476 GIF_SK_ENCODED_FORMAT,
477 ICO_SK_ENCODED_FORMAT,
478 JPEG_SK_ENCODED_FORMAT,
479 PNG_SK_ENCODED_FORMAT,
480 WBMP_SK_ENCODED_FORMAT,
481 WEBP_SK_ENCODED_FORMAT,
482 PKM_SK_ENCODED_FORMAT,
483 KTX_SK_ENCODED_FORMAT,
484 ASTC_SK_ENCODED_FORMAT,
485 DNG_SK_ENCODED_FORMAT
486 } sk_encoded_image_format_t;
489 TOP_LEFT_SK_CODEC_ORIGIN = 1, // Default
490 TOP_RIGHT_SK_CODEC_ORIGIN = 2, // Reflected across y-axis
491 BOTTOM_RIGHT_SK_CODEC_ORIGIN = 3, // Rotated 180
492 BOTTOM_LEFT_SK_CODEC_ORIGIN = 4, // Reflected across x-axis
493 LEFT_TOP_SK_CODEC_ORIGIN = 5, // Reflected across x-axis, Rotated 90 CCW
494 RIGHT_TOP_SK_CODEC_ORIGIN = 6, // Rotated 90 CW
495 RIGHT_BOTTOM_SK_CODEC_ORIGIN = 7, // Reflected across x-axis, Rotated 90 CW
496 LEFT_BOTTOM_SK_CODEC_ORIGIN = 8, // Rotated 90 CCW
500 SUCCESS_SK_CODEC_RESULT,
501 INCOMPLETE_INPUT_SK_CODEC_RESULT,
502 INVALID_CONVERSION_SK_CODEC_RESULT,
503 INVALID_SCALE_SK_CODEC_RESULT,
504 INVALID_PARAMETERS_SK_CODEC_RESULT,
505 INVALID_INPUT_SK_CODEC_RESULT,
506 COULD_NOT_REWIND_SK_CODEC_RESULT,
507 UNIMPLEMENTED_SK_CODEC_RESULT,
511 YES_SK_CODEC_ZERO_INITIALIZED,
512 NO_SK_CODEC_ZERO_INITIALIZED,
513 } sk_codec_zero_initialized_t;
516 sk_codec_zero_initialized_t fZeroInitialized;
520 } sk_codec_options_t;
523 TOP_DOWN_SK_CODEC_SCANLINE_ORDER,
524 BOTTOM_UP_SK_CODEC_SCANLINE_ORDER,
525 } sk_codec_scanline_order_t;
527 // The verbs that can be foudn on a path
538 typedef struct sk_path_iterator_t sk_path_iterator_t;
539 typedef struct sk_path_rawiterator_t sk_path_rawiterator_t;
542 APPEND_SK_PATH_ADD_MODE,
543 EXTEND_SK_PATH_ADD_MODE,
544 } sk_path_add_mode_t;
547 LINE_SK_PATH_SEGMENT_MASK = 1 << 0,
548 QUAD_SK_PATH_SEGMENT_MASK = 1 << 1,
549 CONIC_SK_PATH_SEGMENT_MASK = 1 << 2,
550 CUBIC_SK_PATH_SEGMENT_MASK = 1 << 3,
551 } sk_path_segment_mask_t;
554 TRANSLATE_SK_PATH_EFFECT_1D_STYLE,
555 ROTATE_SK_PATH_EFFECT_1D_STYLE,
556 MORPH_SK_PATH_EFFECT_1D_STYLE,
557 } sk_path_effect_1d_style_t;
559 typedef struct sk_path_effect_t sk_path_effect_t;
568 MITER_SK_STROKE_JOIN,
569 ROUND_SK_STROKE_JOIN,
574 CLAMP_SK_SHADER_TILEMODE,
575 REPEAT_SK_SHADER_TILEMODE,
576 MIRROR_SK_SHADER_TILEMODE,
577 } sk_shader_tilemode_t;
580 NORMAL_SK_BLUR_STYLE, //!< fuzzy inside and outside
581 SOLID_SK_BLUR_STYLE, //!< solid inside, fuzzy outside
582 OUTER_SK_BLUR_STYLE, //!< nothing inside, fuzzy outside
583 INNER_SK_BLUR_STYLE, //!< fuzzy inside, nothing outside
587 NONE_SK_BLUR_MASK_FILTER_BLUR_FLAGS = 0x00,
588 IGNORE_TRANSFORM_SK_BLUR_MASK_FILTER_BLUR_FLAGS = 0x01,
589 HIGHT_QUALITY_SK_BLUR_MASK_FILTER_BLUR_FLAGS = 0x02,
590 ALL_SK_BLUR_MASK_FILTER_BLUR_FLAGS = 0x03,
591 } sk_blurmaskfilter_blurflags_t;
594 CW_SK_PATH_DIRECTION,
595 CCW_SK_PATH_DIRECTION,
596 } sk_path_direction_t;
599 SMALL_SK_PATH_ARC_SIZE,
600 LARGE_SK_PATH_ARC_SIZE,
601 } sk_path_arc_size_t;
605 STROKE_SK_PAINT_STYLE,
606 STROKE_AND_FILL_SK_PAINT_STYLE,
610 NO_HINTING_SK_PAINT_HINTING,
611 SLIGHT_HINTING_SK_PAINT_HINTING,
612 NORMAL_HINTING_SK_PAINT_HINTING,
613 FULL_HINTING_SK_PAINT_HINTING,
614 } sk_paint_hinting_t;
616 typedef struct sk_colortable_t sk_colortable_t;
618 typedef struct sk_pixelref_factory_t sk_pixelref_factory_t;
621 BOX_SK_BITMAP_SCALER_RESIZE_METHOD,
622 TRIANGLE_SK_BITMAP_SCALER_RESIZE_METHOD,
623 LANCZOS3_SK_BITMAP_SCALER_RESIZE_METHOD,
624 HAMMING_SK_BITMAP_SCALER_RESIZE_METHOD,
625 MITCHELL_SK_BITMAP_SCALER_RESIZE_METHOD,
626 } sk_bitmapscaler_resizemethod_t;
629 TOP_LEFT_GR_SURFACE_ORIGIN = 1,
630 BOTTOM_LEFT_GR_SURFACE_ORIGIN,
631 } gr_surfaceorigin_t;
634 UNKNOWN_GR_PIXEL_CONFIG,
635 ALPHA_8_GR_PIXEL_CONFIG,
636 GRAY_8_GR_PIXEL_CONFIG,
637 RGB_565_GR_PIXEL_CONFIG,
638 RGBA_4444_GR_PIXEL_CONFIG,
639 RGBA_8888_GR_PIXEL_CONFIG,
640 BGRA_8888_GR_PIXEL_CONFIG,
641 SRGBA_8888_GR_PIXEL_CONFIG,
642 SBGRA_8888_GR_PIXEL_CONFIG,
643 RGBA_8888_SINT_GR_PIXEL_CONFIG,
644 ETC1_GR_PIXEL_CONFIG,
645 RGBA_FLOAT_GR_PIXEL_CONFIG,
646 RG_FLOAT_GR_PIXEL_CONFIG,
647 ALPHA_HALF_GR_PIXEL_CONFIG,
648 RGBA_HALF_GR_PIXEL_CONFIG,
652 BW_SK_MASK_FORMAT, //!< 1bit per pixel mask (e.g. monochrome)
653 A8_SK_MASK_FORMAT, //!< 8bits per pixel mask (e.g. antialiasing)
654 THREE_D_SK_MASK_FORMAT, //!< 3 8bit per pixl planes: alpha, mul, add
655 ARGB32_SK_MASK_FORMAT, //!< SkPMColor
656 LCD16_SK_MASK_FORMAT, //!< 565 alpha for r/g/b
663 sk_mask_format_t fFormat;
667 NONE_GR_CONTEXT_FLUSHBITS = 0,
668 DISCARD_GR_CONTEXT_FLUSHBITS = 0x2,
669 } gr_context_flushbits_t;
671 typedef intptr_t gr_backendobject_t;
676 gr_pixelconfig_t fConfig;
677 gr_surfaceorigin_t fOrigin;
680 gr_backendobject_t fRenderTargetHandle;
681 } gr_backend_rendertarget_desc_t;
684 NONE_GR_BACKEND_TEXTURE_FLAGS = 0,
685 RENDER_TARGET_GR_BACKEND_TEXTURE_FLAGS = 1,
686 } gr_backendtexture_flags_t;
689 gr_backendtexture_flags_t fFlags;
690 gr_surfaceorigin_t fOrigin;
693 gr_pixelconfig_t fConfig;
695 gr_backendobject_t fTextureHandle;
696 } gr_backend_texture_desc_t;
698 typedef struct gr_context_t gr_context_t;
701 NONE_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 0,
702 DASHLINE_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 0,
703 STENCIL_AND_COVER_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 1,
704 MSAA_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 2,
705 AA_HAIRLINE_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 3,
706 AA_CONVEX_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 4,
707 AA_LINEARIZING_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 5,
708 PLS_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 6,
709 DISTANCE_FIELD_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 7,
710 TESSELLATING_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 8,
711 DEFAULT_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = 1 << 9,
713 ALL_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS = DEFAULT_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS | (DEFAULT_GR_CONTEXT_OPTIONS_GPU_PATH_RENDERERS - 1)
714 } gr_contextoptions_gpupathrenderers_t;
717 bool fSuppressPrints;
718 int fMaxTextureSizeOverride;
719 int fMaxTileSizeOverride;
720 bool fSuppressDualSourceBlending;
721 int fBufferMapThreshold;
722 bool fUseDrawInsteadOfPartialRenderTargetWrite;
724 bool fClipDrawOpsToBounds;
725 int fMaxOpCombineLookback;
726 int fMaxOpCombineLookahead;
727 bool fUseShaderSwizzling;
728 bool fDoManualMipmapping;
729 bool fEnableInstancedRendering;
730 bool fAllowPathMaskCaching;
731 bool fRequireDecodeDisableForSRGB;
732 bool fDisableGpuYUVConversion;
733 bool fSuppressPathRendering;
734 gr_contextoptions_gpupathrenderers_t fGpuPathRenderers;
735 } gr_context_options_t;
742 typedef intptr_t gr_backendcontext_t;
744 typedef struct gr_glinterface_t gr_glinterface_t;
746 typedef void (*gr_gl_func_ptr)();
747 typedef gr_gl_func_ptr (*gr_gl_get_proc)(void* ctx, const char* name);
750 DIFFERENCE_SK_PATHOP,
754 REVERSE_DIFFERENCE_SK_PATHOP,
757 typedef struct sk_opbuilder_t sk_opbuilder_t;
760 UNKNOWN_SK_PATH_CONVEXITY,
761 CONVEX_SK_PATH_CONVEXITY,
762 CONCAVE_SK_PATH_CONVEXITY,
763 } sk_path_convexity_t;
766 DEFAULT_SK_LATTICE_FLAGS,
767 TRANSPARENT_SK_LATTICE_FLAGS = 1 << 0,
768 } sk_lattice_flags_t;
773 const sk_lattice_flags_t* fFlags;
776 const sk_irect_t* fBounds;
779 typedef struct sk_pathmeasure_t sk_pathmeasure_t;
782 GET_POSITION_SK_PATHMEASURE_MATRIXFLAGS = 0x01,
783 GET_TANGENT_SK_PATHMEASURE_MATRIXFLAGS = 0x02,
784 GET_POS_AND_TAN_SK_PATHMEASURE_MATRIXFLAGS = GET_POSITION_SK_PATHMEASURE_MATRIXFLAGS | GET_TANGENT_SK_PATHMEASURE_MATRIXFLAGS,
785 } sk_pathmeasure_matrixflags_t;
787 typedef void (*sk_bitmap_release_proc)(void* addr, void* context);
789 typedef void (*sk_data_release_proc)(const void* ptr, void* context);
791 typedef void (*sk_image_raster_release_proc)(const void* addr, void* context);
792 typedef void (*sk_image_texture_release_proc)(void* context);
795 ALLOW_SK_IMAGE_CACHING_HINT,
796 DISALLOW_SK_IMAGE_CACHING_HINT,
797 } sk_image_caching_hint_t;
800 ZERO_PIXELS_SK_BITMAP_ALLOC_FLAGS = 1 << 0,
801 } sk_bitmap_allocflags_t;
804 int16_t fTimeZoneMinutes;
812 } sk_time_datetime_t;
816 sk_string_t* fAuthor;
817 sk_string_t* fSubject;
818 sk_string_t* fKeywords;
819 sk_string_t* fCreator;
820 sk_string_t* fProducer;
821 sk_time_datetime_t* fCreation;
822 sk_time_datetime_t* fModified;
823 } sk_document_pdf_metadata_t;
826 OPAQUE_SK_ENCODEDINFO_ALPHA,
827 UNPREMUL_SK_ENCODEDINFO_ALPHA,
828 BINARY_SK_ENCODEDINFO_ALPHA,
829 } sk_encodedinfo_alpha_t;
832 GRAY_SK_ENCODEDINFO_COLOR,
833 GRAY_ALPHA_SK_ENCODEDINFO_COLOR,
834 PALETTE_SK_ENCODEDINFO_COLOR,
835 RGB_SK_ENCODEDINFO_COLOR,
836 RGBA_SK_ENCODEDINFO_COLOR,
837 BGR_SK_ENCODEDINFO_COLOR,
838 BGRX_SK_ENCODEDINFO_COLOR,
839 BGRA_SK_ENCODEDINFO_COLOR,
840 YUV_SK_ENCODEDINFO_COLOR,
841 YUVA_SK_ENCODEDINFO_COLOR,
842 INVERTED_CMYK_SK_ENCODEDINFO_COLOR,
843 YCCK_SK_ENCODEDINFO_COLOR,
844 } sk_encodedinfo_color_t;
847 sk_encodedinfo_color_t fColor;
848 sk_encodedinfo_alpha_t fAlpha;
849 uint8_t fBitsPerComponent;
853 size_t fRequiredFrame;
856 } sk_codec_frameinfo_t;
858 typedef struct sk_xmlstreamwriter_t sk_xmlstreamwriter_t;
859 typedef struct sk_xmlwriter_t sk_xmlwriter_t;
861 typedef struct sk_svgcanvas_t sk_svgcanvas_t;
863 typedef struct sk_3dview_t sk_3dview_t;
866 TRIANGLES_SK_VERTICES_VERTEX_MODE,
867 TRIANGLE_STRIP_SK_VERTICES_VERTEX_MODE,
868 TRIANGLE_FAN_SK_VERTICES_VERTEX_MODE,
869 } sk_vertices_vertex_mode_t;
871 typedef struct sk_vertices_t sk_vertices_t;
873 SK_C_PLUS_PLUS_END_GUARD