Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: src/core/SkRemote.cpp

Issue 1409273004: SkRemote: simple impl of onDraw*Text* (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase && add comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRemote.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRemote.cpp
diff --git a/src/core/SkRemote.cpp b/src/core/SkRemote.cpp
index 4f2714fa24f9fcf231f77ba72e1ca23310eb7762..23f374171127aa86a1185395e334ae24129d9ab8 100644
--- a/src/core/SkRemote.cpp
+++ b/src/core/SkRemote.cpp
@@ -233,6 +233,35 @@ namespace SkRemote {
this->onDrawRect(SkRect::MakeLargest(), paint);
}
+ void Client::onDrawText(const void* text, size_t byteLength, SkScalar x,
+ SkScalar y, const SkPaint& paint) {
+ // Text-as-paths is a temporary hack.
+ // TODO: send SkTextBlobs and SkTypefaces
+ SkPath path;
+ paint.getTextPath(text, byteLength, x, y, &path);
+ this->onDrawPath(path, paint);
+ }
+
+ void Client::onDrawPosText(const void* text, size_t byteLength,
+ const SkPoint pos[], const SkPaint& paint) {
+ // Text-as-paths is a temporary hack.
+ // TODO: send SkTextBlobs and SkTypefaces
+ SkPath path;
+ paint.getPosTextPath(text, byteLength, pos, &path);
+ this->onDrawPath(path, paint);
+ }
+
+ void Client::onDrawPosTextH(const void* text, size_t byteLength,
+ const SkScalar xpos[], SkScalar constY,
+ const SkPaint& paint) {
+ size_t length = paint.countText(text, byteLength);
+ SkAutoTArray<SkPoint> pos(length);
+ for(size_t i = 0; i < length; ++i) {
+ pos[i].set(xpos[i], constY);
+ }
+ this->onDrawPosText(text, byteLength, &pos[0], paint);
+ }
+
void Client::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
SkPath path;
path.addRect(rect);
« no previous file with comments | « src/core/SkRemote.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698