Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserve the pre-skia-update C API for some simple cases #110

Open
wants to merge 1 commit into
base: skiasharp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/c/sk_bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ SK_C_API bool sk_bitmap_extract_subset(sk_bitmap_t* cbitmap, sk_bitmap_t* dst, s
SK_C_API bool sk_bitmap_extract_alpha(sk_bitmap_t* cbitmap, sk_bitmap_t* dst, const sk_paint_t* paint, sk_ipoint_t* offset);
SK_C_API void sk_bitmap_notify_pixels_changed(sk_bitmap_t* cbitmap);
SK_C_API void sk_bitmap_swap(sk_bitmap_t* cbitmap, sk_bitmap_t* cother);
SK_C_API sk_shader_t* sk_bitmap_make_shader(sk_bitmap_t* cbitmap, sk_shader_tilemode_t tmx, sk_shader_tilemode_t tmy, sk_sampling_options_t* sampling, const sk_matrix_t* cmatrix);
SK_C_API sk_shader_t* sk_bitmap_make_shader(sk_bitmap_t* cbitmap, sk_shader_tilemode_t tmx, sk_shader_tilemode_t tmy, const sk_matrix_t* cmatrix);
SK_C_API sk_shader_t* sk_bitmap_make_shader_v2(sk_bitmap_t* cbitmap, sk_shader_tilemode_t tmx, sk_shader_tilemode_t tmy, sk_sampling_options_t* sampling, const sk_matrix_t* cmatrix);

SK_C_PLUS_PLUS_END_GUARD

Expand Down
24 changes: 16 additions & 8 deletions include/c/sk_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ SK_C_API void sk_canvas_draw_line(sk_canvas_t* ccanvas, float x0, float y0, floa
SK_C_API void sk_canvas_draw_simple_text(sk_canvas_t* ccanvas, const void* text, size_t byte_length, sk_text_encoding_t encoding, float x, float y, const sk_font_t* cfont, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_text_blob (sk_canvas_t* ccanvas, sk_textblob_t* text, float x, float y, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_reset_matrix(sk_canvas_t* ccanvas);
SK_C_API void sk_canvas_set_matrix(sk_canvas_t* ccanvas, const sk_matrix44_t* cmatrix);
SK_C_API void sk_canvas_get_matrix(sk_canvas_t* ccanvas, sk_matrix44_t* cmatrix);
SK_C_API void sk_canvas_set_matrix(sk_canvas_t* ccanvas, const sk_matrix_t* cmatrix);
SK_C_API void sk_canvas_set_matrix_44(sk_canvas_t* ccanvas, const sk_matrix44_t* cmatrix);
SK_C_API void sk_canvas_get_matrix(sk_canvas_t* ccanvas, sk_matrix_t* cmatrix);
SK_C_API void sk_canvas_get_matrix_44(sk_canvas_t* ccanvas, sk_matrix44_t* cmatrix);
SK_C_API void sk_canvas_draw_round_rect(sk_canvas_t* ccanvas, const sk_rect_t* crect, float rx, float ry, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_clip_rect_with_operation(sk_canvas_t* ccanvas, const sk_rect_t* crect, sk_clipop_t op, bool doAA);
SK_C_API void sk_canvas_clip_path_with_operation(sk_canvas_t* ccanvas, const sk_path_t* cpath, sk_clipop_t op, bool doAA);
Expand All @@ -44,7 +46,8 @@ SK_C_API void sk_canvas_scale(sk_canvas_t* ccanvas, float sx, float sy);
SK_C_API void sk_canvas_rotate_degrees(sk_canvas_t* ccanvas, float degrees);
SK_C_API void sk_canvas_rotate_radians(sk_canvas_t* ccanvas, float radians);
SK_C_API void sk_canvas_skew(sk_canvas_t* ccanvas, float sx, float sy);
SK_C_API void sk_canvas_concat(sk_canvas_t* ccanvas, const sk_matrix44_t* cmatrix);
SK_C_API void sk_canvas_concat(sk_canvas_t* ccanvas, const sk_matrix_t* cmatrix);
SK_C_API void sk_canvas_concat_m44(sk_canvas_t* ccanvas, const sk_matrix44_t* cmatrix);
SK_C_API bool sk_canvas_quick_reject(sk_canvas_t* ccanvas, const sk_rect_t* crect);
SK_C_API void sk_canvas_clip_region(sk_canvas_t* ccanvas, const sk_region_t* region, sk_clipop_t op);
SK_C_API void sk_canvas_draw_paint(sk_canvas_t* ccanvas, const sk_paint_t* cpaint);
Expand All @@ -54,8 +57,10 @@ SK_C_API void sk_canvas_draw_rrect(sk_canvas_t* ccanvas, const sk_rrect_t* crect
SK_C_API void sk_canvas_draw_circle(sk_canvas_t* ccanvas, float cx, float cy, float rad, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_oval(sk_canvas_t* ccanvas, const sk_rect_t* crect, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_path(sk_canvas_t* ccanvas, const sk_path_t* cpath, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_image(sk_canvas_t* ccanvas, const sk_image_t* cimage, float x, float y, const sk_sampling_options_t* sampling, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_image_rect(sk_canvas_t* ccanvas, const sk_image_t* cimage, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_sampling_options_t* sampling, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_image(sk_canvas_t* ccanvas, const sk_image_t* cimage, float x, float y, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_image_v2(sk_canvas_t* ccanvas, const sk_image_t* cimage, float x, float y, const sk_sampling_options_t* sampling, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_image_rect(sk_canvas_t* ccanvas, const sk_image_t* cimage, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_image_rect_v2(sk_canvas_t* ccanvas, const sk_image_t* cimage, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_sampling_options_t* sampling, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_picture(sk_canvas_t* ccanvas, const sk_picture_t* cpicture, const sk_matrix_t* cmatrix, const sk_paint_t* cpaint);
SK_C_API void sk_canvas_draw_drawable(sk_canvas_t* ccanvas, sk_drawable_t* cdrawable, const sk_matrix_t* cmatrix);
SK_C_API void sk_canvas_flush(sk_canvas_t* ccanvas);
Expand All @@ -65,12 +70,15 @@ SK_C_API void sk_canvas_draw_annotation(sk_canvas_t* t, const sk_rect_t* rect, c
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_image_lattice(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_lattice_t* lattice, const sk_rect_t* dst, sk_filter_mode_t mode, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_image_nine(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_irect_t* center, const sk_rect_t* dst, sk_filter_mode_t mode, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_image_lattice(sk_canvas_t* ccanvas, 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_image_lattice_v2(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_lattice_t* lattice, const sk_rect_t* dst, sk_filter_mode_t mode, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_image_nine(sk_canvas_t* ccanvas, 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_image_nine_v2(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_irect_t* center, const sk_rect_t* dst, sk_filter_mode_t mode, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_vertices(sk_canvas_t* ccanvas, const sk_vertices_t* vertices, sk_blendmode_t mode, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_arc(sk_canvas_t* ccanvas, const sk_rect_t* oval, float startAngle, float sweepAngle, bool useCenter, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_drrect(sk_canvas_t* ccanvas, const sk_rrect_t* outer, const sk_rrect_t* inner, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_atlas(sk_canvas_t* ccanvas, const sk_image_t* atlas, const sk_rsxform_t* xform, const sk_rect_t* tex, const sk_color_t* colors, int count, sk_blendmode_t mode, const sk_sampling_options_t* sampling, const sk_rect_t* cullRect, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_atlas(sk_canvas_t* ccanvas, const sk_image_t* atlas, const sk_rsxform_t* xform, const sk_rect_t* tex, const sk_color_t* colors, int count, sk_blendmode_t mode, const sk_rect_t* cullRect, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_atlas_v2(sk_canvas_t* ccanvas, const sk_image_t* atlas, const sk_rsxform_t* xform, const sk_rect_t* tex, const sk_color_t* colors, int count, sk_blendmode_t mode, const sk_sampling_options_t* sampling, const sk_rect_t* cullRect, const sk_paint_t* paint);
SK_C_API void sk_canvas_draw_patch(sk_canvas_t* ccanvas, const sk_point_t* cubics, const sk_color_t* colors, const sk_point_t* texCoords, sk_blendmode_t mode, const sk_paint_t* paint);
SK_C_API bool sk_canvas_is_clip_empty(sk_canvas_t* ccanvas);
SK_C_API bool sk_canvas_is_clip_rect(sk_canvas_t* ccanvas);
Expand Down
6 changes: 4 additions & 2 deletions include/c/sk_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ SK_C_API sk_alphatype_t sk_image_get_alpha_type(const sk_image_t* image);
SK_C_API sk_colortype_t sk_image_get_color_type(const sk_image_t* image);
SK_C_API sk_colorspace_t* sk_image_get_colorspace(const sk_image_t* image);
SK_C_API bool sk_image_is_alpha_only(const sk_image_t* image);
SK_C_API sk_shader_t* sk_image_make_shader(const sk_image_t* image, sk_shader_tilemode_t tileX, sk_shader_tilemode_t tileY, const sk_sampling_options_t* sampling, const sk_matrix_t* cmatrix);
SK_C_API sk_shader_t* sk_image_make_shader(const sk_image_t* image, sk_shader_tilemode_t tileX, sk_shader_tilemode_t tileY, int /*unused*/, const sk_matrix_t* cmatrix);
SK_C_API sk_shader_t* sk_image_make_shader_v2(const sk_image_t* image, sk_shader_tilemode_t tileX, sk_shader_tilemode_t tileY, const sk_sampling_options_t* sampling, const sk_matrix_t* cmatrix);
SK_C_API bool sk_image_peek_pixels(const sk_image_t* image, sk_pixmap_t* pixmap);
SK_C_API bool sk_image_is_texture_backed(const sk_image_t* image);
SK_C_API bool sk_image_is_lazy_generated(const sk_image_t* image);
SK_C_API bool sk_image_is_valid(const sk_image_t* image, gr_recording_context_t* context);
SK_C_API bool sk_image_read_pixels(const sk_image_t* image, const sk_imageinfo_t* dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, sk_image_caching_hint_t cachingHint);
SK_C_API bool sk_image_read_pixels_into_pixmap(const sk_image_t* image, const sk_pixmap_t* dst, int srcX, int srcY, sk_image_caching_hint_t cachingHint);
SK_C_API bool sk_image_scale_pixels(const sk_image_t* image, const sk_pixmap_t* dst, const sk_sampling_options_t* sampling, sk_image_caching_hint_t cachingHint);
SK_C_API bool sk_image_scale_pixels(const sk_image_t* image, const sk_pixmap_t* dst, sk_image_caching_hint_t cachingHint);
SK_C_API bool sk_image_scale_pixels_v2(const sk_image_t* image, const sk_pixmap_t* dst, const sk_sampling_options_t* sampling, sk_image_caching_hint_t cachingHint);
SK_C_API sk_data_t* sk_image_ref_encoded(const sk_image_t* cimage);
SK_C_API sk_image_t* sk_image_make_subset_raster(const sk_image_t* cimage, const sk_irect_t* subset);
SK_C_API sk_image_t* sk_image_make_subset(const sk_image_t* cimage, gr_direct_context_t* context, const sk_irect_t* subset);
Expand Down
8 changes: 6 additions & 2 deletions include/c/sk_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ typedef enum {
BGRA_1010102_SK_COLORTYPE,
RGB_101010X_SK_COLORTYPE,
BGR_101010X_SK_COLORTYPE,
BGR_101010X_XR_SK_COLORTYPE,
GRAY_8_SK_COLORTYPE,
RGBA_F16_NORM_SK_COLORTYPE,
RGBA_F16_SK_COLORTYPE,
Expand All @@ -122,6 +121,11 @@ typedef enum {
R16G16B16A16_UNORM_SK_COLORTYPE,
SRGBA_8888_SK_COLORTYPE,
R8_UNORM_SK_COLORTYPE,

// v2
BGR_101010X_XR_SK_COLORTYPE,

// v2 READONLY
} sk_colortype_t;

typedef enum {
Expand Down Expand Up @@ -836,10 +840,10 @@ typedef struct {
int fDuration;
bool fFullyReceived;
sk_alphatype_t fAlphaType;
bool fHasAlphaWithinBounds;
sk_codecanimation_disposalmethod_t fDisposalMethod;
sk_codecanimation_blend_t fBlend;
sk_irect_t fFrameRect;
bool fHasAlphaWithinBounds;
} sk_codec_frameinfo_t;

typedef struct sk_svgcanvas_t sk_svgcanvas_t;
Expand Down
6 changes: 4 additions & 2 deletions include/core/SkColorType.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ enum SkColorType : int {
kBGRA_1010102_SkColorType, //!< 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
kRGB_101010x_SkColorType, //!< pixel with 10 bits each for red, green, blue; in 32-bit word
kBGR_101010x_SkColorType, //!< pixel with 10 bits each for blue, green, red; in 32-bit word
kBGR_101010x_XR_SkColorType, //!< pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
kGray_8_SkColorType, //!< pixel with grayscale level in 8-bit byte
kRGBA_F16Norm_SkColorType, //!< pixel with half floats in [0,1] for red, green, blue, alpha;
// in 64-bit word
Expand All @@ -50,7 +49,10 @@ enum SkColorType : int {
kSRGBA_8888_SkColorType,
kR8_unorm_SkColorType,

kLastEnum_SkColorType = kR8_unorm_SkColorType, //!< last valid value
//v2
kBGR_101010x_XR_SkColorType, //!< pixel with 10 bits each for blue, green, red; in 32-bit word, extended range

kLastEnum_SkColorType = kBGR_101010x_XR_SkColorType, //!< last valid value

#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
kN32_SkColorType = kBGRA_8888_SkColorType,//!< native 32-bit BGRA encoding
Expand Down
12 changes: 11 additions & 1 deletion src/c/sk_bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "src/c/sk_types_priv.h"

extern "C" const sk_sampling_options_t default_sampling = {}; // TODO: put this in it's own file?

void sk_bitmap_destructor(sk_bitmap_t* cbitmap) {
delete AsBitmap(cbitmap);
}
Expand Down Expand Up @@ -144,7 +146,15 @@ void sk_bitmap_swap(sk_bitmap_t* cbitmap, sk_bitmap_t* cother) {
AsBitmap(cbitmap)->swap(*AsBitmap(cother));
}

sk_shader_t* sk_bitmap_make_shader(sk_bitmap_t* cbitmap, sk_shader_tilemode_t tmx, sk_shader_tilemode_t tmy, sk_sampling_options_t* sampling, const sk_matrix_t* cmatrix) {
sk_shader_t* sk_bitmap_make_shader(sk_bitmap_t* cbitmap, sk_shader_tilemode_t tmx, sk_shader_tilemode_t tmy, const sk_matrix_t* cmatrix) {
SkMatrix m;
if (cmatrix) {
m = AsMatrix(cmatrix);
}
return ToShader(AsBitmap(cbitmap)->makeShader((SkTileMode)tmx, (SkTileMode)tmy, *AsSamplingOptions(&default_sampling), cmatrix ? &m : nullptr).release());
}

sk_shader_t* sk_bitmap_make_shader_v2(sk_bitmap_t* cbitmap, sk_shader_tilemode_t tmx, sk_shader_tilemode_t tmy, sk_sampling_options_t* sampling, const sk_matrix_t* cmatrix) {
SkMatrix m;
if (cmatrix) {
m = AsMatrix(cmatrix);
Expand Down
54 changes: 46 additions & 8 deletions src/c/sk_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "src/c/sk_types_priv.h"

extern const sk_sampling_options_t default_sampling;

void sk_canvas_destroy(sk_canvas_t* ccanvas) {
delete AsCanvas(ccanvas);
}
Expand Down Expand Up @@ -73,11 +75,19 @@ void sk_canvas_reset_matrix(sk_canvas_t* ccanvas) {
AsCanvas(ccanvas)->resetMatrix();
}

void sk_canvas_set_matrix(sk_canvas_t* ccanvas, const sk_matrix44_t* cmatrix) {
void sk_canvas_set_matrix(sk_canvas_t* ccanvas, const sk_matrix_t* cmatrix) {
AsCanvas(ccanvas)->setMatrix(AsMatrix(cmatrix));
}

void sk_canvas_set_matrix_m44(sk_canvas_t* ccanvas, const sk_matrix44_t* cmatrix) {
AsCanvas(ccanvas)->setMatrix(AsM44(cmatrix));
}

void sk_canvas_get_matrix(sk_canvas_t* ccanvas, sk_matrix44_t* cmatrix) {
void sk_canvas_get_total_matrix(sk_canvas_t* ccanvas, sk_matrix_t* cmatrix) {
*cmatrix = ToMatrix((SkMatrix)AsCanvas(ccanvas)->getTotalMatrix());
}

void sk_canvas_get_matrix_m44(sk_canvas_t* ccanvas, sk_matrix44_t* cmatrix) {
*cmatrix = ToM44(AsCanvas(ccanvas)->getLocalToDevice());
}

Expand Down Expand Up @@ -137,7 +147,11 @@ void sk_canvas_skew(sk_canvas_t* ccanvas, float sx, float sy) {
AsCanvas(ccanvas)->skew(sx, sy);
}

void sk_canvas_concat(sk_canvas_t* ccanvas, const sk_matrix44_t* cmatrix) {
void sk_canvas_concat(sk_canvas_t* ccanvas, const sk_matrix_t* cmatrix) {
AsCanvas(ccanvas)->concat(AsMatrix(cmatrix));
}

void sk_canvas_concat_m44(sk_canvas_t* ccanvas, const sk_matrix44_t* cmatrix) {
AsCanvas(ccanvas)->concat(AsM44(cmatrix));
}

Expand Down Expand Up @@ -177,11 +191,23 @@ void sk_canvas_draw_path(sk_canvas_t* ccanvas, const sk_path_t* cpath, const sk_
AsCanvas(ccanvas)->drawPath(*AsPath(cpath), *AsPaint(cpaint));
}

void sk_canvas_draw_image(sk_canvas_t* ccanvas, const sk_image_t* cimage, float x, float y, const sk_sampling_options_t* sampling, const sk_paint_t* cpaint) {
void sk_canvas_draw_image(sk_canvas_t* ccanvas, const sk_image_t* cimage, float x, float y, const sk_paint_t* cpaint) {
AsCanvas(ccanvas)->drawImage(AsImage(cimage), x, y, *AsSamplingOptions(&default_sampling), AsPaint(cpaint));
}

void sk_canvas_draw_image_v2(sk_canvas_t* ccanvas, const sk_image_t* cimage, float x, float y, const sk_sampling_options_t* sampling, const sk_paint_t* cpaint) {
AsCanvas(ccanvas)->drawImage(AsImage(cimage), x, y, *AsSamplingOptions(sampling), AsPaint(cpaint));
}

void sk_canvas_draw_image_rect(sk_canvas_t* ccanvas, const sk_image_t* cimage, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_sampling_options_t* sampling, const sk_paint_t* cpaint) {
void sk_canvas_draw_image_rect(sk_canvas_t* ccanvas, const sk_image_t* cimage, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_paint_t* cpaint) {
if (csrcR) {
AsCanvas(ccanvas)->drawImageRect(AsImage(cimage), *AsRect(csrcR), *AsRect(cdstR), *AsSamplingOptions(&default_sampling), AsPaint(cpaint), SkCanvas::SrcRectConstraint::kFast_SrcRectConstraint);
} else {
AsCanvas(ccanvas)->drawImageRect(AsImage(cimage), *AsRect(cdstR), *AsSamplingOptions(&default_sampling), AsPaint(cpaint));
}
}

void sk_canvas_draw_image_rect_v2(sk_canvas_t* ccanvas, const sk_image_t* cimage, const sk_rect_t* csrcR, const sk_rect_t* cdstR, const sk_sampling_options_t* sampling, const sk_paint_t* cpaint) {
if (csrcR) {
AsCanvas(ccanvas)->drawImageRect(AsImage(cimage), *AsRect(csrcR), *AsRect(cdstR), *AsSamplingOptions(sampling), AsPaint(cpaint), SkCanvas::SrcRectConstraint::kFast_SrcRectConstraint);
} else {
Expand Down Expand Up @@ -233,11 +259,19 @@ void sk_canvas_draw_link_destination_annotation(sk_canvas_t* t, const sk_rect_t*
SkAnnotateLinkToDestination(AsCanvas(t), *AsRect(rect), AsData(value));
}

void sk_canvas_draw_image_lattice(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_lattice_t* lattice, const sk_rect_t* dst, sk_filter_mode_t mode, const sk_paint_t* paint) {
void sk_canvas_draw_image_lattice(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_lattice_t* lattice, const sk_rect_t* dst, const sk_paint_t* paint) {
AsCanvas(ccanvas)->drawImageLattice(AsImage(image), *AsLattice(lattice), *AsRect(dst), (SkFilterMode)NEAREST_SK_FILTER_MODE, AsPaint(paint));
}

void sk_canvas_draw_image_lattice_v2(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_lattice_t* lattice, const sk_rect_t* dst, sk_filter_mode_t mode, const sk_paint_t* paint) {
AsCanvas(ccanvas)->drawImageLattice(AsImage(image), *AsLattice(lattice), *AsRect(dst), (SkFilterMode)mode, AsPaint(paint));
}

void sk_canvas_draw_image_nine(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_irect_t* center, const sk_rect_t* dst, sk_filter_mode_t mode, const sk_paint_t* paint) {
void sk_canvas_draw_image_nine(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_irect_t* center, const sk_rect_t* dst, const sk_paint_t* paint) {
AsCanvas(ccanvas)->drawImageNine(AsImage(image), *AsIRect(center), *AsRect(dst), (SkFilterMode)NEAREST_SK_FILTER_MODE, AsPaint(paint));
}

void sk_canvas_draw_image_nine_v2(sk_canvas_t* ccanvas, const sk_image_t* image, const sk_irect_t* center, const sk_rect_t* dst, sk_filter_mode_t mode, const sk_paint_t* paint) {
AsCanvas(ccanvas)->drawImageNine(AsImage(image), *AsIRect(center), *AsRect(dst), (SkFilterMode)mode, AsPaint(paint));
}

Expand All @@ -253,7 +287,11 @@ void sk_canvas_draw_drrect(sk_canvas_t* ccanvas, const sk_rrect_t* outer, const
AsCanvas(ccanvas)->drawDRRect(*AsRRect(outer), *AsRRect(inner), *AsPaint(paint));
}

void sk_canvas_draw_atlas(sk_canvas_t* ccanvas, const sk_image_t* atlas, const sk_rsxform_t* xform, const sk_rect_t* tex, const sk_color_t* colors, int count, sk_blendmode_t mode, const sk_sampling_options_t* sampling, const sk_rect_t* cullRect, const sk_paint_t* paint) {
void sk_canvas_draw_atlas(sk_canvas_t* ccanvas, const sk_image_t* atlas, const sk_rsxform_t* xform, const sk_rect_t* tex, const sk_color_t* colors, int count, sk_blendmode_t mode, const sk_rect_t* cullRect, const sk_paint_t* paint) {
AsCanvas(ccanvas)->drawAtlas(AsImage(atlas), AsRSXform(xform), AsRect(tex), colors, count, (SkBlendMode)mode, *AsSamplingOptions(&default_sampling), AsRect(cullRect), AsPaint(paint));
}

void sk_canvas_draw_atlas_v2(sk_canvas_t* ccanvas, const sk_image_t* atlas, const sk_rsxform_t* xform, const sk_rect_t* tex, const sk_color_t* colors, int count, sk_blendmode_t mode, const sk_sampling_options_t* sampling, const sk_rect_t* cullRect, const sk_paint_t* paint) {
AsCanvas(ccanvas)->drawAtlas(AsImage(atlas), AsRSXform(xform), AsRect(tex), colors, count, (SkBlendMode)mode, *AsSamplingOptions(sampling), AsRect(cullRect), AsPaint(paint));
}

Expand Down
Loading