aboutsummaryrefslogtreecommitdiffstats
path: root/include/core
diff options
context:
space:
mode:
authorAndreas Borglin <andreas.borglin@sonyericsson.com>2010-04-26 12:00:42 +0200
committerJohan Redestig <johan.redestig@sonyericsson.com>2010-04-26 12:02:58 +0200
commita2dfb00239c367c3663e8487a8213d0edad238ba (patch)
treea1aec82867d8df102c2b11705050d1689e9ace25 /include/core
parent2a95157fbba1f9645888ba260175926f41c310bf (diff)
downloadexternal_skia-a2dfb00239c367c3663e8487a8213d0edad238ba.zip
external_skia-a2dfb00239c367c3663e8487a8213d0edad238ba.tar.gz
external_skia-a2dfb00239c367c3663e8487a8213d0edad238ba.tar.bz2
Added drawPosTextOnPath method.
The drawPosTextOnPath method allows for text positioned on a straight line to be drawn along a path. This method can be used by layout engines to implement the Canvas::drawTextOnPath method for complex scripts. Change-Id: I2f9c22b8c97eeacb61cd6de7429ba875a1e7ade9
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkCanvas.h13
-rw-r--r--include/core/SkDevice.h3
-rw-r--r--include/core/SkDraw.h3
3 files changed, 19 insertions, 0 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 8fba6cf..f88a8b9 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -581,6 +581,19 @@ public:
const SkPath& path, const SkMatrix* matrix,
const SkPaint& paint);
+ /** Draw the text on path, 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
+ @param byteLength The number of bytes to read from the text parameter
+ @param pos Array of positions, used to position each character
+ @param paint The paint used for the text (e.g. color, size, style)
+ @param path The path to draw on
+ @param matrix The canvas matrix
+ */
+ void drawPosTextOnPath(const void* text, size_t byteLength,
+ const SkPoint pos[], const SkPaint& paint,
+ const SkPath& path, const SkMatrix* matrix);
+
/** Draw the picture into this canvas. This method effective brackets the
playback of the picture's draw calls with save/restore, so the state
of this canvas will be unchanged after this call. This contrasts with
diff --git a/include/core/SkDevice.h b/include/core/SkDevice.h
index 4d678c6..0d724ba 100644
--- a/include/core/SkDevice.h
+++ b/include/core/SkDevice.h
@@ -120,6 +120,9 @@ public:
virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len,
const SkPath& path, const SkMatrix* matrix,
const SkPaint& paint);
+ virtual void drawPosTextOnPath(const SkDraw& draw, const void* text, size_t len,
+ const SkPoint pos[], const SkPaint& paint,
+ const SkPath& path, const SkMatrix* matrix);
virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, int vertexCount,
const SkPoint verts[], const SkPoint texs[],
const SkColor colors[], SkXfermode* xmode,
diff --git a/include/core/SkDraw.h b/include/core/SkDraw.h
index 8214859..a86ef67 100644
--- a/include/core/SkDraw.h
+++ b/include/core/SkDraw.h
@@ -54,6 +54,9 @@ public:
int scalarsPerPosition, const SkPaint& paint) const;
void drawTextOnPath(const char text[], size_t byteLength,
const SkPath&, const SkMatrix*, const SkPaint&) const;
+ void drawPosTextOnPath(const char text[], size_t byteLength,
+ const SkPoint pos[], const SkPaint& paint,
+ const SkPath& path, const SkMatrix* matrix) const;
void drawVertices(SkCanvas::VertexMode mode, int count,
const SkPoint vertices[], const SkPoint textures[],
const SkColor colors[], SkXfermode* xmode,