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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/Font.h

Issue 2845883002: [LayoutNG] Add NG-specific DrawText support to GraphicsContext (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) 2008 Holger Hans Peter Freyther 6 * Copyright (C) 2008 Holger Hans Peter Freyther
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 class FontData; 53 class FontData;
54 class FontSelector; 54 class FontSelector;
55 class ShapeCache; 55 class ShapeCache;
56 class TextRun; 56 class TextRun;
57 struct TextRunPaintInfo; 57 struct TextRunPaintInfo;
58 58
59 // Represents text content of a NGPhysicalTextFragment for painting. 59 // Represents text content of a NGPhysicalTextFragment for painting.
60 // TODO(eae): Move to a separate file? 60 // TODO(eae): Move to a separate file?
61 struct PLATFORM_EXPORT TextFragmentPaintInfo { 61 struct PLATFORM_EXPORT TextFragmentPaintInfo {
62 const StringView text; 62 const StringView text;
63 TextDirection direction;
63 unsigned from; 64 unsigned from;
64 unsigned to; 65 unsigned to;
65 const ShapeResult* shape_result; 66 const ShapeResult* shape_result;
66 }; 67 };
67 68
68 class PLATFORM_EXPORT Font { 69 class PLATFORM_EXPORT Font {
69 DISALLOW_NEW(); 70 DISALLOW_NEW();
70 71
71 public: 72 public:
72 Font(); 73 Font();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 const FloatPoint&, 105 const FloatPoint&,
105 CustomFontNotReadyAction, 106 CustomFontNotReadyAction,
106 float device_scale_factor, 107 float device_scale_factor,
107 const PaintFlags&) const; 108 const PaintFlags&) const;
108 void DrawEmphasisMarks(PaintCanvas*, 109 void DrawEmphasisMarks(PaintCanvas*,
109 const TextRunPaintInfo&, 110 const TextRunPaintInfo&,
110 const AtomicString& mark, 111 const AtomicString& mark,
111 const FloatPoint&, 112 const FloatPoint&,
112 float device_scale_factor, 113 float device_scale_factor,
113 const PaintFlags&) const; 114 const PaintFlags&) const;
115 void DrawEmphasisMarks(PaintCanvas*,
116 const TextFragmentPaintInfo&,
117 const AtomicString& mark,
118 const FloatPoint&,
119 float device_scale_factor,
120 const PaintFlags&) const;
114 121
115 struct TextIntercept { 122 struct TextIntercept {
116 float begin_, end_; 123 float begin_, end_;
117 }; 124 };
118 125
119 // Compute the text intercepts along the axis of the advance and write them 126 // Compute the text intercepts along the axis of the advance and write them
120 // into the specified Vector of TextIntercepts. The number of those is zero or 127 // into the specified Vector of TextIntercepts. The number of those is zero or
121 // a multiple of two, and is at most the number of glyphs * 2 in the TextRun 128 // a multiple of two, and is at most the number of glyphs * 2 in the TextRun
122 // part of TextRunPaintInfo. Specify bounds for the upper and lower extend of 129 // part of TextRunPaintInfo. Specify bounds for the upper and lower extend of
123 // a line crossing through the text, parallel to the baseline. 130 // a line crossing through the text, parallel to the baseline.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // advance an additional tab stop. 254 // advance an additional tab stop.
248 if (distance_to_tab_stop < font_data->SpaceWidth() / 2) 255 if (distance_to_tab_stop < font_data->SpaceWidth() / 2)
249 distance_to_tab_stop += base_tab_width; 256 distance_to_tab_stop += base_tab_width;
250 257
251 return distance_to_tab_stop; 258 return distance_to_tab_stop;
252 } 259 }
253 260
254 } // namespace blink 261 } // namespace blink
255 262
256 #endif 263 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698