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

Unified Diff: include/utils/SkTextBox.h

Issue 688363003: add textblobs to lua (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add virtual destructor to fix warning Created 6 years, 1 month 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 | « no previous file | resources/slides.lua » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/utils/SkTextBox.h
diff --git a/include/utils/SkTextBox.h b/include/utils/SkTextBox.h
index e217076fed4a8eee43fa9dea698471de3e7f05a8..d4372d1b6ab8f0d07fdb5991f9fc840774413385 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 {
« no previous file with comments | « no previous file | resources/slides.lua » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698