diff options
author | reed <reed@google.com> | 2014-11-03 19:55:41 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-03 19:55:41 -0800 |
commit | 1b6ab4417e0edef3b91d150e6650205f49f04d17 (patch) | |
tree | 7fb6766b5c39ddc3464d577f0bb3dfdbe53ab638 /include | |
parent | 2f5cb2fb955234f891655b420187597617e5ab3a (diff) |
add textblobs to lua
BUG=skia:
TBR=
Review URL: https://codereview.chromium.org/688363003
Diffstat (limited to 'include')
-rw-r--r-- | include/utils/SkTextBox.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/utils/SkTextBox.h b/include/utils/SkTextBox.h index e217076fed..d4372d1b6a 100644 --- a/include/utils/SkTextBox.h +++ b/include/utils/SkTextBox.h @@ -60,6 +60,14 @@ public: int countLines() const; SkScalar getTextHeight() const; + SkTextBlob* snapshotTextBlob(SkScalar* computedBottom) const; + + class Visitor { + public: + virtual ~Visitor() {} + virtual void operator()(const char*, size_t, SkScalar x, SkScalar y, const SkPaint&) = 0; + }; + private: SkRect fBox; SkScalar fSpacingMul, fSpacingAdd; @@ -67,6 +75,8 @@ private: const char* fText; size_t fLen; const SkPaint* fPaint; + + SkScalar visit(Visitor&, const char text[], size_t len, const SkPaint&) const; }; class SkTextLineBreaker { |