2011-02-06 Andreas Kling <kling@webkit.org>
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Feb 2011 16:22:23 +0000 (16:22 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Feb 2011 16:22:23 +0000 (16:22 +0000)
commit5a5e46a604f8f1ddf8f06cfb72bcffcdcc0c6e05
treeffc4386993a19c370b389421e9d8ea059553e82c
parent6cae2a7c0aecdd5588296440b8ea5da036b189a3
2011-02-06  Andreas Kling  <kling@webkit.org>

        Reviewed by Dirk Schulze.

        Refactor Font::normalizeSpaces() to avoid an extra String copy.
        https://bugs.webkit.org/show_bug.cgi?id=53871

        Have normalizeSpaces() take UChar*,length arguments instead of a
        String, since all call sites were creating temporaries from these
        components anyway.

        Font::normalizeSpaces() now always makes 1 String copy,
        instead of 1 in the best case and 2 in the worst case.

        * platform/graphics/Font.cpp:
        (WebCore::Font::normalizeSpaces):
        * platform/graphics/Font.h:
        * platform/graphics/qt/FontQt.cpp:
        (WebCore::drawTextCommon):
        (WebCore::Font::floatWidthForSimpleText):
        (WebCore::Font::floatWidthForComplexText):
        (WebCore::Font::offsetForPositionForSimpleText):
        (WebCore::Font::offsetForPositionForComplexText):
        (WebCore::Font::selectionRectForSimpleText):
        (WebCore::Font::selectionRectForComplexText):
        * svg/SVGFont.cpp:
        (WebCore::SVGTextRunWalker::walk):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/qt/FontQt.cpp
Source/WebCore/svg/SVGFont.cpp