Changeset 131410 in webkit
- Timestamp:
- Oct 15, 2012, 10:07:56 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r131408 r131410 1 2012-10-15 Dan Bernstein <mitz@apple.com> 2 3 REGRESSION (r131365): WidthIterator::advance() is needlessly passed a GlyphBuffer in many cases 4 https://bugs.webkit.org/show_bug.cgi?id=99413 5 6 Reviewed by Adele Peterson. 7 8 r131365 made Font::width() always pass a GlyphBuffer pointer to floatWidthForSimpleText and 9 from there down to WidthIterator::advance(). However, when measuring the width of a run, a 10 GlyphBuffer is only needed if font transforms (kerning and ligatures) need to be applied. 11 12 No new test, because there is no change in behavior. 13 14 * platform/graphics/Font.cpp: 15 (WebCore::Font::width): Removed the local GlyphBuffer that was passed down to 16 floatWidthForSimpleText(). 17 * platform/graphics/Font.h: Removed the GlyphBuffer* parameter to floatWidthForSimpleText. 18 All but the above caller were passing 0. 19 * platform/graphics/FontFastPath.cpp: 20 (WebCore::Font::floatWidthForSimpleText): Removed the GlyphBuffer* parameter and added a 21 local GlyphBuffer, which is passed by reference to WidthIterator::advance() only if 22 typesetting features require it. 23 (WebCore::Font::offsetForPositionForSimpleText): Updated for change to 24 floatWidthForSimpleText. 25 * platform/graphics/pango/FontPango.cpp: 26 (WebCore::Font::floatWidthForComplexText): Ditto. 27 1 28 2012-10-15 Pablo Flouret <pablof@motorola.com> 2 29 -
trunk/Source/WebCore/platform/graphics/Font.cpp
r131365 r131410 188 188 // returning them for simple text as well. 189 189 static bool returnFallbackFonts = canReturnFallbackFontsForComplexText(); 190 GlyphBuffer glyphBuffer; 191 return floatWidthForSimpleText(run, &glyphBuffer, returnFallbackFonts ? fallbackFonts : 0, codePathToUse == SimpleWithGlyphOverflow || (glyphOverflow && glyphOverflow->computeBounds) ? glyphOverflow : 0); 190 return floatWidthForSimpleText(run, returnFallbackFonts ? fallbackFonts : 0, codePathToUse == SimpleWithGlyphOverflow || (glyphOverflow && glyphOverflow->computeBounds) ? glyphOverflow : 0); 192 191 } 193 192 … … 206 205 207 206 if (codePath(run) != Complex) 208 return floatWidthForSimpleText(run , 0);207 return floatWidthForSimpleText(run); 209 208 210 209 return floatWidthForComplexText(run); -
trunk/Source/WebCore/platform/graphics/Font.h
r131311 r131410 224 224 void drawGlyphBuffer(GraphicsContext*, const TextRun&, const GlyphBuffer&, const FloatPoint&) const; 225 225 void drawEmphasisMarks(GraphicsContext*, const TextRun&, const GlyphBuffer&, const AtomicString&, const FloatPoint&) const; 226 float floatWidthForSimpleText(const TextRun&, GlyphBuffer*,HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;226 float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const; 227 227 int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const; 228 228 FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to) const; -
trunk/Source/WebCore/platform/graphics/FontFastPath.cpp
r131365 r131410 470 470 } 471 471 472 float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer,HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const472 float Font::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const 473 473 { 474 474 WidthIterator it(this, run, fallbackFonts, glyphOverflow); 475 it.advance(run.length(), glyphBuffer); 475 GlyphBuffer glyphBuffer; 476 it.advance(run.length(), (typesettingFeatures() & (Kerning | Ligatures)) ? &glyphBuffer : 0); 476 477 477 478 if (glyphOverflow) { … … 512 513 unsigned offset; 513 514 if (run.rtl()) { 514 delta -= floatWidthForSimpleText(run , 0);515 delta -= floatWidthForSimpleText(run); 515 516 while (1) { 516 517 offset = it.m_currentCharacter; -
trunk/Source/WebCore/platform/graphics/pango/FontPango.cpp
r127801 r131410 372 372 #if USE(FREETYPE) 373 373 if (!primaryFont()->platformData().m_pattern) 374 return floatWidthForSimpleText(run, 0,fallbackFonts, overflow);374 return floatWidthForSimpleText(run, fallbackFonts, overflow); 375 375 #endif 376 376
Note:
See TracChangeset
for help on using the changeset viewer.