Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
2 /*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8 #ifndef SkTextLayout_DEFINED
9 #define SkTextLayout_DEFINED
11 #include "SkPaint.h"
12 #include "SkRefCnt.h"
14 class SkTextStyle : public SkRefCnt {
15 public:
16 SK_DECLARE_INST_COUNT(SkTextStyle)
18 SkTextStyle();
19 SkTextStyle(const SkTextStyle&);
20 explicit SkTextStyle(const SkPaint&);
21 virtual ~SkTextStyle();
23 const SkPaint& paint() const { return fPaint; }
24 SkPaint& paint() { return fPaint; }
26 // todo: bidi-override, language
28 private:
29 SkPaint fPaint;
31 typedef SkRefCnt INHERITED;
32 };
34 class SkTextLayout {
35 public:
36 SkTextLayout();
37 ~SkTextLayout();
39 void setText(const char text[], size_t length);
40 void setBounds(const SkRect& bounds);
42 SkTextStyle* getDefaultStyle() const { return fDefaultStyle; }
43 SkTextStyle* setDefaultStyle(SkTextStyle*);
45 // SkTextStyle* setStyle(SkTextStyle*, size_t offset, size_t length);
47 void draw(SkCanvas* canvas);
49 private:
50 SkTDArray<char> fText;
51 SkTextStyle* fDefaultStyle;
52 SkRect fBounds;
54 // cache
55 struct Line;
56 struct GlyphRun;
57 SkTDArray<Line*> fLines;
58 };
60 #endif