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

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

Issue 676523003: Offset-only GlyphBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review nit Created 6 years, 1 month 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 | Annotate | Revision Log
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 } 130 }
131 131
132 std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32&, bool mirror, bool normalizeSpace = false, FontDataVariant = AutoVariant) const; 132 std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32&, bool mirror, bool normalizeSpace = false, FontDataVariant = AutoVariant) const;
133 bool primaryFontHasGlyphForCharacter(UChar32) const; 133 bool primaryFontHasGlyphForCharacter(UChar32) const;
134 134
135 CodePath codePath(const TextRunPaintInfo&) const; 135 CodePath codePath(const TextRunPaintInfo&) const;
136 136
137 private: 137 private:
138 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; 138 enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis };
139 139
140 // Returns the initial in-stream advance. 140 // Returns the total advance.
141 float buildGlyphBuffer(const TextRunPaintInfo&, GlyphBuffer&, ForTextEmphasi sOrNot = NotForTextEmphasis) const; 141 float buildGlyphBuffer(const TextRunPaintInfo&, GlyphBuffer&, ForTextEmphasi sOrNot = NotForTextEmphasis) const;
142 PassTextBlobPtr buildTextBlob(const GlyphBuffer&, float initialAdvance, cons t FloatRect& bounds, 142 PassTextBlobPtr buildTextBlob(const GlyphBuffer&, const FloatRect& bounds, b ool couldUseLCD) const;
143 bool couldUseLCD) const;
144 void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, const FloatRect& textRect ) const; 143 void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, const FloatRect& textRect ) const;
145 void drawTextBlob(GraphicsContext*, const SkTextBlob*, const SkPoint& origin ) const; 144 void drawTextBlob(GraphicsContext*, const SkTextBlob*, const SkPoint& origin ) const;
146 float drawGlyphBuffer(GraphicsContext*, const TextRunPaintInfo&, const Glyph Buffer&, const FloatPoint&) const; 145 void drawGlyphBuffer(GraphicsContext*, const TextRunPaintInfo&, const GlyphB uffer&, const FloatPoint&) const;
147 void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const Glyp hBuffer&, const AtomicString&, const FloatPoint&) const; 146 void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const Glyp hBuffer&, const AtomicString&, const FloatPoint&) const;
148 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*> * fallbackFonts = 0, IntRectExtent* glyphBounds = 0) const; 147 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*> * fallbackFonts = 0, IntRectExtent* glyphBounds = 0) const;
149 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl udePartialGlyphs) const; 148 int offsetForPositionForSimpleText(const TextRun&, float position, bool incl udePartialGlyphs) const;
150 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to, bool accountForGlyphBounds) const; 149 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to, bool accountForGlyphBounds) const;
151 150
152 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; 151 bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const;
153 152
154 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData* >* fallbackFonts, IntRectExtent* glyphBounds) const; 153 float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData* >* fallbackFonts, IntRectExtent* glyphBounds) const;
155 int offsetForPositionForComplexText(const TextRun&, float position, bool inc ludePartialGlyphs) const; 154 int offsetForPositionForComplexText(const TextRun&, float position, bool inc ludePartialGlyphs) const;
156 FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int h, int from, int to) const; 155 FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int h, int from, int to) const;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 { 209 {
211 if (!tabSize) 210 if (!tabSize)
212 return fontDescription().letterSpacing(); 211 return fontDescription().letterSpacing();
213 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS pacing(); 212 float tabWidth = tabSize * fontData.spaceWidth() + fontDescription().letterS pacing();
214 return tabWidth - fmodf(position, tabWidth); 213 return tabWidth - fmodf(position, tabWidth);
215 } 214 }
216 215
217 } // namespace blink 216 } // namespace blink
218 217
219 #endif 218 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698