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

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

Issue 1525963002: (CANCELED) Improve performance of large option list with CJK text (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to PS2 Created 5 years 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void update(PassRefPtrWillBeRawPtr<FontSelector>) const; 77 void update(PassRefPtrWillBeRawPtr<FontSelector>) const;
78 78
79 enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontN otReady }; 79 enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontN otReady };
80 bool drawText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, float d eviceScaleFactor, const SkPaint&) const; 80 bool drawText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, float d eviceScaleFactor, const SkPaint&) const;
81 bool drawBidiText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, Cus tomFontNotReadyAction, float deviceScaleFactor, const SkPaint&) const; 81 bool drawBidiText(SkCanvas*, const TextRunPaintInfo&, const FloatPoint&, Cus tomFontNotReadyAction, float deviceScaleFactor, const SkPaint&) const;
82 void drawEmphasisMarks(SkCanvas*, const TextRunPaintInfo&, const AtomicStrin g& mark, const FloatPoint&, float deviceScaleFactor, const SkPaint&) const; 82 void drawEmphasisMarks(SkCanvas*, const TextRunPaintInfo&, const AtomicStrin g& mark, const FloatPoint&, float deviceScaleFactor, const SkPaint&) const;
83 83
84 // Glyph bounds will be the minimum rect containing all glyph strokes, in co ordinates using 84 // Glyph bounds will be the minimum rect containing all glyph strokes, in co ordinates using
85 // (<text run x position>, <baseline position>) as the origin. 85 // (<text run x position>, <baseline position>) as the origin.
86 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* glyphBounds = nullptr) const; 86 float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* glyphBounds = nullptr) const;
87 float widthForUnbrokenRun(const TextRun&) const;
drott 2015/12/16 13:17:39 This method and its implementation, i.e. new split
87 88
88 int offsetForPosition(const TextRun&, float position, bool includePartialGly phs) const; 89 int offsetForPosition(const TextRun&, float position, bool includePartialGly phs) const;
89 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1, bool accountForGlyphBounds = false) const; 90 FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1, bool accountForGlyphBounds = false) const;
90 91
91 // Metrics that we query the FontFallbackList for. 92 // Metrics that we query the FontFallbackList for.
92 const FontMetrics& fontMetrics() const 93 const FontMetrics& fontMetrics() const
93 { 94 {
94 RELEASE_ASSERT(primaryFont()); 95 RELEASE_ASSERT(primaryFont());
95 return primaryFont()->fontMetrics(); 96 return primaryFont()->fontMetrics();
96 } 97 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // if the distance to the next tab stop is less than that, advance an additi onal tab stop. 204 // if the distance to the next tab stop is less than that, advance an additi onal tab stop.
204 if (distanceToTabStop < std::max(fontDescription().letterSpacing(), LayoutUn it::epsilon())) 205 if (distanceToTabStop < std::max(fontDescription().letterSpacing(), LayoutUn it::epsilon()))
205 distanceToTabStop += baseTabWidth; 206 distanceToTabStop += baseTabWidth;
206 207
207 return distanceToTabStop; 208 return distanceToTabStop;
208 } 209 }
209 210
210 } // namespace blink 211 } // namespace blink
211 212
212 #endif 213 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMenuList.cpp ('k') | third_party/WebKit/Source/platform/fonts/Font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698