*/
SK_C_API void sk_canvas_draw_point(sk_canvas_t*, float, float, const sk_paint_t*);
/**
- Draws a single point with the specified paint
-*/
-SK_C_API void sk_canvas_draw_point_color(sk_canvas_t*, float, float, sk_color_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);
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_clip_bounds(sk_canvas_t* t, sk_rect_t* cbounds);
+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_clip_device_bounds(sk_canvas_t* t, sk_irect_t* cbounds);
+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
SK_C_API sk_colorfilter_t* sk_colorfilter_new_mode(sk_color_t c, sk_blendmode_t mode);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_lighting(sk_color_t mul, sk_color_t add);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_compose(sk_colorfilter_t* outer, sk_colorfilter_t* inner);
-SK_C_API sk_colorfilter_t* sk_colorfilter_new_color_cube(sk_data_t* cubeData, int cubeDimension);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_color_matrix(const float array[20]);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_luma_color(void);
-SK_C_API sk_colorfilter_t* sk_colorfilter_new_gamma(float gamma);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_table(const uint8_t table[256]);
SK_C_API sk_colorfilter_t* sk_colorfilter_new_table_argb(const uint8_t tableA[256], const uint8_t tableR[256], const uint8_t tableG[256], const uint8_t tableB[256]);
SK_C_API sk_document_t* sk_document_create_pdf_from_filename(const char* path, float dpi);
SK_C_API sk_document_t* sk_document_create_xps_from_stream(sk_wstream_t* stream, float dpi);
-SK_C_API sk_document_t* sk_document_create_xps_from_filename(const char* path, float dpi);
SK_C_API sk_canvas_t* sk_document_begin_page(sk_document_t* document, float width, float height, const sk_rect_t* content);
SK_C_API void sk_document_end_page(sk_document_t* document);
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_underline_text(const sk_paint_t*);
-SK_C_API void sk_paint_set_underline_text(sk_paint_t*, bool);
-
-SK_C_API bool sk_paint_is_strikethru_text(const sk_paint_t*);
-SK_C_API void sk_paint_set_strikethru_text(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);
SBGRA_8888_GR_PIXEL_CONFIG,
RGBA_8888_SINT_GR_PIXEL_CONFIG,
ETC1_GR_PIXEL_CONFIG,
- LATC_GR_PIXEL_CONFIG,
- R11_EAC_GR_PIXEL_CONFIG,
- ASTC_12X12_GR_PIXEL_CONFIG,
RGBA_FLOAT_GR_PIXEL_CONFIG,
+ RG_FLOAT_GR_PIXEL_CONFIG,
ALPHA_HALF_GR_PIXEL_CONFIG,
RGBA_HALF_GR_PIXEL_CONFIG,
} gr_pixelconfig_t;
AsCanvas(ccanvas)->drawPoint (x, y, *AsPaint(cpaint));
}
-void sk_canvas_draw_point_color(sk_canvas_t* ccanvas, float x, float y, sk_color_t color)
-{
- AsCanvas(ccanvas)->drawPoint (x, y, color);
-}
-
void sk_canvas_draw_line(sk_canvas_t* ccanvas, float x0, float y0, float x1, float y1, sk_paint_t* cpaint)
{
AsCanvas(ccanvas)->drawLine(x0, y0, x1, y1, *AsPaint(cpaint));
AsCanvas(ccanvas)->clipPath(AsPath(*cpath), (SkClipOp)op, doAA);
}
-bool sk_canvas_get_clip_bounds(sk_canvas_t* ccanvas, sk_rect_t* cbounds) {
- return AsCanvas(ccanvas)->getClipBounds(AsRect(cbounds));
+bool sk_canvas_get_local_clip_bounds(sk_canvas_t* ccanvas, sk_rect_t* cbounds) {
+ return AsCanvas(ccanvas)->getLocalClipBounds(AsRect(cbounds));
}
-bool sk_canvas_get_clip_device_bounds(sk_canvas_t* ccanvas, sk_irect_t* cbounds) {
- return AsCanvas(ccanvas)->getClipDeviceBounds(AsIRect(cbounds));
+bool sk_canvas_get_device_clip_bounds(sk_canvas_t* ccanvas, sk_irect_t* cbounds) {
+ return AsCanvas(ccanvas)->getDeviceClipBounds(AsIRect(cbounds));
}
int sk_canvas_save(sk_canvas_t* ccanvas) {
* found in the LICENSE file.
*/
-#include "SkColorCubeFilter.h"
#include "SkColorMatrixFilter.h"
#include "SkLumaColorFilter.h"
#include "SkTableColorFilter.h"
-#include "SkGammaColorFilter.h"
#include "sk_colorfilter.h"
return ToColorFilter(filter.release());
}
-sk_colorfilter_t* sk_colorfilter_new_color_cube(sk_data_t* cubeData, int cubeDimension) {
-
- sk_sp<SkColorFilter> filter = SkColorCubeFilter::Make(
- sk_ref_sp(AsData(cubeData)),
- cubeDimension);
- return ToColorFilter(filter.release());
-}
-
sk_colorfilter_t* sk_colorfilter_new_color_matrix(const float array[20]) {
sk_sp<SkColorFilter> filter = SkColorFilter::MakeMatrixFilterRowMajor255(
return ToColorFilter(filter.release());
}
-sk_colorfilter_t* sk_colorfilter_new_gamma(float gamma) {
-
- sk_sp<SkColorFilter> filter = SkGammaColorFilter::Make(gamma);
- return ToColorFilter(filter.release());
-}
-
sk_colorfilter_t* sk_colorfilter_new_table(const uint8_t table[256]) {
sk_sp<SkColorFilter> filter = SkTableColorFilter::Make(table);
return ToDocument(SkDocument::MakeXPS(AsWStream(stream), dpi).release());
}
-sk_document_t* sk_document_create_xps_from_filename(const char* path, float dpi) {
- return ToDocument(SkDocument::MakeXPS(path, dpi).release());
-}
-
sk_canvas_t* sk_document_begin_page(sk_document_t* document, float width, float height, const sk_rect_t* content) {
return ToCanvas(AsDocument(document)->beginPage(width, height, AsRect(content)));
}
static_assert ((int)GrPixelConfig::kSBGRA_8888_GrPixelConfig == (int)SBGRA_8888_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
static_assert ((int)GrPixelConfig::kRGBA_8888_sint_GrPixelConfig == (int)RGBA_8888_SINT_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
static_assert ((int)GrPixelConfig::kETC1_GrPixelConfig == (int)ETC1_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
-static_assert ((int)GrPixelConfig::kLATC_GrPixelConfig == (int)LATC_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
-static_assert ((int)GrPixelConfig::kR11_EAC_GrPixelConfig == (int)R11_EAC_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
-static_assert ((int)GrPixelConfig::kASTC_12x12_GrPixelConfig == (int)ASTC_12X12_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
static_assert ((int)GrPixelConfig::kRGBA_float_GrPixelConfig == (int)RGBA_FLOAT_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
+static_assert ((int)GrPixelConfig::kRG_float_GrPixelConfig == (int)RG_FLOAT_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
static_assert ((int)GrPixelConfig::kAlpha_half_GrPixelConfig == (int)ALPHA_HALF_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
static_assert ((int)GrPixelConfig::kRGBA_half_GrPixelConfig == (int)RGBA_HALF_GR_PIXEL_CONFIG, ASSERT_MSG(GrPixelConfig, gr_pixelconfig_t));
if (cmatrix) {
from_c(cmatrix, &matrix);
}
- return ToImage(SkImage::MakeFromPicture(sk_ref_sp(AsPicture(picture)), AsISize(*dimensions), &matrix, AsPaint(paint)).release());
+ return ToImage(SkImage::MakeFromPicture(sk_ref_sp(AsPicture(picture)), AsISize(*dimensions), &matrix, AsPaint(paint), SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()).release());
}
int sk_image_get_width(const sk_image_t* cimage) {
AsPaint(cpaint)->setHinting((SkPaint::Hinting)hintingLevel);
}
-bool sk_paint_is_underline_text(const sk_paint_t* cpaint) {
- return AsPaint(cpaint)->isUnderlineText();
-}
-
-void sk_paint_set_underline_text(sk_paint_t* cpaint, bool underlineText) {
- AsPaint(cpaint)->setUnderlineText(underlineText);
-}
-
-bool sk_paint_is_strikethru_text(const sk_paint_t* cpaint) {
- return AsPaint(cpaint)->isStrikeThruText();
-}
-
-void sk_paint_set_strikethru_text(sk_paint_t* cpaint, bool strikeThruText) {
- AsPaint(cpaint)->setStrikeThruText(strikeThruText);
-}
-
bool sk_paint_is_fake_bold_text(const sk_paint_t* cpaint) {
return AsPaint(cpaint)->isFakeBoldText();
}
sk_path_effect_t* sk_path_effect_create_compose(sk_path_effect_t* outer, sk_path_effect_t* inner)
{
- return ToPathEffect(SkComposePathEffect::Make(sk_ref_sp(AsPathEffect(outer)), sk_ref_sp(AsPathEffect(inner))).release());
+ return ToPathEffect(SkPathEffect::MakeCompose(sk_ref_sp(AsPathEffect(outer)), sk_ref_sp(AsPathEffect(inner))).release());
}
sk_path_effect_t* sk_path_effect_create_sum(sk_path_effect_t* first, sk_path_effect_t* second)
{
- return ToPathEffect(SkSumPathEffect::Make(sk_ref_sp(AsPathEffect(first)), sk_ref_sp(AsPathEffect(second))).release());
+ return ToPathEffect(SkPathEffect::MakeSum(sk_ref_sp(AsPathEffect(first)), sk_ref_sp(AsPathEffect(second))).release());
}
sk_path_effect_t* sk_path_effect_create_discrete(float segLength, float deviation, uint32_t seedAssist /*0*/)