Updated to the C API after updating the C++ API
authorMatthew Leibowitz <mattleibow@live.com>
Sat, 6 May 2017 23:24:57 +0000 (19:24 -0400)
committerMatthew Leibowitz <mattleibow@live.com>
Sat, 6 May 2017 23:24:57 +0000 (19:24 -0400)
12 files changed:
include/c/sk_canvas.h
include/c/sk_colorfilter.h
include/c/sk_document.h
include/c/sk_paint.h
include/c/sk_types.h
src/c/sk_canvas.cpp
src/c/sk_colorfilter.cpp
src/c/sk_document.cpp
src/c/sk_enums.cpp
src/c/sk_image.cpp
src/c/sk_paint.cpp
src/c/sk_patheffect.cpp

index 678b5e6..5948f8f 100644 (file)
@@ -215,10 +215,6 @@ SK_C_API void sk_canvas_draw_points(sk_canvas_t*, sk_point_mode_t, size_t, const
 */
 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);
@@ -325,13 +321,13 @@ SK_C_API void sk_canvas_clip_path_with_operation(sk_canvas_t* t, const sk_path_t
     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
index 20dc83b..3f7bdc6 100644 (file)
@@ -19,10 +19,8 @@ SK_C_API void sk_colorfilter_unref(sk_colorfilter_t* filter);
 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]);
 
index 4cc0097..f1fa884 100644 (file)
@@ -22,7 +22,6 @@ SK_C_API sk_document_t* sk_document_create_pdf_from_stream_with_metadata(sk_wstr
 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);
index 1f29ef9..731ea7b 100644 (file)
@@ -266,12 +266,6 @@ 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_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);
 
index 6616e0b..1f9ff5a 100644 (file)
@@ -589,10 +589,8 @@ typedef enum {
     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;
index ede65ba..9e5335e 100644 (file)
@@ -46,11 +46,6 @@ void sk_canvas_draw_point(sk_canvas_t* ccanvas, float x, float y, const sk_paint
     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));
@@ -124,12 +119,12 @@ void sk_canvas_clip_path_with_operation(sk_canvas_t* ccanvas, const sk_path_t* c
     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) {
index 53b1691..b7751f3 100644 (file)
@@ -5,11 +5,9 @@
  * found in the LICENSE file.
  */
 
-#include "SkColorCubeFilter.h"
 #include "SkColorMatrixFilter.h"
 #include "SkLumaColorFilter.h"
 #include "SkTableColorFilter.h"
-#include "SkGammaColorFilter.h"
 
 #include "sk_colorfilter.h"
 
@@ -41,14 +39,6 @@ sk_colorfilter_t* sk_colorfilter_new_compose(sk_colorfilter_t* outer, sk_colorfi
     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(
@@ -62,12 +52,6 @@ sk_colorfilter_t* sk_colorfilter_new_luma_color() {
     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);
index 3587a43..25e8047 100644 (file)
@@ -33,10 +33,6 @@ sk_document_t* sk_document_create_xps_from_stream(sk_wstream_t* stream, float dp
    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)));
 }
index db7bda2..49a95fb 100644 (file)
@@ -280,10 +280,8 @@ static_assert ((int)GrPixelConfig::kSRGBA_8888_GrPixelConfig       == (int)SRGBA
 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));
 
index 18a7af8..ef03f7d 100644 (file)
@@ -67,7 +67,7 @@ sk_image_t* sk_image_new_from_picture(sk_picture_t* picture, const sk_isize_t* d
     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) {
index edb54bb..3cbccc6 100644 (file)
@@ -285,22 +285,6 @@ void sk_paint_set_hinting(sk_paint_t* cpaint, sk_paint_hinting_t hintingLevel) {
     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();
 }
index cef86c1..b05a3ee 100644 (file)
@@ -24,12 +24,12 @@ void sk_path_effect_unref(sk_path_effect_t* effect)
 
 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*/)