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

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

Issue 1314843009: Add DocumentTiming metrics for "time to first text paint" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | « Source/core/timing/PerformanceTiming.cpp ('k') | Source/platform/fonts/Font.cpp » ('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 * 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl udePartialGlyphs) const; 130 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl udePartialGlyphs) const;
131 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to, bool accountForGlyphBounds) const; 131 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to, bool accountForGlyphBounds) const;
132 132
133 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; 133 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const;
134 134
135 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData* >* fallbackFonts, FloatRect* glyphBounds) const; 135 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData* >* fallbackFonts, FloatRect* glyphBounds) const;
136 int offsetForPositionForComplexText(const TextRun&, float position, bool inc ludePartialGlyphs) const; 136 int offsetForPositionForComplexText(const TextRun&, float position, bool inc ludePartialGlyphs) const;
137 FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int h, int from, int to) const; 137 FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int h, int from, int to) const;
138 138
139 bool computeCanShapeWordByWord() const; 139 bool computeCanShapeWordByWord() const;
140 void reportFirstTextPaint() const;
140 141
141 friend struct SimpleShaper; 142 friend struct SimpleShaper;
142 143
143 public: 144 public:
144 FontSelector* fontSelector() const; 145 FontSelector* fontSelector() const;
145 146
146 void willUseFontData(UChar32) const; 147 void willUseFontData(UChar32) const;
147 148
148 bool loadingCustomFonts() const; 149 bool loadingCustomFonts() const;
149 bool isFallbackValid() const; 150 bool isFallbackValid() const;
150 151
151 private: 152 private:
152 bool shouldSkipDrawing() const 153 bool shouldSkipDrawing() const
153 { 154 {
154 return m_fontFallbackList && m_fontFallbackList->shouldSkipDrawing(); 155 return m_fontFallbackList && m_fontFallbackList->shouldSkipDrawing();
155 } 156 }
156 157
157 FontDescription m_fontDescription; 158 FontDescription m_fontDescription;
158 mutable RefPtr<FontFallbackList> m_fontFallbackList; 159 mutable RefPtr<FontFallbackList> m_fontFallbackList;
159 mutable unsigned m_canShapeWordByWord : 1; 160 mutable unsigned m_canShapeWordByWord : 1;
160 mutable unsigned m_shapeWordByWordComputed : 1; 161 mutable unsigned m_shapeWordByWordComputed : 1;
162 mutable unsigned m_firstPaintReported : 1;
161 }; 163 };
162 164
163 inline Font::~Font() 165 inline Font::~Font()
164 { 166 {
165 } 167 }
166 168
167 inline const SimpleFontData* Font::primaryFont() const 169 inline const SimpleFontData* Font::primaryFont() const
168 { 170 {
169 ASSERT(m_fontFallbackList); 171 ASSERT(m_fontFallbackList);
170 return m_fontFallbackList->primarySimpleFontData(m_fontDescription); 172 return m_fontFallbackList->primarySimpleFontData(m_fontDescription);
(...skipping 21 matching lines...) Expand all
192 // if the distance to the next tab stop is less than that, advance an additi onal tab stop. 194 // if the distance to the next tab stop is less than that, advance an additi onal tab stop.
193 if (distanceToTabStop < std::max(fontDescription().letterSpacing(), LayoutUn it::epsilon())) 195 if (distanceToTabStop < std::max(fontDescription().letterSpacing(), LayoutUn it::epsilon()))
194 distanceToTabStop += baseTabWidth; 196 distanceToTabStop += baseTabWidth;
195 197
196 return distanceToTabStop; 198 return distanceToTabStop;
197 } 199 }
198 200
199 } // namespace blink 201 } // namespace blink
200 202
201 #endif 203 #endif
OLDNEW
« no previous file with comments | « Source/core/timing/PerformanceTiming.cpp ('k') | Source/platform/fonts/Font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698