From: Matthew Leibowitz Date: Sat, 20 Aug 2016 09:10:38 +0000 (+0200) Subject: Added a few more members to SKPaint X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c78a3f640ba324ac0fc8609f3e7870dd7dae202;p=platform%2Fupstream%2FlibSkiaSharp.git Added a few more members to SKPaint --- diff --git a/include/c/sk_paint.h b/include/c/sk_paint.h index d2dc8f6..6f5a99e 100644 --- a/include/c/sk_paint.h +++ b/include/c/sk_paint.h @@ -247,6 +247,36 @@ SK_API sk_path_effect_t* sk_paint_get_path_effect(sk_paint_t* cpaint); */ SK_API void sk_paint_set_path_effect(sk_paint_t* cpaint, sk_path_effect_t* effect); +SK_API bool sk_paint_is_linear_text(const sk_paint_t*); +SK_API void sk_paint_set_linear_text(sk_paint_t*, bool); + +SK_API bool sk_paint_is_subpixel_text(const sk_paint_t*); +SK_API void sk_paint_set_subpixel_text(sk_paint_t*, bool); + +SK_API bool sk_paint_is_lcd_render_text(const sk_paint_t*); +SK_API void sk_paint_set_lcd_render_text(sk_paint_t*, bool); + +SK_API bool sk_paint_is_embedded_bitmap_text(const sk_paint_t*); +SK_API void sk_paint_set_embedded_bitmap_text(sk_paint_t*, bool); + +SK_API sk_paint_hinting_t sk_paint_get_hinting(const sk_paint_t*); +SK_API void sk_paint_set_hinting(sk_paint_t*, sk_paint_hinting_t); + +SK_API bool sk_paint_is_autohinted(const sk_paint_t*); +SK_API void sk_paint_set_autohinted(sk_paint_t*, bool); + +SK_API bool sk_paint_is_underline_text(const sk_paint_t*); +SK_API void sk_paint_set_underline_text(sk_paint_t*, bool); + +SK_API bool sk_paint_is_strikethru_text(const sk_paint_t*); +SK_API void sk_paint_set_strikethru_text(sk_paint_t*, bool); + +SK_API bool sk_paint_is_fake_bold_text(const sk_paint_t*); +SK_API void sk_paint_set_fake_bold_text(sk_paint_t*, bool); + +SK_API bool sk_paint_is_dev_kern_text(const sk_paint_t*); +SK_API void sk_paint_set_dev_kern_text(sk_paint_t*, bool); + SK_C_PLUS_PLUS_END_GUARD #endif diff --git a/include/c/sk_types.h b/include/c/sk_types.h index 3db095a..0e0f992 100644 --- a/include/c/sk_types.h +++ b/include/c/sk_types.h @@ -508,6 +508,13 @@ typedef enum { STROKE_AND_FILL_SK_PAINT_STYLE, } sk_paint_style_t; +typedef enum { + NO_HINTING_SK_PAINT_HINTING, + SLIGHT_HINTING_SK_PAINT_HINTING, + NORMAL_HINTING_SK_PAINT_HINTING, + FULL_HINTING_SK_PAINT_HINTING, +} sk_paint_hinting_t; + typedef struct sk_colortable_t sk_colortable_t; typedef struct sk_pixelref_factory_t sk_pixelref_factory_t; diff --git a/src/c/sk_enums.cpp b/src/c/sk_enums.cpp index 87b9e0e..9ecd342 100644 --- a/src/c/sk_enums.cpp +++ b/src/c/sk_enums.cpp @@ -242,6 +242,12 @@ static_assert ((int)SkPaint::Style::kFill_Style == (int)FILL_SK_PAINT static_assert ((int)SkPaint::Style::kStrokeAndFill_Style == (int)STROKE_AND_FILL_SK_PAINT_STYLE, ASSERT_MSG(SkPaint::Style, sk_paint_style_t)); static_assert ((int)SkPaint::Style::kStroke_Style == (int)STROKE_SK_PAINT_STYLE, ASSERT_MSG(SkPaint::Style, sk_paint_style_t)); +// sk_path_effect_1d_style_t +static_assert ((int)SkPaint::Hinting::kNo_Hinting == (int)NO_HINTING_SK_PAINT_HINTING, ASSERT_MSG(SkPaint::Hinting, sk_paint_style_t)); +static_assert ((int)SkPaint::Hinting::kSlight_Hinting == (int)SLIGHT_HINTING_SK_PAINT_HINTING, ASSERT_MSG(SkPaint::Hinting, sk_paint_style_t)); +static_assert ((int)SkPaint::Hinting::kNormal_Hinting == (int)NORMAL_HINTING_SK_PAINT_HINTING, ASSERT_MSG(SkPaint::Hinting, sk_paint_style_t)); +static_assert ((int)SkPaint::Hinting::kFull_Hinting == (int)FULL_HINTING_SK_PAINT_HINTING, ASSERT_MSG(SkPaint::Hinting, sk_paint_style_t)); + // sk_point_mode_t static_assert ((int)SkCanvas::PointMode::kPoints_PointMode == (int)POINTS_SK_POINT_MODE, ASSERT_MSG(SkCanvas::PointMode, sk_point_mode_t)); static_assert ((int)SkCanvas::PointMode::kLines_PointMode == (int)LINES_SK_POINT_MODE, ASSERT_MSG(SkCanvas::PointMode, sk_point_mode_t)); diff --git a/src/c/sk_paint.cpp b/src/c/sk_paint.cpp index 0be64b9..763feec 100644 --- a/src/c/sk_paint.cpp +++ b/src/c/sk_paint.cpp @@ -236,3 +236,83 @@ sk_path_effect_t* sk_paint_get_path_effect(sk_paint_t* cpaint) { void sk_paint_set_path_effect(sk_paint_t* cpaint, sk_path_effect_t* effect) { AsPaint(cpaint)->setPathEffect(sk_ref_sp(AsPathEffect(effect))); } + +bool sk_paint_is_linear_text(const sk_paint_t* cpaint) { + return AsPaint(cpaint)->isLinearText(); +} + +void sk_paint_set_linear_text(sk_paint_t* cpaint, bool linearText) { + AsPaint(cpaint)->setLinearText(linearText); +} + +bool sk_paint_is_subpixel_text(const sk_paint_t* cpaint) { + return AsPaint(cpaint)->isSubpixelText(); +} + +void sk_paint_set_subpixel_text(sk_paint_t* cpaint, bool subpixelText) { + AsPaint(cpaint)->setSubpixelText(subpixelText); +} + +bool sk_paint_is_lcd_render_text(const sk_paint_t* cpaint) { + return AsPaint(cpaint)->isLCDRenderText(); +} + +void sk_paint_set_lcd_render_text(sk_paint_t* cpaint, bool lcdText) { + AsPaint(cpaint)->setLCDRenderText(lcdText); +} + +bool sk_paint_is_embedded_bitmap_text(const sk_paint_t* cpaint) { + return AsPaint(cpaint)->isEmbeddedBitmapText(); +} + +void sk_paint_set_embedded_bitmap_text(sk_paint_t* cpaint, bool useEmbeddedBitmapText) { + AsPaint(cpaint)->setEmbeddedBitmapText(useEmbeddedBitmapText); +} + +bool sk_paint_is_autohinted(const sk_paint_t* cpaint) { + return AsPaint(cpaint)->isAutohinted(); +} + +void sk_paint_set_autohinted(sk_paint_t* cpaint, bool useAutohinter) { + AsPaint(cpaint)->setAutohinted(useAutohinter); +} + +sk_paint_hinting_t sk_paint_get_hinting(const sk_paint_t* cpaint) { + return (sk_paint_hinting_t) AsPaint(cpaint)->getHinting(); +} + +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(); +} + +void sk_paint_set_fake_bold_text(sk_paint_t* cpaint, bool fakeBoldText) { + AsPaint(cpaint)->setFakeBoldText(fakeBoldText); +} + +bool sk_paint_is_dev_kern_text(const sk_paint_t* cpaint) { + return AsPaint(cpaint)->isDevKernText(); +} + +void sk_paint_set_dev_kern_text(sk_paint_t* cpaint, bool devKernText) { + AsPaint(cpaint)->setDevKernText(devKernText); +}