From: Matthew Leibowitz Date: Thu, 12 May 2016 14:44:05 +0000 (+0200) Subject: Removed the UTF16/Unicode functions X-Git-Tag: submit/tizen/20180928.044319~162 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7d5e0f11ad1ae8ac34d615b7e275ca1f40a2be5;p=platform%2Fupstream%2FlibSkiaSharp.git Removed the UTF16/Unicode functions - this is done in the managed code now - removes the need to change the paint instance --- diff --git a/include/c/xamarin/sk_x_paint.h b/include/c/xamarin/sk_x_paint.h index 971e2a522d..83948c531f 100644 --- a/include/c/xamarin/sk_x_paint.h +++ b/include/c/xamarin/sk_x_paint.h @@ -98,34 +98,18 @@ SK_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_API size_t sk_paint_break_text(const sk_paint_t* cpaint, const void* text, size_t length, float maxWidth, float* measuredWidth); -/** - * Return the number of bytes of text that were measured - */ -SK_API size_t sk_paint_break_utf16_text(const sk_paint_t* cpaint, const void* text, size_t length, float maxWidth, float* measuredWidth); /** * Return the width of the text */ SK_API float sk_paint_measure_text(const sk_paint_t* cpaint, const void* text, size_t length, sk_rect_t* cbounds); -/** - * Return the width of the UTF16 encoded text - */ -SK_API float sk_paint_measure_utf16_text(sk_paint_t* cpaint, const void* text, size_t length, sk_rect_t* cbounds); /** * Get the path outline of text. */ SK_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. - */ -SK_API sk_path_t* sk_paint_get_utf16_text_path(sk_paint_t* cpaint, const uint16_t *text, size_t lengthInChars, float x, float y); /** * Get the path outline of text with each glyph positioned. */ SK_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[]); -/** - * Get the path outline of text with each glyph positioned. - */ -SK_API sk_path_t* sk_paint_get_pos_utf16_text_path(sk_paint_t* cpaint, const uint16_t *text, size_t lengthInChars, 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. diff --git a/src/c/xamarin/sk_x_paint.cpp b/src/c/xamarin/sk_x_paint.cpp index 6f699cf615..e1e96471bd 100644 --- a/src/c/xamarin/sk_x_paint.cpp +++ b/src/c/xamarin/sk_x_paint.cpp @@ -160,92 +160,22 @@ size_t sk_paint_break_text(const sk_paint_t* cpaint, const void* text, size_t le return AsPaint(cpaint)->breakText(text, length, maxWidth, measuredWidth); } -size_t sk_paint_break_utf16_text(sk_paint_t* cpaint, const void* text, size_t length, float maxWidth, float* measuredWidth) { - SkPaint *paint = AsPaint(cpaint); - auto encoding = paint->getTextEncoding (); - int changed = 0; - if (encoding != SkPaint::kUTF16_TextEncoding){ - changed = 1; - paint->setTextEncoding(SkPaint::kUTF16_TextEncoding); - } - auto ret = paint->breakText(text, length * sizeof(uint16_t), maxWidth, measuredWidth); - if (changed != 0){ - paint->setTextEncoding(encoding); - } - return ret; -} - float sk_paint_measure_text(const sk_paint_t* cpaint, const void* text, size_t length, sk_rect_t* bounds) { return AsPaint(cpaint)->measureText(text, length, AsRect(bounds)); } -float sk_paint_measure_utf16_text(sk_paint_t* cpaint, const void* text, size_t length, sk_rect_t* bounds) { - SkPaint* paint = AsPaint(cpaint); - auto encoding = paint->getTextEncoding (); - int changed = 0; - if (encoding != SkPaint::kUTF16_TextEncoding){ - changed = 1; - paint->setTextEncoding(SkPaint::kUTF16_TextEncoding); - } - auto ret = paint->measureText(text, length * sizeof(uint16_t), AsRect(bounds)); - if (changed != 0){ - paint->setTextEncoding(encoding); - } - return ret; -} - sk_path_t* sk_paint_get_text_path(sk_paint_t* cpaint, const void* text, size_t length, float x, float y) { SkPath* path = new SkPath(); AsPaint(cpaint)->getTextPath(text, length, x, y, path); return ToPath(path); } -sk_path_t* sk_paint_get_utf16_text_path(sk_paint_t* cpaint, const uint16_t *text, size_t lengthInChars, float x, float y) { - SkPaint* paint = AsPaint(cpaint); - SkPath* path = new SkPath(); - - auto encoding = paint->getTextEncoding(); - int changed = 0; - if (encoding != SkPaint::kUTF16_TextEncoding) { - changed = 1; - paint->setTextEncoding(SkPaint::kUTF16_TextEncoding); - } - - AsPaint(cpaint)->getTextPath(text, lengthInChars * sizeof(uint16_t), x, y, path); - - if (changed != 0) { - paint->setTextEncoding(encoding); - } - - return ToPath(path); -} - sk_path_t* sk_paint_get_pos_text_path(sk_paint_t* cpaint, const void* text, size_t length, const sk_point_t pos[]) { SkPath* path = new SkPath(); AsPaint(cpaint)->getPosTextPath(text, length, reinterpret_cast(pos), path); return ToPath(path); } -sk_path_t* sk_paint_get_pos_utf16_text_path(sk_paint_t* cpaint, const uint16_t *text, size_t lengthInChars, const sk_point_t pos[]) { - SkPaint* paint = AsPaint(cpaint); - SkPath* path = new SkPath(); - - auto encoding = paint->getTextEncoding(); - int changed = 0; - if (encoding != SkPaint::kUTF16_TextEncoding) { - changed = 1; - paint->setTextEncoding(SkPaint::kUTF16_TextEncoding); - } - - AsPaint(cpaint)->getPosTextPath(text, lengthInChars * sizeof(uint16_t), reinterpret_cast(pos), path); - - if (changed != 0) { - paint->setTextEncoding(encoding); - } - - return ToPath(path); -} - float sk_paint_get_fontmetrics(sk_paint_t* cpaint, sk_fontmetrics_t* cfontmetrics, float scale) { SkPaint *paint = AsPaint(cpaint);