aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkCanvas.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r--include/core/SkCanvas.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 33a51f7755..7b6ef7de68 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -950,6 +950,29 @@ public:
void drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y,
const SkPaint& paint);
+ /** Draw null-terminated UTF-8 string, with origin at (x,y), using the specified paint.
+ The origin is interpreted based on the Align setting in the paint.
+ @param string The null-terminated string to be drawn
+ @param x The x-coordinate of the origin of the string being drawn
+ @param y The y-coordinate of the origin of the string being drawn
+ @param paint The paint used for the string (e.g. color, size, style)
+ */
+ void drawString(const char* string, SkScalar x, SkScalar y, const SkPaint& paint) {
+ if (!string) {
+ return;
+ }
+ this->drawText(string, strlen(string), x, y, paint);
+ }
+
+ /** Draw string, with origin at (x,y), using the specified paint.
+ The origin is interpreted based on the Align setting in the paint.
+ @param string The string to be drawn
+ @param x The x-coordinate of the origin of the string being drawn
+ @param y The y-coordinate of the origin of the string being drawn
+ @param paint The paint used for the string (e.g. color, size, style)
+ */
+ void drawString(const SkString& string, SkScalar x, SkScalar y, const SkPaint& paint);
+
/** Draw the text, with each character/glyph origin specified by the pos[]
array. The origin is interpreted by the Align setting in the paint.
@param text The text to be drawn