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

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

Issue 567543002: Avoid re-parsing of string in fillText and measureText in Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating code and adding Layout test case Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Holger Hans Peter Freyther 3 * Copyright (C) 2008 Holger Hans Peter Freyther
4 * Copyright (C) 2014 Google Inc. All rights reserved. 4 * Copyright (C) 2014 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 Vector<SVGGlyph::ArabicForm> m_arabicForms; 72 Vector<SVGGlyph::ArabicForm> m_arabicForms;
73 #endif 73 #endif
74 74
75 private: 75 private:
76 struct CharacterData { 76 struct CharacterData {
77 UChar32 character; 77 UChar32 character;
78 unsigned clusterLength; 78 unsigned clusterLength;
79 int characterOffset; 79 int characterOffset;
80 }; 80 };
81 81
82 GlyphData glyphDataForCharacter(CharacterData&); 82 GlyphData glyphDataForCharacter(CharacterData&, bool spaceNormalize = false) ;
eae 2014/09/16 00:46:34 normalizeSpace
h.joshi 2014/09/16 05:48:11 Done.
83 float characterWidth(UChar32, const GlyphData&) const; 83 float characterWidth(UChar32, const GlyphData&) const;
84 void cacheFallbackFont(UChar32, const SimpleFontData*, const SimpleFontData* primaryFont); 84 void cacheFallbackFont(const SimpleFontData*, const SimpleFontData* primaryF ont);
eae 2014/09/16 00:46:34 Why is the character param no longer needed here?
h.joshi 2014/09/16 05:48:11 "glyphDataAndPageForCharacter" method takes care o
85 float adjustSpacing(float, const CharacterData&, const SimpleFontData&, Glyp hBuffer*); 85 float adjustSpacing(float, const CharacterData&, const SimpleFontData&, Glyp hBuffer*);
86 void updateGlyphBounds(const GlyphData&, float width, bool firstCharacter); 86 void updateGlyphBounds(const GlyphData&, float width, bool firstCharacter);
87 87
88 template <typename TextIterator> 88 template <typename TextIterator>
89 unsigned advanceInternal(TextIterator&, GlyphBuffer*); 89 unsigned advanceInternal(TextIterator&, GlyphBuffer*);
90 90
91 HashSet<const SimpleFontData*>* m_fallbackFonts; 91 HashSet<const SimpleFontData*>* m_fallbackFonts;
92 float m_maxGlyphBoundingBoxY; 92 float m_maxGlyphBoundingBoxY;
93 float m_minGlyphBoundingBoxY; 93 float m_minGlyphBoundingBoxY;
94 float m_firstGlyphOverflow; 94 float m_firstGlyphOverflow;
95 float m_lastGlyphOverflow; 95 float m_lastGlyphOverflow;
96 96
97 bool m_accountForGlyphBounds : 1; 97 bool m_accountForGlyphBounds : 1;
98 bool m_forTextEmphasis : 1; 98 bool m_forTextEmphasis : 1;
99 }; 99 };
100 100
101 } // namespace blink 101 } // namespace blink
102 102
103 #endif 103 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698