/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef gr_context_DEFINED
#define gr_context_DEFINED
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_bitmap_DEFINED
#define sk_bitmap_DEFINED
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_canvas_DEFINED
#define sk_canvas_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
SK_C_API void sk_canvas_destroy(sk_canvas_t*);
-
-/**
- Save the current matrix and clip on the canvas. When the
- balancing call to sk_canvas_restore() is made, the previous matrix
- and clip are restored.
-*/
SK_C_API int sk_canvas_save(sk_canvas_t*);
-/**
- This behaves the same as sk_canvas_save(), but in addition it
- allocates an offscreen surface. All drawing calls are directed
- there, and only when the balancing call to sk_canvas_restore() is
- made is that offscreen transfered to the canvas (or the previous
- layer).
-
- @param sk_rect_t* (may be null) This rect, if non-null, is used as
- a hint to limit the size of the offscreen, and
- thus drawing may be clipped to it, though that
- clipping is not guaranteed to happen. If exact
- clipping is desired, use sk_canvas_clip_rect().
- @param sk_paint_t* (may be null) The paint is copied, and is applied
- to the offscreen when sk_canvas_restore() is
- called.
-*/
SK_C_API int sk_canvas_save_layer(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*);
-/**
- This call balances a previous call to sk_canvas_save() or
- sk_canvas_save_layer(), and is used to remove all modifications to
- the matrix and clip state since the last save call. It is an
- error to call sk_canvas_restore() more times than save and
- save_layer were called.
-*/
SK_C_API void sk_canvas_restore(sk_canvas_t*);
-/**
- Preconcat the current coordinate transformation matrix with the
- specified translation.
-*/
SK_C_API void sk_canvas_translate(sk_canvas_t*, float dx, float dy);
-/**
- Preconcat the current coordinate transformation matrix with the
- specified scale.
-*/
SK_C_API void sk_canvas_scale(sk_canvas_t*, float sx, float sy);
-/**
- Preconcat the current coordinate transformation matrix with the
- specified rotation in degrees.
-*/
SK_C_API void sk_canvas_rotate_degrees(sk_canvas_t*, float degrees);
-/**
- Preconcat the current coordinate transformation matrix with the
- specified rotation in radians.
-*/
SK_C_API void sk_canvas_rotate_radians(sk_canvas_t*, float radians);
-/**
- Preconcat the current coordinate transformation matrix with the
- specified skew.
-*/
SK_C_API void sk_canvas_skew(sk_canvas_t*, float sx, float sy);
-/**
- Preconcat the current coordinate transformation matrix with the
- specified matrix.
-*/
SK_C_API void sk_canvas_concat(sk_canvas_t*, const sk_matrix_t*);
-
-/**
- Modify the current clip with the specified rectangle. The new
- current clip will be the intersection of the old clip and the
- rectange.
-*/
SK_C_API bool sk_canvas_quick_reject(sk_canvas_t*, const sk_rect_t*);
SK_C_API void sk_canvas_clip_rect(sk_canvas_t*, const sk_rect_t*);
SK_C_API void sk_canvas_clip_region(sk_canvas_t* canvas, const sk_region_t* region, sk_clipop_t op);
-/**
- Modify the current clip with the specified path. The new
- current clip will be the intersection of the old clip and the
- path.
-*/
SK_C_API void sk_canvas_clip_path(sk_canvas_t*, const sk_path_t*);
-
-/**
- Fill the entire canvas (restricted to the current clip) with the
- specified paint.
-*/
SK_C_API void sk_canvas_draw_paint(sk_canvas_t*, const sk_paint_t*);
-/**
- Draw the specified rectangle using the specified paint. The
- rectangle will be filled or stroked based on the style in the
- paint.
-*/
SK_C_API void sk_canvas_draw_rect(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*);
SK_C_API void sk_canvas_draw_region(sk_canvas_t*, const sk_region_t*, const sk_paint_t*);
-/**
- * Draw the circle centered at (cx, cy) with radius rad using the specified paint.
- * The circle will be filled or framed based on the style in the paint
- */
SK_C_API void sk_canvas_draw_circle(sk_canvas_t*, float cx, float cy, float rad, const sk_paint_t*);
-/**
- Draw the specified oval using the specified paint. The oval will be
- filled or framed based on the style in the paint
-*/
SK_C_API void sk_canvas_draw_oval(sk_canvas_t*, const sk_rect_t*, const sk_paint_t*);
-/**
- Draw the specified path using the specified paint. The path will be
- filled or framed based on the style in the paint
-*/
SK_C_API void sk_canvas_draw_path(sk_canvas_t*, const sk_path_t*, const sk_paint_t*);
-/**
- Draw the specified image, with its top/left corner at (x,y), using
- the specified paint, transformed by the current matrix.
-
- @param sk_paint_t* (may be NULL) the paint used to draw the image.
-*/
-SK_C_API void sk_canvas_draw_image(sk_canvas_t*, const sk_image_t*,
- float x, float y, const sk_paint_t*);
-/**
- Draw the specified image, scaling and translating so that it fills
- the specified dst rect. If the src rect is non-null, only that
- subset of the image is transformed and drawn.
-
- @param sk_paint_t* (may be NULL) The paint used to draw the image.
-*/
-SK_C_API void sk_canvas_draw_image_rect(sk_canvas_t*, const sk_image_t*,
- const sk_rect_t* src,
- const sk_rect_t* dst, const sk_paint_t*);
-/**
- Draw the picture into this canvas (replay the pciture's drawing commands).
-
- @param sk_matrix_t* If non-null, apply that matrix to the CTM when
- drawing this picture. This is logically
- equivalent to: save, concat, draw_picture,
- restore.
-
- @param sk_paint_t* If non-null, draw the picture into a temporary
- buffer, and then apply the paint's alpha,
- colorfilter, imagefilter, and xfermode to that
- buffer as it is drawn to the canvas. This is
- logically equivalent to save_layer(paint),
- draw_picture, restore.
-*/
-SK_C_API void sk_canvas_draw_picture(sk_canvas_t*, const sk_picture_t*,
- const sk_matrix_t*, const sk_paint_t*);
-/**
- Helper method for drawing a color in SRC mode, completely replacing all the pixels
- in the current clip with this color.
- */
+SK_C_API void sk_canvas_draw_image(sk_canvas_t*, const sk_image_t*, float x, float y, const sk_paint_t*);
+SK_C_API void sk_canvas_draw_image_rect(sk_canvas_t*, const sk_image_t*, const sk_rect_t* src, const sk_rect_t* dst, const sk_paint_t*);
+SK_C_API void sk_canvas_draw_picture(sk_canvas_t*, const sk_picture_t*, const sk_matrix_t*, const sk_paint_t*);
SK_C_API void sk_canvas_clear(sk_canvas_t*, sk_color_t);
-/**
- This makes the contents of the canvas undefined. Subsequent calls that
- require reading the canvas contents will produce undefined results. Examples
- include blending and readPixels. The actual implementation is backend-
- dependent and one legal implementation is to do nothing. Like clear(), this
- ignores the clip.
-
- This function should only be called if the caller intends to subsequently
- draw to the canvas. The canvas may do real work at discard() time in order
- to optimize performance on subsequent draws. Thus, if you call this and then
- never draw to the canvas subsequently you may pay a perfomance penalty.
-*/
SK_C_API void sk_canvas_discard(sk_canvas_t*);
-/**
- Returns the number of matrix/clip states on the SkCanvas' private stack.
- This will equal # save() calls - # restore() calls + 1. The save count on
- a new canvas is 1.
-*/
SK_C_API int sk_canvas_get_save_count(sk_canvas_t*);
-/**
- Efficient way to pop any calls to sk_canvas_save() that happened after the save
- count reached saveCount. It is an error for saveCount to be greater than
- getSaveCount(). To pop all the way back to the initial matrix/clip context
- pass saveCount == 1.
-*/
SK_C_API void sk_canvas_restore_to_count(sk_canvas_t*, int saveCount);
-/**
- Draws with the specified color and mode.
-**/
SK_C_API void sk_canvas_draw_color(sk_canvas_t* ccanvas, sk_color_t color, sk_blendmode_t mode);
-/**
- Draw a series of points, interpreted based on the sk_point_mode_t mode. For
- all modes, the count parameter is interpreted as the total number of
- points. For LINES_SK_POINT_MODE mode, count/2 line segments are drawn.
- For POINTS_SK_POINT_MODE mode, each point is drawn centered at its coordinate, and its
- size is specified by the paint's stroke-width. It draws as a square,
- unless the paint's cap-type is round, in which the points are drawn as
- circles.
- For LINES_SK_POINT_MODE mode, each pair of points is drawn as a line segment,
- respecting the paint's settings for cap/join/width.
- For POLYGON_SK_POINT_MODE mode, the entire array is drawn as a series of connected
- line segments.
- Note that, while similar, LINES_SK_POINT_MODE and POLYGON_SK_POINT_MODE modes draw slightly
- differently than the equivalent path built with a series of moveto,
- lineto calls, in that the path will draw all of its contours at once,
- with no interactions if contours intersect each other (think XOR
- xfermode). sk_canvas_draw_paint always draws each element one at a time.
-*/
SK_C_API void sk_canvas_draw_points(sk_canvas_t*, sk_point_mode_t, size_t, const sk_point_t[], const sk_paint_t*);
-/**
- Draws a single point with the specified paint
-*/
SK_C_API void sk_canvas_draw_point(sk_canvas_t*, float, float, const sk_paint_t*);
-/**
- Draws a line from x0,y0 to x1,y1
-*/
SK_C_API void sk_canvas_draw_line(sk_canvas_t* ccanvas, float x0, float y0, float x1, float y1, sk_paint_t* cpaint);
-/**
- Draw the text, with origin at (x,y), using the specified paint.
- The origin is interpreted based on the Align setting in the paint.
-
- @param text The text to be drawn
- @param byteLength The number of bytes to read from the text parameter
- @param x The x-coordinate of the origin of the text being drawn
- @param y The y-coordinate of the origin of the text being drawn
- @param paint The paint used for the text (e.g. color, size, style)
-*/
SK_C_API void sk_canvas_draw_text (sk_canvas_t*, const char *text, size_t byteLength, float x, float y, const sk_paint_t* paint);
-/**
- Draw the text, with each character/glyph origin specified by the pos[]
- array. The origin is interpreted by the Align setting in the paint.
-
- @param text The text to be drawn
- @param byteLength The number of bytes to read from the text parameter
- @param pos Array of positions, used to position each character
- @param paint The paint used for the text (e.g. color, size, style)
-*/
SK_C_API void sk_canvas_draw_pos_text (sk_canvas_t*, const char *text, size_t byteLength, const sk_point_t[], const sk_paint_t* paint);
-/**
- Draw the text, with origin at (x,y), using the specified paint, along
- the specified path. The paint's Align setting determins where along the
- path to start the text.
-
- @param text The text to be drawn
- @param byteLength The number of bytes to read from the text parameter
- @param path The path the text should follow for its baseline
- @param hOffset The distance along the path to add to the text's
- starting position
- @param vOffset The distance above(-) or below(+) the path to
- position the text
- @param paint The paint used for the text
-*/
SK_C_API void sk_canvas_draw_text_on_path (sk_canvas_t*, const char *text, size_t byteLength, const sk_path_t*path, float hOffset, float vOffset, const sk_paint_t* paint);
-/**
- Draw the specified bitmap, with its top/left corner at (x,y), using the
- specified paint, transformed by the current matrix. Note: if the paint
- contains a maskfilter that generates a mask which extends beyond the
- bitmap's original width/height, then the bitmap will be drawn as if it
- were in a Shader with CLAMP mode. Thus the color outside of the original
- width/height will be the edge color replicated.
-
- If a shader is present on the paint it will be ignored, except in the
- case where the bitmap is kAlpha_8_SkColorType. In that case, the color is
- generated by the shader.
-
- @param bitmap The bitmap to be drawn
- @param left The position of the left side of the bitmap being drawn
- @param top The position of the top side of the bitmap being drawn
- @param paint The paint used to draw the bitmap, or NULL
-*/
SK_C_API void sk_canvas_draw_bitmap(sk_canvas_t* ccanvas, const sk_bitmap_t* bitmap, float left, float top, const sk_paint_t* paint);
-/** Draw the specified bitmap, scaling and translating so that it fills the specified
- dst rect. If the src rect is non-null, only that subset of the bitmap is transformed
- and drawn.
-
- @param bitmap The bitmap to be drawn
- @param src Optional: specify the subset of the bitmap to be drawn
- @param dst The destination rectangle where the scaled/translated
- bitmap will be drawn
- @param paint The paint used to draw the bitmap, or NULL
-*/
SK_C_API void sk_canvas_draw_bitmap_rect(sk_canvas_t* ccanvas, const sk_bitmap_t* bitmap, const sk_rect_t* src, const sk_rect_t* dst, const sk_paint_t* paint);
-/**
- Helper for setMatrix(identity). Sets the current matrix to identity.
-*/
SK_C_API void sk_canvas_reset_matrix(sk_canvas_t* ccanvas);
-/**
- Replace the current matrix with a copy of the specified matrix.
-
- @param matrix The matrix that will be copied into the current matrix.
-*/
SK_C_API void sk_canvas_set_matrix(sk_canvas_t* ccanvas, const sk_matrix_t* matrix);
-/**
- Return the current matrix on the canvas.
- This does not account for the translate in any of the devices.
-
- @param matrix The current matrix on the canvas.
-*/
SK_C_API void sk_canvas_get_total_matrix(sk_canvas_t* ccanvas, sk_matrix_t* matrix);
-/**
- Draw the specified rounded rectangle using the specified paint. The
- rectangle will be filled or stroked based on the style in the
- paint.
-*/
SK_C_API void sk_canvas_draw_round_rect(sk_canvas_t*, const sk_rect_t*, float rx, float ry, const sk_paint_t*);
-/**
- Modify the current clip with the specified rectangle.
-*/
SK_C_API void sk_canvas_clip_rect_with_operation(sk_canvas_t* t, const sk_rect_t* crect, sk_clipop_t op, bool doAA);
-/**
- Modify the current clip with the specified path.
-*/
SK_C_API void sk_canvas_clip_path_with_operation(sk_canvas_t* t, const sk_path_t* crect, sk_clipop_t op, bool doAA);
-
-/**
- Return the bounds of the current clip (in local coordinates) in the
- bounds parameter, and return true if it is non-empty. This can be useful
- in a way similar to quickReject, in that it tells you that drawing
- outside of these bounds will be clipped out.
-*/
SK_C_API bool sk_canvas_get_local_clip_bounds(sk_canvas_t* t, sk_rect_t* cbounds);
-/**
- Return the bounds of the current clip, in device coordinates; returns
- true if non-empty. Maybe faster than getting the clip explicitly and
- then taking its bounds.
-*/
SK_C_API bool sk_canvas_get_device_clip_bounds(sk_canvas_t* t, sk_irect_t* cbounds);
-
-/**
- Trigger the immediate execution of all pending draw operations. For the GPU
- backend this will resolve all rendering to the GPU surface backing the
- SkSurface that owns this canvas.
-*/
SK_C_API void sk_canvas_flush(sk_canvas_t* ccanvas);
-
SK_C_API sk_canvas_t* sk_canvas_new_from_bitmap(const sk_bitmap_t* bitmap);
-
SK_C_API void sk_canvas_draw_annotation(sk_canvas_t* t, const sk_rect_t* rect, const char* key, sk_data_t* value);
SK_C_API void sk_canvas_draw_url_annotation(sk_canvas_t* t, const sk_rect_t* rect, sk_data_t* value);
SK_C_API void sk_canvas_draw_named_destination_annotation(sk_canvas_t* t, const sk_point_t* point, sk_data_t* value);
SK_C_API void sk_canvas_draw_link_destination_annotation(sk_canvas_t* t, const sk_rect_t* rect, sk_data_t* value);
-
SK_C_API void sk_canvas_draw_bitmap_lattice(sk_canvas_t* t, const sk_bitmap_t* bitmap, const sk_lattice_t* lattice, const sk_rect_t* dst, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_image_lattice(sk_canvas_t* t, const sk_image_t* image, const sk_lattice_t* lattice, const sk_rect_t* dst, const sk_paint_t* paint);
-
SK_C_API void sk_canvas_draw_bitmap_nine(sk_canvas_t* t, const sk_bitmap_t* bitmap, const sk_irect_t* center, const sk_rect_t* dst, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_image_nine(sk_canvas_t* t, const sk_image_t* image, const sk_irect_t* center, const sk_rect_t* dst, const sk_paint_t* paint);
-
SK_C_API void sk_canvas_draw_vertices(sk_canvas_t* ccanvas, sk_vertices_t* vertices, sk_blendmode_t mode, const sk_paint_t* paint);
SK_C_API sk_nodraw_canvas_t* sk_nodraw_canvas_new(int width, int height);
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_codec_DEFINED
#define sk_codec_DEFINED
SK_C_API sk_codec_t* sk_codec_new_from_stream(sk_stream_t* stream);
SK_C_API sk_codec_t* sk_codec_new_from_data(sk_data_t* data);
-
SK_C_API void sk_codec_destroy(sk_codec_t* codec);
SK_C_API void sk_codec_get_info(sk_codec_t* codec, sk_imageinfo_t* info);
SK_C_API void sk_codec_get_encodedinfo(sk_codec_t* codec, sk_encodedinfo_t* info);
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_colorfilter_DEFINED
#define sk_colorfilter_DEFINED
/*
- * Copyright 2017 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_colortable_DEFINED
#define sk_colortable_DEFINED
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_data_DEFINED
#define sk_data_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
-/**
- Returns a new empty sk_data_t. This call must be balanced with a call to
- sk_data_unref().
-*/
SK_C_API sk_data_t* sk_data_new_empty(void);
-/**
- Returns a new sk_data_t by copying the specified source data.
- This call must be balanced with a call to sk_data_unref().
-*/
SK_C_API sk_data_t* sk_data_new_with_copy(const void* src, size_t length);
-/**
- Pass ownership of the given memory to a new sk_data_t, which will
- call free() when the refernce count of the data goes to zero. For
- example:
- size_t length = 1024;
- void* buffer = malloc(length);
- memset(buffer, 'X', length);
- sk_data_t* data = sk_data_new_from_malloc(buffer, length);
- This call must be balanced with a call to sk_data_unref().
-*/
SK_C_API sk_data_t* sk_data_new_from_malloc(const void* memory, size_t length);
-/**
- Returns a new sk_data_t using a subset of the data in the
- specified source sk_data_t. This call must be balanced with a
- call to sk_data_unref().
-*/
SK_C_API sk_data_t* sk_data_new_subset(const sk_data_t* src, size_t offset, size_t length);
-/**
- Increment the reference count on the given sk_data_t. Must be
- balanced by a call to sk_data_unref().
-*/
SK_C_API void sk_data_ref(const sk_data_t*);
-/**
- Decrement the reference count. If the reference count is 1 before
- the decrement, then release both the memory holding the sk_data_t
- and the memory it is managing. New sk_data_t are created with a
- reference count of 1.
-*/
SK_C_API void sk_data_unref(const sk_data_t*);
-/**
- Returns the number of bytes stored.
-*/
SK_C_API size_t sk_data_get_size(const sk_data_t*);
-/**
- Returns the pointer to the data.
- */
SK_C_API const void* sk_data_get_data(const sk_data_t*);
-/**
- Create a new dataref the file with the specified path.
- If the file cannot be opened, this returns NULL.
-*/
SK_C_API sk_data_t* sk_data_new_from_file(const char* path);
-/**
- Attempt to read size bytes into a SkData. If the read succeeds, return the data,
- else return NULL. Either way the stream's cursor may have been changed as a result
- of calling read().
-*/
SK_C_API sk_data_t* sk_data_new_from_stream(sk_stream_t* stream, size_t length);
-/**
- Like data(), returns a read-only ptr into the data, but in this case
- it is cast to uint8_t*, to make it easy to add an offset to it.
-*/
SK_C_API const uint8_t* sk_data_get_bytes(const sk_data_t*);
-
SK_C_API sk_data_t* sk_data_new_with_proc(const void* ptr, size_t length, sk_data_release_proc proc, void* ctx);
-
SK_C_API sk_data_t* sk_data_new_uninitialized(size_t size);
SK_C_PLUS_PLUS_END_GUARD
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_document_DEFINED
#define sk_document_DEFINED
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_image_DEFINED
#define sk_image_DEFINED
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_imagefilter_DEFINED
#define sk_imagefilter_DEFINED
/*
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
* Copyright 2017 Bluebeam Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_mask_DEFINED
#define sk_mask_DEFINED
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_maskfilter_DEFINED
#define sk_maskfilter_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
-/**
- Increment the reference count on the given sk_maskfilter_t. Must be
- balanced by a call to sk_maskfilter_unref().
-*/
SK_C_API void sk_maskfilter_ref(sk_maskfilter_t*);
-/**
- Decrement the reference count. If the reference count is 1 before
- the decrement, then release both the memory holding the
- sk_maskfilter_t and any other associated resources. New
- sk_maskfilter_t are created with a reference count of 1.
-*/
SK_C_API void sk_maskfilter_unref(sk_maskfilter_t*);
-
-/**
- Create a blur maskfilter.
- @param sk_blurstyle_t The SkBlurStyle to use
- @param sigma Standard deviation of the Gaussian blur to apply. Must be > 0.
-*/
SK_C_API sk_maskfilter_t* sk_maskfilter_new_blur(sk_blurstyle_t, float sigma);
SK_C_API sk_maskfilter_t* sk_maskfilter_new_blur_with_flags(sk_blurstyle_t, float sigma, const sk_rect_t* occluder, sk_blurmaskfilter_blurflags_t flags);
-
-SK_C_API sk_maskfilter_t* sk_maskfilter_new_table(
- const uint8_t table[256]);
-
-SK_C_API sk_maskfilter_t* sk_maskfilter_new_gamma(
- float gamma);
-
-SK_C_API sk_maskfilter_t* sk_maskfilter_new_clip(
- uint8_t min,
- uint8_t max);
+SK_C_API sk_maskfilter_t* sk_maskfilter_new_table(const uint8_t table[256]);
+SK_C_API sk_maskfilter_t* sk_maskfilter_new_gamma(float gamma);
+SK_C_API sk_maskfilter_t* sk_maskfilter_new_clip(uint8_t min, uint8_t max);
SK_C_PLUS_PLUS_END_GUARD
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_matrix_DEFINED
#define sk_matrix_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
-/**
- Set the matrix to identity
-*/
-SK_C_API void sk_matrix_set_identity (sk_matrix_t*);
-/**
- Set the matrix to translate by (tx, ty).
-*/
+SK_C_API void sk_matrix_set_identity (sk_matrix_t*);
SK_C_API void sk_matrix_set_translate (sk_matrix_t*, float tx, float ty);
-
-/**
- Preconcats the matrix with the specified translation.
- M' = M * T(dx, dy)
-*/
SK_C_API void sk_matrix_pre_translate (sk_matrix_t*, float tx, float ty);
-
-/**
- Postconcats the matrix with the specified translation.
- M' = T(dx, dy) * M
-*/
SK_C_API void sk_matrix_post_translate (sk_matrix_t*, float tx, float ty);
-
-/**
- Set the matrix to scale by sx and sy.
-*/
SK_C_API void sk_matrix_set_scale (sk_matrix_t*, float sx, float sy);
-
-/**
- Preconcats the matrix with the specified scale.
- M' = M * S(sx, sy)
-*/
SK_C_API void sk_matrix_pre_scale (sk_matrix_t*, float sx, float sy);
-
-/**
- Postconcats the matrix with the specified scale.
- M' = S(sx, sy) * M
-*/
SK_C_API void sk_matrix_post_scale (sk_matrix_t*, float sx, float sy);
-
-/**
- Returns the matrix type
- */
SK_C_API int sk_matrix_try_invert (sk_matrix_t *matrix, sk_matrix_t *result);
-
-/**
- Sets a matrix to the concatenation of the other two.
- */
SK_C_API void sk_matrix_concat (sk_matrix_t *result, sk_matrix_t *first, sk_matrix_t *second);
-
-/**
- Preconcatenates the matrix
- */
SK_C_API void sk_matrix_pre_concat (sk_matrix_t *result, sk_matrix_t *matrix);
-/**
- Sets a matrix to the concatenation of the other two.
- */
SK_C_API void sk_matrix_post_concat (sk_matrix_t *result, sk_matrix_t *matrix);
-
-/**
- Apply the @matrix to the coordinates in rectangle @source using the matrix definition into @dest
-*/
SK_C_API void sk_matrix_map_rect (sk_matrix_t *matrix, sk_rect_t *dest, sk_rect_t *source);
-
-/**
- Apply the @matrix to the array of points @src containing @count points into @dst
-*/
SK_C_API void sk_matrix_map_points (sk_matrix_t *matrix, sk_point_t *dst, sk_point_t *src, int count);
-
-/**
- Apply this matrix to the array of vectors specified by src, and write
- the transformed vectors into the array of vectors specified by dst.
- This is similar to mapPoints, but ignores any translation in the matrix.
- @param dst Where the transformed coordinates are written. It must
- contain at least count entries
- @param src The original coordinates that are to be transformed. It
- must contain at least count entries
- @param count The number of vectors in src to read, and then transform
- into dst.
-*/
SK_C_API void sk_matrix_map_vectors (sk_matrix_t *matrix, sk_point_t *dst, sk_point_t *src, int count);
-
-/**
- Applies the matrix to the the @x,@y positions
-*/
SK_C_API void sk_matrix_map_xy (sk_matrix_t *matrix, float x, float y, sk_point_t* result);
-
-/**
- Applies the matrix to the the @x,@y positions, ignoring the translation component.
-*/
SK_C_API void sk_matrix_map_vector (sk_matrix_t *matrix, float x, float y, sk_point_t* result);
-
-/**
- Return the mean radius of a circle after it has been mapped by
- this matrix. NOTE: in perspective this value assumes the circle
- has its center at the origin.
-*/
SK_C_API float sk_matrix_map_radius (sk_matrix_t *matrix, float radius);
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_paint_DEFINED
#define sk_paint_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
-/**
- Create a new paint with default settings:
- antialias : false
- stroke : false
- stroke width : 0.0f (hairline)
- stroke miter : 4.0f
- stroke cap : BUTT_SK_STROKE_CAP
- stroke join : MITER_SK_STROKE_JOIN
- color : opaque black
- shader : NULL
- maskfilter : NULL
- xfermode_mode : SRCOVER_SK_XFERMODE_MODE
-*/
SK_C_API sk_paint_t* sk_paint_new(void);
SK_C_API sk_paint_t* sk_paint_clone(sk_paint_t*);
-/**
- Release the memory storing the sk_paint_t and unref() all
- associated objects.
-*/
SK_C_API void sk_paint_delete(sk_paint_t*);
-/**
- Return true iff the paint has antialiasing enabled.
-*/
SK_C_API bool sk_paint_is_antialias(const sk_paint_t*);
-/**
- Set to true to enable antialiasing, false to disable it on this
- sk_paint_t.
-*/
SK_C_API void sk_paint_set_antialias(sk_paint_t*, bool);
-/**
- Return the paint's curent drawing color.
-*/
SK_C_API sk_color_t sk_paint_get_color(const sk_paint_t*);
-/**
- Set the paint's curent drawing color.
-*/
SK_C_API void sk_paint_set_color(sk_paint_t*, sk_color_t);
-/**
- Return true iff stroking is enabled rather than filling on this
- sk_paint_t.
-*/
SK_C_API sk_paint_style_t sk_paint_get_style(const sk_paint_t*);
-/**
- Set to true to enable stroking rather than filling with this
- sk_paint_t.
-*/
SK_C_API void sk_paint_set_style(sk_paint_t*, sk_paint_style_t);
-/**
- Return the width for stroking. A value of 0 strokes in hairline mode.
- */
SK_C_API float sk_paint_get_stroke_width(const sk_paint_t*);
-/**
- Set the width for stroking. A value of 0 strokes in hairline mode
- (always draw 1-pixel wide, regardless of the matrix).
- */
SK_C_API void sk_paint_set_stroke_width(sk_paint_t*, float width);
-/**
- Return the paint's stroke miter value. This is used to control the
- behavior of miter joins when the joins angle is sharp.
-*/
SK_C_API float sk_paint_get_stroke_miter(const sk_paint_t*);
-/**
- Set the paint's stroke miter value. This is used to control the
- behavior of miter joins when the joins angle is sharp. This value
- must be >= 0.
-*/
SK_C_API void sk_paint_set_stroke_miter(sk_paint_t*, float miter);
-/**
- Return the paint's stroke cap type, controlling how the start and
- end of stroked lines and paths are treated.
-*/
SK_C_API sk_stroke_cap_t sk_paint_get_stroke_cap(const sk_paint_t*);
-/**
- Set the paint's stroke cap type, controlling how the start and
- end of stroked lines and paths are treated.
-*/
SK_C_API void sk_paint_set_stroke_cap(sk_paint_t*, sk_stroke_cap_t);
-/**
- Return the paint's stroke join type, specifies the treatment that
- is applied to corners in paths and rectangles
- */
SK_C_API sk_stroke_join_t sk_paint_get_stroke_join(const sk_paint_t*);
-/**
- Set the paint's stroke join type, specifies the treatment that
- is applied to corners in paths and rectangles
- */
SK_C_API void sk_paint_set_stroke_join(sk_paint_t*, sk_stroke_join_t);
-/**
- * Set the paint's shader to the specified parameter. This will automatically call unref() on
- * any previous value, and call ref() on the new value.
- */
SK_C_API void sk_paint_set_shader(sk_paint_t*, sk_shader_t*);
-/**
- * Set the paint's maskfilter to the specified parameter. This will automatically call unref() on
- * any previous value, and call ref() on the new value.
- */
SK_C_API void sk_paint_set_maskfilter(sk_paint_t*, sk_maskfilter_t*);
-/**
- * Set the paint's blend mode to the specified parameter.
- */
SK_C_API void sk_paint_set_blendmode(sk_paint_t*, sk_blendmode_t);
-/**
- * Return true iff the paint has dithering enabled.
- */
SK_C_API bool sk_paint_is_dither(const sk_paint_t*);
-/**
- * Set to true to enable dithering, false to disable it on this
- * sk_paint_t.
- */
SK_C_API void sk_paint_set_dither(sk_paint_t*, bool);
-/**
- * Return true iff the paint has verticaltext enabled.
- */
SK_C_API bool sk_paint_is_verticaltext(const sk_paint_t*);
-/**
- * Set to true to enable verticaltext, false to disable it on this
- * sk_paint_t.
- */
SK_C_API void sk_paint_set_verticaltext(sk_paint_t*, bool);
-/**
- * Get the paint's shader object.
- */
SK_C_API sk_shader_t* sk_paint_get_shader(sk_paint_t*);
-/**
- * Get the paint's mask filter object.
- */
SK_C_API sk_maskfilter_t* sk_paint_get_maskfilter(sk_paint_t*);
-/**
- * Set or clear the paint's color filter.
- */
SK_C_API void sk_paint_set_colorfilter(sk_paint_t*, sk_colorfilter_t*);
-/**
- * Get the paint's color filter object.
- */
SK_C_API sk_colorfilter_t* sk_paint_get_colorfilter(sk_paint_t*);
-/**
- * Set or clear the paint's image filter.
- */
SK_C_API void sk_paint_set_imagefilter(sk_paint_t*, sk_imagefilter_t*);
-/**
- * Get the paint's image filter object.
- */
SK_C_API sk_imagefilter_t* sk_paint_get_imagefilter(sk_paint_t*);
-/**
- * Get the paint's blend mode.
- */
SK_C_API sk_blendmode_t sk_paint_get_blendmode(sk_paint_t*);
-/**
- * Set the paint's filter quality.
- */
SK_C_API void sk_paint_set_filter_quality(sk_paint_t*, sk_filter_quality_t);
-/**
- * Get the paint's filter quality.
- */
SK_C_API sk_filter_quality_t sk_paint_get_filter_quality(sk_paint_t *);
-/**
- * Get the paint's typeface
- */
SK_C_API sk_typeface_t* sk_paint_get_typeface(sk_paint_t*);
-/**
- * Set the paint's typeface
- */
SK_C_API void sk_paint_set_typeface(sk_paint_t*, sk_typeface_t*);
-/**
- * Get the paint's text sixe
- */
SK_C_API float sk_paint_get_textsize(sk_paint_t*);
-/**
- * Set the paint's text sixe
- */
SK_C_API void sk_paint_set_textsize(sk_paint_t*, float);
-/**
- * Get the paint's text alignment
- */
SK_C_API sk_text_align_t sk_paint_get_text_align(const sk_paint_t*);
-/**
- * Set the paint's text alignment
- */
SK_C_API void sk_paint_set_text_align(sk_paint_t*, sk_text_align_t);
-/**
- * Get the paint's text encoding
- */
SK_C_API sk_text_encoding_t sk_paint_get_text_encoding(const sk_paint_t*);
-/**
- * Set the paint's text encoding
- */
SK_C_API void sk_paint_set_text_encoding(sk_paint_t*, sk_text_encoding_t);
-/**
- * Set the paint's horizontal scale factor for text
- */
SK_C_API float sk_paint_get_text_scale_x(const sk_paint_t* cpaint);
-/**
- * Set the paint's horizontal scale factor for text
- */
SK_C_API void sk_paint_set_text_scale_x(sk_paint_t* cpaint, float scale);
-/**
- * Set the paint's horizontal skew factor for text
- */
SK_C_API float sk_paint_get_text_skew_x(const sk_paint_t* cpaint);
-/**
- * Set the paint's horizontal skew factor for text
- */
SK_C_API void sk_paint_set_text_skew_x(sk_paint_t* cpaint, float skew);
-/**
- * Return the number of bytes of text that were measured
- */
SK_C_API size_t sk_paint_break_text(const sk_paint_t* cpaint, const void* text, size_t length, float maxWidth, float* measuredWidth);
-/**
- * Return the width of the text
- */
SK_C_API float sk_paint_measure_text(const sk_paint_t* cpaint, const void* text, size_t length, sk_rect_t* cbounds);
-/**
- * Get the path outline of text.
- */
SK_C_API sk_path_t* sk_paint_get_text_path(sk_paint_t* cpaint, const void* text, size_t length, float x, float y);
-/**
- * Get the path outline of text with each glyph positioned.
- */
SK_C_API sk_path_t* sk_paint_get_pos_text_path(sk_paint_t* cpaint, const void* text, size_t length, const sk_point_t pos[]);
-/**
- * Return the recommend spacing between lines (which will be fDescent - fAscent + fLeading).
- * Also get the font metrics for the current typeface and type size if cfontmetrics is not null.
- */
SK_C_API float sk_paint_get_fontmetrics(sk_paint_t* cpaint, sk_fontmetrics_t* cfontmetrics, float scale);
-/**
- * Return the paint's patheffect object
- */
SK_C_API sk_path_effect_t* sk_paint_get_path_effect(sk_paint_t* cpaint);
-/**
- * Sets the paint's patheffect object
- */
SK_C_API void sk_paint_set_path_effect(sk_paint_t* cpaint, sk_path_effect_t* effect);
-
SK_C_API bool sk_paint_is_linear_text(const sk_paint_t*);
SK_C_API void sk_paint_set_linear_text(sk_paint_t*, bool);
-
SK_C_API bool sk_paint_is_subpixel_text(const sk_paint_t*);
SK_C_API void sk_paint_set_subpixel_text(sk_paint_t*, bool);
-
SK_C_API bool sk_paint_is_lcd_render_text(const sk_paint_t*);
SK_C_API void sk_paint_set_lcd_render_text(sk_paint_t*, bool);
-
SK_C_API bool sk_paint_is_embedded_bitmap_text(const sk_paint_t*);
SK_C_API void sk_paint_set_embedded_bitmap_text(sk_paint_t*, bool);
-
SK_C_API sk_paint_hinting_t sk_paint_get_hinting(const sk_paint_t*);
SK_C_API void sk_paint_set_hinting(sk_paint_t*, sk_paint_hinting_t);
-
SK_C_API bool sk_paint_is_autohinted(const sk_paint_t*);
SK_C_API void sk_paint_set_autohinted(sk_paint_t*, bool);
-
SK_C_API bool sk_paint_is_fake_bold_text(const sk_paint_t*);
SK_C_API void sk_paint_set_fake_bold_text(sk_paint_t*, bool);
-
SK_C_API bool sk_paint_is_dev_kern_text(const sk_paint_t*);
SK_C_API void sk_paint_set_dev_kern_text(sk_paint_t*, bool);
-
SK_C_API bool sk_paint_get_fill_path(const sk_paint_t*, const sk_path_t* src, sk_path_t* dst, const sk_rect_t* cullRect, float resScale);
SK_C_PLUS_PLUS_END_GUARD
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_path_DEFINED
#define sk_path_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
-/** Create a new, empty path. */
+/* Path */
SK_C_API sk_path_t* sk_path_new(void);
-/** Release the memory used by a sk_path_t. */
SK_C_API void sk_path_delete(sk_path_t*);
-
-/** Set the beginning of the next contour to the point (x,y). */
SK_C_API void sk_path_move_to(sk_path_t*, float x, float y);
-/**
- Add a line from the last point to the specified point (x,y). If no
- sk_path_move_to() call has been made for this contour, the first
- point is automatically set to (0,0).
-*/
SK_C_API void sk_path_line_to(sk_path_t*, float x, float y);
-/**
- Add a quadratic bezier from the last point, approaching control
- point (x0,y0), and ending at (x1,y1). If no sk_path_move_to() call
- has been made for this contour, the first point is automatically
- set to (0,0).
-*/
SK_C_API void sk_path_quad_to(sk_path_t*, float x0, float y0, float x1, float y1);
-/**
- Add a conic curve from the last point, approaching control point
- (x0,y01), and ending at (x1,y1) with weight w. If no
- sk_path_move_to() call has been made for this contour, the first
- point is automatically set to (0,0).
-*/
SK_C_API void sk_path_conic_to(sk_path_t*, float x0, float y0, float x1, float y1, float w);
-/**
- Add a cubic bezier from the last point, approaching control points
- (x0,y0) and (x1,y1), and ending at (x2,y2). If no
- sk_path_move_to() call has been made for this contour, the first
- point is automatically set to (0,0).
-*/
-SK_C_API void sk_path_cubic_to(sk_path_t*,
- float x0, float y0,
- float x1, float y1,
- float x2, float y2);
-/**
- * Append an elliptical arc from the current point in the format used by SVG.
- * The center of the ellipse is computed to satisfy the constraints below.
- */
+SK_C_API void sk_path_cubic_to(sk_path_t*, float x0, float y0, float x1, float y1, float x2, float y2);
SK_C_API void sk_path_arc_to(sk_path_t*, float rx, float ry, float xAxisRotate, sk_path_arc_size_t largeArc, sk_path_direction_t sweep, float x, float y);
-/**
- * Same as arcTo format used by SVG, but the destination coordinate is relative to the
- * last point on this contour. If there is no previous point, then a
- * moveTo(0,0) is inserted automatically.
- */
SK_C_API void sk_path_rarc_to(sk_path_t*, float rx, float ry, float xAxisRotate, sk_path_arc_size_t largeArc, sk_path_direction_t sweep, float x, float y);
-
SK_C_API void sk_path_arc_to_with_oval(sk_path_t*, const sk_rect_t* oval, float startAngle, float sweepAngle, bool forceMoveTo);
-
SK_C_API void sk_path_arc_to_with_points(sk_path_t*, float x1, float y1, float x2, float y2, float radius);
-
-/**
- Close the current contour. If the current point is not equal to the
- first point of the contour, a line segment is automatically added.
-*/
SK_C_API void sk_path_close(sk_path_t*);
-
-/**
- Add a closed rectangle contour to the path.
-*/
SK_C_API void sk_path_add_rect(sk_path_t*, const sk_rect_t*, sk_path_direction_t);
-/**
- * Add a closed rounded rectangle contour to the path.
- */
SK_C_API void sk_path_add_rounded_rect(sk_path_t*, const sk_rect_t*, float, float, sk_path_direction_t);
-/**
- Add a closed oval contour to the path
-*/
SK_C_API void sk_path_add_oval(sk_path_t*, const sk_rect_t*, sk_path_direction_t);
-/**
- * Add a closed circle contour to the path. The circle contour begins at
- * the right-most point (as though 1 were passed to addOval's 'start' param).
- */
SK_C_API void sk_path_add_circle(sk_path_t*, float x, float y, float radius, sk_path_direction_t dir);
-
-/**
- * If the path is empty, return false and set the rect parameter to [0, 0, 0, 0].
- * else return true and set the rect parameter to the bounds of the control-points
- * of the path.
- */
SK_C_API bool sk_path_get_bounds(const sk_path_t*, sk_rect_t*);
-
SK_C_API void sk_path_compute_tight_bounds(const sk_path_t*, sk_rect_t*);
-
-/** Set the beginning of the next contour relative to the last point on the
- previous contour. If there is no previous contour, this is treated the
- same as sk_path_move_to.
-*/
SK_C_API void sk_path_rmove_to(sk_path_t*, float dx, float dy);
-/**
- Same as sk_path_line_to, but the coordinates are considered relative to the last
- point on this contour. If there is no previous point, then a sk_path_move_to(0,0)
- is inserted automatically.
-*/
SK_C_API void sk_path_rline_to(sk_path_t*, float dx, float yd);
-/**
- Same as sk_path_quad_to, but the coordinates are considered relative to the last
- point on this contour. If there is no previous point, then a sk_path_move_to(0,0)
- is inserted automatically.
-*/
SK_C_API void sk_path_rquad_to(sk_path_t*, float dx0, float dy0, float dx1, float dy1);
-/**
- Same as sk_path_conic_to, but the coordinates are considered relative to the last
- point on this contour. If there is no previous point, then a sk_path_move_to(0,0)
- is inserted automatically.
-*/
SK_C_API void sk_path_rconic_to(sk_path_t*, float dx0, float dy0, float dx1, float dy1, float w);
-/**
- Same as sk_path_cubic_to, but the coordinates are considered relative to the last
- point on this contour. If there is no previous point, then a sk_path_move_to(0,0)
- is inserted automatically.
-*/
-SK_C_API void sk_path_rcubic_to(sk_path_t*,
- float dx0, float dy0,
- float dx1, float dy1,
- float dx2, float dy2);
-/**
- Add a closed rectangle contour to the path with an initial point of the contour
- (startIndex) expressed as a corner index (0-3)
- */
+SK_C_API void sk_path_rcubic_to(sk_path_t*, float dx0, float dy0, float dx1, float dy1, float dx2, float dy2);
SK_C_API void sk_path_add_rect_start(sk_path_t* cpath, const sk_rect_t* crect, sk_path_direction_t cdir, uint32_t startIndex);
-/**
- Add the specified arc to the path as a new contour.
- */
SK_C_API void sk_path_add_arc(sk_path_t* cpath, const sk_rect_t* crect, float startAngle, float sweepAngle);
-/**
- Get the fill type of the path.
-*/
SK_C_API sk_path_filltype_t sk_path_get_filltype(sk_path_t*);
-/**
- Set the fill type of the path.
-*/
SK_C_API void sk_path_set_filltype(sk_path_t*, sk_path_filltype_t);
-/**
- Transform the points in this path by matrix, and write the answer back into the path
-*/
SK_C_API void sk_path_transform(sk_path_t* cpath, const sk_matrix_t* cmatrix);
-/**
- Creates a copy of the path
-*/
SK_C_API sk_path_t* sk_path_clone(const sk_path_t* cpath);
-
-/* Iterators */
-SK_C_API sk_path_iterator_t* sk_path_create_iter (sk_path_t *cpath, int forceClose);
-
-SK_C_API sk_path_verb_t sk_path_iter_next (sk_path_iterator_t *iterator, sk_point_t points [4], int doConsumeDegenerates, int exact);
-
-SK_C_API float sk_path_iter_conic_weight (sk_path_iterator_t *iterator);
-
-SK_C_API int sk_path_iter_is_close_line (sk_path_iterator_t *iterator);
-
-SK_C_API int sk_path_iter_is_closed_contour (sk_path_iterator_t *iterator);
-
-SK_C_API void sk_path_iter_destroy (sk_path_iterator_t *iterator);
-
-/* Raw iterators */
-SK_C_API sk_path_rawiterator_t* sk_path_create_rawiter (sk_path_t *cpath);
-
-SK_C_API sk_path_verb_t sk_path_rawiter_peek (sk_path_rawiterator_t *iterator);
-
-SK_C_API sk_path_verb_t sk_path_rawiter_next (sk_path_rawiterator_t *iterator, sk_point_t points [4]);
-
-SK_C_API float sk_path_rawiter_conic_weight (sk_path_rawiterator_t *iterator);
-
-SK_C_API void sk_path_rawiter_destroy (sk_path_rawiterator_t *iterator);
-
-/* Paths */
-
-/**
- Adds the @other path to the @cpath by appending a @dx, @dy offset to each node, using the specified adding mode in @add_mode
- */
SK_C_API void sk_path_add_path_offset (sk_path_t* cpath, sk_path_t* other, float dx, float dy, sk_path_add_mode_t add_mode);
-/**
- Adds the @other path to the @cpath by applying the @matrix transformation on the @other, using the specified adding mode in @add_mode
- */
SK_C_API void sk_path_add_path_matrix (sk_path_t* cpath, sk_path_t* other, sk_matrix_t *matrix, sk_path_add_mode_t add_mode);
-/**
- Adds the @other path to the @cpath using the specified adding mode in @add_mode
- */
SK_C_API void sk_path_add_path (sk_path_t* cpath, sk_path_t* other, sk_path_add_mode_t add_mode);
SK_C_API void sk_path_add_path_reverse (sk_path_t* cpath, sk_path_t* other);
-
-/**
- Clear any lines and curves from the path, making it empty. This frees up
- internal storage associated with those segments.
- On Android, does not change fSourcePath.
- */
SK_C_API void sk_path_reset (sk_path_t* cpath);
-
-/**
- Similar to sk_path_reset (), in that all lines and curves are removed from the
- path. However, any internal storage for those lines/curves is retained,
- making reuse of the path potentially faster.
- On Android, does not change fSourcePath.
- */
SK_C_API void sk_path_rewind (sk_path_t* cpath);
-
SK_C_API int sk_path_count_points (const sk_path_t* cpath);
SK_C_API int sk_path_count_verbs (const sk_path_t* cpath);
-
SK_C_API void sk_path_get_point (const sk_path_t* cpath, int index, sk_point_t* point);
-
SK_C_API int sk_path_get_points (const sk_path_t* cpath, sk_point_t* points, int max);
-
SK_C_API bool sk_path_contains (const sk_path_t* cpath, float x, float y);
-
SK_C_API sk_path_convexity_t sk_path_get_convexity (const sk_path_t* cpath);
-
SK_C_API void sk_path_set_convexity (sk_path_t* cpath, sk_path_convexity_t convexity);
-
SK_C_API bool sk_path_parse_svg_string (sk_path_t* cpath, const char* str);
-
SK_C_API void sk_path_to_svg_string (const sk_path_t* cpath, sk_string_t* str);
-
SK_C_API bool sk_path_get_last_point (const sk_path_t* cpath, sk_point_t* point);
+SK_C_API int sk_path_convert_conic_to_quads(const sk_point_t* p0, const sk_point_t* p1, const sk_point_t* p2, float w, sk_point_t* pts, int pow2);
+SK_C_API void sk_path_add_poly(sk_path_t* cpath, const sk_point_t* points, int count, bool close);
+SK_C_API uint32_t sk_path_get_segment_masks(sk_path_t* cpath);
-SK_C_API bool sk_pathop_op(const sk_path_t* one, const sk_path_t* two, sk_pathop_t op, sk_path_t* result);
+/* Iterators */
+SK_C_API sk_path_iterator_t* sk_path_create_iter (sk_path_t *cpath, int forceClose);
+SK_C_API sk_path_verb_t sk_path_iter_next (sk_path_iterator_t *iterator, sk_point_t points [4], int doConsumeDegenerates, int exact);
+SK_C_API float sk_path_iter_conic_weight (sk_path_iterator_t *iterator);
+SK_C_API int sk_path_iter_is_close_line (sk_path_iterator_t *iterator);
+SK_C_API int sk_path_iter_is_closed_contour (sk_path_iterator_t *iterator);
+SK_C_API void sk_path_iter_destroy (sk_path_iterator_t *iterator);
-SK_C_API bool sk_pathop_simplify(const sk_path_t* path, sk_path_t* result);
+/* Raw iterators */
+SK_C_API sk_path_rawiterator_t* sk_path_create_rawiter (sk_path_t *cpath);
+SK_C_API sk_path_verb_t sk_path_rawiter_peek (sk_path_rawiterator_t *iterator);
+SK_C_API sk_path_verb_t sk_path_rawiter_next (sk_path_rawiterator_t *iterator, sk_point_t points [4]);
+SK_C_API float sk_path_rawiter_conic_weight (sk_path_rawiterator_t *iterator);
+SK_C_API void sk_path_rawiter_destroy (sk_path_rawiterator_t *iterator);
+/* Path Ops */
+SK_C_API bool sk_pathop_op(const sk_path_t* one, const sk_path_t* two, sk_pathop_t op, sk_path_t* result);
+SK_C_API bool sk_pathop_simplify(const sk_path_t* path, sk_path_t* result);
SK_C_API bool sk_pathop_tight_bounds(const sk_path_t* path, sk_rect_t* result);
+/* Path Op Builder */
SK_C_API sk_opbuilder_t* sk_opbuilder_new(void);
-
SK_C_API void sk_opbuilder_destroy(sk_opbuilder_t* builder);
-
SK_C_API void sk_opbuilder_add(sk_opbuilder_t* builder, const sk_path_t* path, sk_pathop_t op);
-
SK_C_API bool sk_opbuilder_resolve(sk_opbuilder_t* builder, sk_path_t* result);
-SK_C_API int sk_path_convert_conic_to_quads(const sk_point_t* p0, const sk_point_t* p1, const sk_point_t* p2, float w, sk_point_t* pts, int pow2);
-
+/* Path Measure */
SK_C_API sk_pathmeasure_t* sk_pathmeasure_new(void);
-
SK_C_API sk_pathmeasure_t* sk_pathmeasure_new_with_path(const sk_path_t* path, bool forceClosed, float resScale);
-
SK_C_API void sk_pathmeasure_destroy(sk_pathmeasure_t* pathMeasure);
-
SK_C_API void sk_pathmeasure_set_path(sk_pathmeasure_t* pathMeasure, const sk_path_t* path, bool forceClosed);
-
SK_C_API float sk_pathmeasure_get_length(sk_pathmeasure_t* pathMeasure);
-
SK_C_API bool sk_pathmeasure_get_pos_tan(sk_pathmeasure_t* pathMeasure, float distance, sk_point_t* position, sk_vector_t* tangent);
-
SK_C_API bool sk_pathmeasure_get_matrix(sk_pathmeasure_t* pathMeasure, float distance, sk_matrix_t* matrix, sk_pathmeasure_matrixflags_t flags);
-
SK_C_API bool sk_pathmeasure_get_segment(sk_pathmeasure_t* pathMeasure, float start, float stop, sk_path_t* dst, bool startWithMoveTo);
-
SK_C_API bool sk_pathmeasure_is_closed(sk_pathmeasure_t* pathMeasure);
-
SK_C_API bool sk_pathmeasure_next_contour(sk_pathmeasure_t* pathMeasure);
-SK_C_API void sk_path_add_poly(sk_path_t* cpath, const sk_point_t* points, int count, bool close);
-
-SK_C_API uint32_t sk_path_get_segment_masks(sk_path_t* cpath);
-
SK_C_PLUS_PLUS_END_GUARD
#endif
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_patheffect_DEFINED
#define sk_patheffect_DEFINED
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_picture_DEFINED
#define sk_picture_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
-/**
- Create a new sk_picture_recorder_t. Its resources should be
- released with a call to sk_picture_recorder_delete().
-*/
SK_C_API sk_picture_recorder_t* sk_picture_recorder_new(void);
-/**
- Release the memory and other resources used by this
- sk_picture_recorder_t.
-*/
SK_C_API void sk_picture_recorder_delete(sk_picture_recorder_t*);
-
-/**
- Returns the canvas that records the drawing commands
-
- @param sk_rect_t* the cull rect used when recording this
- picture. Any drawing the falls outside of this
- rect is undefined, and may be drawn or it may not.
-*/
SK_C_API sk_canvas_t* sk_picture_recorder_begin_recording(sk_picture_recorder_t*, const sk_rect_t*);
-/**
- Signal that the caller is done recording. This invalidates the
- canvas returned by begin_recording. Ownership of the sk_picture_t
- is passed to the caller, who must call sk_picture_unref() when
- they are done using it. The returned picture is immutable.
-*/
SK_C_API sk_picture_t* sk_picture_recorder_end_recording(sk_picture_recorder_t*);
-
SK_C_API sk_canvas_t* sk_picture_get_recording_canvas(sk_picture_recorder_t* crec);
-/**
- Increment the reference count on the given sk_picture_t. Must be
- balanced by a call to sk_picture_unref().
-*/
SK_C_API void sk_picture_ref(sk_picture_t*);
-/**
- Decrement the reference count. If the reference count is 1 before
- the decrement, then release both the memory holding the
- sk_picture_t and any resouces it may be managing. New
- sk_picture_t are created with a reference count of 1.
-*/
SK_C_API void sk_picture_unref(sk_picture_t*);
-
-/**
- Returns a non-zero value unique among all pictures.
- */
SK_C_API uint32_t sk_picture_get_unique_id(sk_picture_t*);
-
-/**
- Return the cull rect specified when this picture was recorded.
-*/
SK_C_API void sk_picture_get_cull_rect(sk_picture_t*, sk_rect_t*);
SK_C_PLUS_PLUS_END_GUARD
/*
- * Copyright 2017 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2017 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_pixmap_DEFINED
#define sk_pixmap_DEFINED
SK_C_API size_t sk_pixmap_get_row_bytes(sk_pixmap_t* cpixmap);
SK_C_API const void* sk_pixmap_get_pixels(sk_pixmap_t* cpixmap);
SK_C_API sk_colortable_t* sk_pixmap_get_colortable(sk_pixmap_t* cpixmap);
+SK_C_API bool sk_pixmap_encode_image(sk_wstream_t* dst, const sk_pixmap_t* src, sk_encoded_image_format_t encoder, int quality);
+SK_C_API bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY);
SK_C_API bool sk_bitmapscaler_resize(const sk_pixmap_t* dst, const sk_pixmap_t* src, sk_bitmapscaler_resizemethod_t method);
SK_C_API void sk_color_premultiply_array(const sk_color_t* colors, int size, sk_pmcolor_t* pmcolors);
SK_C_API void sk_color_get_bit_shift(int* a, int* r, int* g, int* b);
-SK_C_API bool sk_pixmap_encode_image(sk_wstream_t* dst, const sk_pixmap_t* src, sk_encoded_image_format_t encoder, int quality);
-
-SK_C_API bool sk_pixmap_read_pixels(const sk_pixmap_t* cpixmap, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY);
-
SK_C_API void sk_swizzle_swap_rb(uint32_t* dest, const uint32_t* src, int count);
SK_C_API bool sk_webpencoder_encode(sk_wstream_t* dst, const sk_pixmap_t* src, sk_webpencoder_options_t options);
/*
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
* Copyright 2016 Bluebeam Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_shader_DEFINED
#define sk_shader_DEFINED
SK_C_API void sk_shader_ref(sk_shader_t*);
SK_C_API void sk_shader_unref(sk_shader_t*);
-
-/**
- Returns a shader that generates a linear gradient between the two
- specified points.
-
- @param points The start and end points for the gradient.
- @param colors The array[count] of colors, to be distributed between
- the two points
- @param colorPos May be NULL. array[count] of SkScalars, or NULL, of
- the relative position of each corresponding color
- in the colors array. If this is NULL, the the
- colors are distributed evenly between the start
- and end point. If this is not null, the values
- must begin with 0, end with 1.0, and intermediate
- values must be strictly increasing.
- @param colorCount Must be >=2. The number of colors (and pos if not
- NULL) entries.
- @param mode The tiling mode
-*/
SK_C_API sk_shader_t* sk_shader_new_linear_gradient(const sk_point_t points[2],
const sk_color_t colors[],
const float colorPos[],
int colorCount,
sk_shader_tilemode_t tileMode,
const sk_matrix_t* localMatrix);
-
-
-/**
- Returns a shader that generates a radial gradient given the center
- and radius.
-
- @param center The center of the circle for this gradient
- @param radius Must be positive. The radius of the circle for this
- gradient
- @param colors The array[count] of colors, to be distributed
- between the center and edge of the circle
- @param colorPos May be NULL. The array[count] of the relative
- position of each corresponding color in the colors
- array. If this is NULL, the the colors are
- distributed evenly between the center and edge of
- the circle. If this is not null, the values must
- begin with 0, end with 1.0, and intermediate
- values must be strictly increasing.
- @param count Must be >= 2. The number of colors (and pos if not
- NULL) entries
- @param tileMode The tiling mode
- @param localMatrix May be NULL
-*/
SK_C_API sk_shader_t* sk_shader_new_radial_gradient(const sk_point_t* center,
float radius,
const sk_color_t colors[],
int colorCount,
sk_shader_tilemode_t tileMode,
const sk_matrix_t* localMatrix);
-
-/**
- Returns a shader that generates a sweep gradient given a center.
-
- @param center The coordinates of the center of the sweep
- @param colors The array[count] of colors, to be distributed around
- the center.
- @param colorPos May be NULL. The array[count] of the relative
- position of each corresponding color in the colors
- array. If this is NULL, the the colors are
- distributed evenly between the center and edge of
- the circle. If this is not null, the values must
- begin with 0, end with 1.0, and intermediate
- values must be strictly increasing.
- @param colorCount Must be >= 2. The number of colors (and pos if
- not NULL) entries
- @param localMatrix May be NULL
-*/
SK_C_API sk_shader_t* sk_shader_new_sweep_gradient(const sk_point_t* center,
const sk_color_t colors[],
const float colorPos[],
int colorCount,
const sk_matrix_t* localMatrix);
-
-/**
- Returns a shader that generates a conical gradient given two circles, or
- returns NULL if the inputs are invalid. The gradient interprets the
- two circles according to the following HTML spec.
- http://dev.w3.org/html5/2dcontext/#dom-context-2d-createradialgradient
-
- Returns a shader that generates a sweep gradient given a center.
-
- @param start, startRadius Defines the first circle.
- @param end, endRadius Defines the first circle.
- @param colors The array[count] of colors, to be distributed between
- the two circles.
- @param colorPos May be NULL. The array[count] of the relative
- position of each corresponding color in the colors
- array. If this is NULL, the the colors are
- distributed evenly between the two circles. If
- this is not null, the values must begin with 0,
- end with 1.0, and intermediate values must be
- strictly increasing.
- @param colorCount Must be >= 2. The number of colors (and pos if
- not NULL) entries
- @param tileMode The tiling mode
- @param localMatrix May be NULL
-
-*/
SK_C_API sk_shader_t* sk_shader_new_two_point_conical_gradient(
const sk_point_t* start,
float startRadius,
int colorCount,
sk_shader_tilemode_t tileMode,
const sk_matrix_t* localMatrix);
-
-/**
- Call this to create a new "empty" shader, that will not draw anything.
-*/
SK_C_API sk_shader_t* sk_shader_new_empty(void);
-/**
- Call this to create a new shader that just draws the specified color. This should always
- draw the same as a paint with this color (and no shader).
-*/
SK_C_API sk_shader_t* sk_shader_new_color(sk_color_t color);
-/**
- Call this to create a new shader that will draw with the specified bitmap.
-
- If the bitmap cannot be used (e.g. has no pixels, or its dimensions
- exceed implementation limits (currently at 64K - 1)) then SkEmptyShader
- may be returned.
-
- @param src The bitmap to use inside the shader
- @param tmx The tiling mode to use when sampling the bitmap in the x-direction.
- @param tmy The tiling mode to use when sampling the bitmap in the y-direction.
-*/
SK_C_API sk_shader_t* sk_shader_new_bitmap(const sk_bitmap_t* src,
sk_shader_tilemode_t tmx,
sk_shader_tilemode_t tmy,
sk_shader_tilemode_t tmy,
const sk_matrix_t* localMatrix,
const sk_rect_t* tile);
-/**
- Return a shader that will apply the specified localMatrix to the proxy shader.
- The specified matrix will be applied before any matrix associated with the proxy.
-
- Note: ownership of the proxy is not transferred (though a ref is taken).
-*/
-SK_C_API sk_shader_t* sk_shader_new_local_matrix(sk_shader_t* proxy,
- const sk_matrix_t* localMatrix);
-SK_C_API sk_shader_t* sk_shader_new_color_filter(sk_shader_t* proxy,
- sk_colorfilter_t* filter);
+SK_C_API sk_shader_t* sk_shader_new_local_matrix(sk_shader_t* proxy, const sk_matrix_t* localMatrix);
+SK_C_API sk_shader_t* sk_shader_new_color_filter(sk_shader_t* proxy, sk_colorfilter_t* filter);
SK_C_API sk_shader_t* sk_shader_new_perlin_noise_fractal_noise(
float baseFrequencyX,
float baseFrequencyY,
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_stream_DEFINED
#define sk_stream_DEFINED
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_string_DEFINED
#define sk_string_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
-/**
- Returns a new empty sk_string_t. This call must be balanced with a call to
- sk_string_destructor().
-*/
SK_C_API sk_string_t* sk_string_new_empty(void);
-/**
- Returns a new sk_string_t by copying the specified source string, encoded in UTF-8.
- This call must be balanced with a call to sk_string_destructor().
-*/
SK_C_API sk_string_t* sk_string_new_with_copy(const char* src, size_t length);
-
-/**
- Deletes the string.
-*/
SK_C_API void sk_string_destructor(const sk_string_t*);
-
-/**
- Returns the number of bytes stored in the UTF 8 string. Note that this is the number of bytes, not characters.
-*/
SK_C_API size_t sk_string_get_size(const sk_string_t*);
-/**
- Returns the pointer to the string.
- */
SK_C_API const char* sk_string_get_c_str(const sk_string_t*);
SK_C_PLUS_PLUS_END_GUARD
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_surface_DEFINED
#define sk_surface_DEFINED
SK_C_PLUS_PLUS_BEGIN_GUARD
-/**
- Return the default sk_colortype_t; this is operating-system dependent.
-*/
SK_C_API sk_colortype_t sk_colortype_get_default_8888(void);
-/**
- Return a new surface, with the memory for the pixels automatically
- allocated. If the requested surface cannot be created, or the
- request is not a supported configuration, NULL will be returned.
-
- @param sk_imageinfo_t* Specify the width, height, color type, and
- alpha type for the surface.
-
- @param sk_surfaceprops_t* If not NULL, specify additional non-default
- properties of the surface.
-*/
SK_C_API sk_surface_t* sk_surface_new_raster(const sk_imageinfo_t*, const sk_surfaceprops_t*);
-
-/**
- Create a new surface which will draw into the specified pixels
- with the specified rowbytes. If the requested surface cannot be
- created, or the request is not a supported configuration, NULL
- will be returned.
-
- @param sk_imageinfo_t* Specify the width, height, color type, and
- alpha type for the surface.
- @param void* pixels Specify the location in memory where the
- destination pixels are. This memory must
- outlast this surface.
- @param size_t rowBytes Specify the difference, in bytes, between
- each adjacent row. Should be at least
- (width * sizeof(one pixel)).
- @param sk_surfaceprops_t* If not NULL, specify additional non-default
- properties of the surface.
-*/
SK_C_API sk_surface_t* sk_surface_new_raster_direct(const sk_imageinfo_t*, void* pixels, size_t rowBytes, const sk_surfaceprops_t* props);
-
-/**
- Decrement the reference count. If the reference count is 1 before
- the decrement, then release both the memory holding the
- sk_surface_t and any pixel memory it may be managing. New
- sk_surface_t are created with a reference count of 1.
-*/
SK_C_API void sk_surface_unref(sk_surface_t*);
-
-/**
- * Return the canvas associated with this surface. Note: the canvas is owned by the surface,
- * so the returned object is only valid while the owning surface is valid.
- */
SK_C_API sk_canvas_t* sk_surface_get_canvas(sk_surface_t*);
-
-/**
- * Call sk_image_unref() when the returned image is no longer used.
- */
SK_C_API sk_image_t* sk_surface_new_image_snapshot(sk_surface_t*);
-
-/**
- * Used to wrap a pre-existing 3D API rendering target as a SkSurface. Skia will not assume
- * ownership of the render target and the client must ensure the render target is valid for the
- * lifetime of the SkSurface.
- */
SK_C_API sk_surface_t* sk_surface_new_backend_render_target(gr_context_t* context, const gr_backend_rendertarget_desc_t* desc, const sk_surfaceprops_t* props);
-
-/**
- * Used to wrap a pre-existing backend 3D API texture as a SkSurface. The kRenderTarget flag
- * must be set on GrBackendTextureDesc for this to succeed. Skia will not assume ownership
- * of the texture and the client must ensure the texture is valid for the lifetime of the
- * SkSurface.
- */
SK_C_API sk_surface_t* sk_surface_new_backend_texture(gr_context_t* context, const gr_backend_texture_desc_t* desc, const sk_surfaceprops_t* props);
-
-/**
- * Used to wrap a pre-existing 3D API texture as a SkSurface. Skia will treat the texture as
- * a rendering target only, but unlike NewFromBackendRenderTarget, Skia will manage and own
- * the associated render target objects (but not the provided texture). The kRenderTarget flag
- * must be set on GrBackendTextureDesc for this to succeed. Skia will not assume ownership
- * of the texture and the client must ensure the texture is valid for the lifetime of the
- * SkSurface.
- */
SK_C_API sk_surface_t* sk_surface_new_backend_texture_as_render_target(gr_context_t* context, const gr_backend_texture_desc_t* desc, const sk_surfaceprops_t* props);
-
SK_C_API sk_surface_t* sk_surface_new_render_target(gr_context_t* context, bool budgeted, const sk_imageinfo_t* info, int sampleCount, const sk_surfaceprops_t* props);
-
SK_C_API void sk_surface_draw(sk_surface_t* surface, sk_canvas_t* canvas, float x, float y, const sk_paint_t* paint);
-
SK_C_API bool sk_surface_peek_pixels(sk_surface_t* surface, sk_pixmap_t* pixmap);
-
SK_C_API bool sk_surface_read_pixels(sk_surface_t* surface, sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY);
-
SK_C_API void sk_surface_get_props(sk_surface_t* surface, sk_surfaceprops_t* props);
SK_C_PLUS_PLUS_END_GUARD
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_svg_DEFINED
#define sk_svg_DEFINED
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_typeface_DEFINED
#define sk_typeface_DEFINED
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_types_DEFINED
#define sk_types_DEFINED
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_vertices_DEFINED
#define sk_vertices_DEFINED
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_xml_DEFINED
#define sk_xml_DEFINED
-//
-// SkManagedPixelSerializer.h
-//
-// Created by Matthew on 2017/08/18.
-// Copyright © 2017 Xamarin. All rights reserved.
-//
+/*
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#ifndef SkManagedPixelSerializer_h
#define SkManagedPixelSerializer_h
-//
-// SkManagedStream.hpp
-//
-// Created by Matthew on 2016/01/08.
-// Copyright © 2016 Xamarin. All rights reserved.
-//
+/*
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#ifndef SkManagedStream_h
#define SkManagedStream_h
-//
-// WinRTCompat.h
-//
-// Created by Matthew on 2016/06/20.
-// Copyright © 2016 Xamarin. All rights reserved.
-//
+/*
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#ifndef WinRTCompat_h
#define WinRTCompat_h
/*
- * Copyright 2017 Xamarin Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
* Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
#ifndef sk_managedstream_DEFINED
#define sk_managedstream_DEFINED
/*
* Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
-// DO NOT USE -- FOR INTERNAL TESTING ONLY
-
-
#ifndef sk_xamarin_DEFINED
#define sk_xamarin_DEFINED
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2017 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
* Copyright 2017 Bluebeam Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2015 Google Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2017 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
* Copyright 2016 Bluebeam Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2017 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
* Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2015 Google Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2014 Google Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
-//
-// SkManagedPixelSerializer.cpp
-//
-// Created by Matthew on 2017/08/18.
-// Copyright © 2017 Xamarin. All rights reserved.
-//
+/*
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#include "SkManagedPixelSerializer.h"
-//
-// SkManagedStream.cpp
-//
-// Created by Matthew on 2016/01/08.
-// Copyright © 2016 Xamarin. All rights reserved.
-//
+/*
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#include "SkManagedStream.h"
-//
-// SkiaKeeper.c
-//
-// Created by Bill Holmes on 11/23/15.
-// Copyright © 2015 Xamarin. All rights reserved.
-//
+/*
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#include "sk_xamarin.h"
-//
-// WinRTCompat.c
-//
-// Created by Matthew Leibowitz on 06/09/16.
-// Copyright © 2016 Xamarin. All rights reserved.
-//
+/*
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
#include "WinRTCompat.h"
/*
- * Copyright 2017 Xamarin Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
/*
- * Copyright 2016 Xamarin Inc.
+ * Copyright 2015 Xamarin Inc.
+ * Copyright 2017 Microsoft Corporation. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.