REGRESSION (r131365): WidthIterator::advance() is needlessly passed a GlyphBuffer...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2012 05:07:56 +0000 (05:07 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2012 05:07:56 +0000 (05:07 +0000)
commit9f4c77a00d0c46a923bf22578925d73fa4003478
treec3906e405313f06ab626716270a563bbb1c2e234
parent97ada492e2a62aefddb650c1e0a55435eccd5d6b
REGRESSION (r131365): WidthIterator::advance() is needlessly passed a GlyphBuffer in many cases
https://bugs.webkit.org/show_bug.cgi?id=99413

Reviewed by Adele Peterson.

r131365 made Font::width() always pass a GlyphBuffer pointer to floatWidthForSimpleText and
from there down to WidthIterator::advance(). However, when measuring the width of a run, a
GlyphBuffer is only needed if font transforms (kerning and ligatures) need to be applied.

No new test, because there is no change in behavior.

* platform/graphics/Font.cpp:
(WebCore::Font::width): Removed the local GlyphBuffer that was passed down to
floatWidthForSimpleText().
* platform/graphics/Font.h: Removed the GlyphBuffer* parameter to floatWidthForSimpleText.
All but the above caller were passing 0.
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::floatWidthForSimpleText): Removed the GlyphBuffer* parameter and added a
local GlyphBuffer, which is passed by reference to WidthIterator::advance() only if
typesetting features require it.
(WebCore::Font::offsetForPositionForSimpleText): Updated for change to
floatWidthForSimpleText.
* platform/graphics/pango/FontPango.cpp:
(WebCore::Font::floatWidthForComplexText): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/FontFastPath.cpp
Source/WebCore/platform/graphics/pango/FontPango.cpp