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

Side by Side Diff: src/text/SkTextLayout.cpp

Issue 222683003: Remove misc. dead code. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 months 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 | « src/core/SkRegion_rects.cpp ('k') | src/utils/SkJSON.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
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 #include "SkTextLayout.h"
9
10 SkTextStyle::SkTextStyle() {
11 fPaint.setAntiAlias(true);
12 }
13
14 SkTextStyle::SkTextStyle(const SkTextStyle& src) : fPaint(src.fPaint) {}
15
16 SkTextStyle::SkTextStyle(const SkPaint& paint) : fPaint(paint) {}
17
18 SkTextStyle::~SkTextStyle() {}
19
20 ///////////////////////////////////////////////////////////////////////////////
21
22 SkTextLayout::SkTextLayout() {
23 fBounds.setEmpty();
24 fDefaultStyle = new SkTextStyle;
25 }
26
27 SkTextLayout::~SkTextLayout() {
28 fDefaultStyle->unref();
29 fLines.deleteAll();
30 }
31
32 void SkTextLayout::setText(const char text[], size_t length) {
33 fText.setCount(length);
34 memcpy(fText.begin(), text, length);
35 }
36
37 void SkTextLayout::setBounds(const SkRect& bounds) {
38 fBounds = bounds;
39 // if width changed, inval cache
40 }
41
42 SkTextStyle* SkTextLayout::setDefaultStyle(SkTextStyle* style) {
43 SkRefCnt_SafeAssign(fDefaultStyle, style);
44 return style;
45 }
46
47 ///////////////////////////////////////////////////////////////////////////////
48
49 struct SkTextLayout::GlyphRun {
50 GlyphRun();
51 ~GlyphRun();
52
53 SkPoint* fLocs;
54 uint16_t* fGlyphIDs;
55 int fCount;
56 };
57
58 SkTextLayout::GlyphRun::GlyphRun() : fLocs(NULL), fGlyphIDs(NULL), fCount(0) {}
59
60 SkTextLayout::GlyphRun::~GlyphRun() {
61 delete[] fLocs;
62 delete[] fGlyphIDs;
63 }
64
65 struct SkTextLayout::Line {
66 Line() {}
67 ~Line();
68
69 SkScalar fBaselineY;
70 SkTDArray<GlyphRun*> fRuns;
71 };
72
73 SkTextLayout::Line::~Line() {
74 fRuns.deleteAll();
75 }
76
77 void SkTextLayout::draw(SkCanvas* canvas) {
78 }
OLDNEW
« no previous file with comments | « src/core/SkRegion_rects.cpp ('k') | src/utils/SkJSON.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698