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

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: 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 ae14a47d187b4b28d2b1acfd8913d57638de60ef..7b77ee656a90529770aef91e0b6d37df9ef0abd4 100644
--- a/src/core/SkRemote.cpp
+++ b/src/core/SkRemote.cpp
@@ -207,6 +207,31 @@ namespace SkRemote {
}
}
mtklein 2015/10/17 12:57:45 //Text-as-paths is a temporary hack. //TODO: send
hal.canary 2015/10/17 22:37:08 Done.
+ void Client::onDrawText(const void* text, size_t byteLength, SkScalar x,
+ SkScalar y, const SkPaint& paint) {
+ 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) {
+ 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