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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | resources/slides.lua » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkTextBox_DEFINED 10 #ifndef SkTextBox_DEFINED
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void getSpacing(SkScalar* mul, SkScalar* add) const; 53 void getSpacing(SkScalar* mul, SkScalar* add) const;
54 void setSpacing(SkScalar mul, SkScalar add); 54 void setSpacing(SkScalar mul, SkScalar add);
55 55
56 void draw(SkCanvas*, const char text[], size_t len, const SkPaint&); 56 void draw(SkCanvas*, const char text[], size_t len, const SkPaint&);
57 57
58 void setText(const char text[], size_t len, const SkPaint&); 58 void setText(const char text[], size_t len, const SkPaint&);
59 void draw(SkCanvas*); 59 void draw(SkCanvas*);
60 int countLines() const; 60 int countLines() const;
61 SkScalar getTextHeight() const; 61 SkScalar getTextHeight() const;
62 62
63 SkTextBlob* snapshotTextBlob(SkScalar* computedBottom) const;
64
65 class Visitor {
66 public:
67 virtual ~Visitor() {}
68 virtual void operator()(const char*, size_t, SkScalar x, SkScalar y, con st SkPaint&) = 0;
69 };
70
63 private: 71 private:
64 SkRect fBox; 72 SkRect fBox;
65 SkScalar fSpacingMul, fSpacingAdd; 73 SkScalar fSpacingMul, fSpacingAdd;
66 uint8_t fMode, fSpacingAlign; 74 uint8_t fMode, fSpacingAlign;
67 const char* fText; 75 const char* fText;
68 size_t fLen; 76 size_t fLen;
69 const SkPaint* fPaint; 77 const SkPaint* fPaint;
78
79 SkScalar visit(Visitor&, const char text[], size_t len, const SkPaint&) cons t;
70 }; 80 };
71 81
72 class SkTextLineBreaker { 82 class SkTextLineBreaker {
73 public: 83 public:
74 static int CountLines(const char text[], size_t len, const SkPaint&, SkScala r width); 84 static int CountLines(const char text[], size_t len, const SkPaint&, SkScala r width);
75 }; 85 };
76 86
77 #endif 87 #endif
OLDNEW
« 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