aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-11-03 19:55:41 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-03 19:55:41 -0800
commit1b6ab4417e0edef3b91d150e6650205f49f04d17 (patch)
tree7fb6766b5c39ddc3464d577f0bb3dfdbe53ab638 /include
parent2f5cb2fb955234f891655b420187597617e5ab3a (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.h10
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 {