Clean up interface to Font::expansionOpportunityCount()
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Oct 2014 22:07:42 +0000 (22:07 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Oct 2014 22:07:42 +0000 (22:07 +0000)
commitc2158a221353468c83cf6c596077adeafdde3247
tree2dfdddc1d47f1324a1af58cbbe3ffb6e6e0b418b
parent114f8365ded692c5e468f8d13d262155187f718f
Clean up interface to Font::expansionOpportunityCount()
https://bugs.webkit.org/show_bug.cgi?id=137355

Reviewed by Dean Jackson.

There are two overloads of Font::expansionOpportunityCount() which perform the same
operation. One overload takes a UChar*, the other takes an LChar*, and they both
take a length. This is the abstraction that StringView was designed to be. Instead
of forcing each caller to take a different overload based on if their data is
8 bit or not, allow the caller to construct a StringView and pass that into
Font::expansionOpportunityCount() instead of a raw pointer/length.

No new tests because there is no behavior change.

* platform/graphics/Font.cpp:
(WebCore::Font::expansionOpportunityCountInternal): Original two functions,
renamed.
(WebCore::Font::expansionOpportunityCount): Takes a StringView, calls
expansionOpportunityCountInternal().
* platform/graphics/Font.h: Update signatures.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::WidthIterator): Use new signature to
Font::expansionOpportunityCount().
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::ComplexTextController): Ditto.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): Ditto.
* rendering/RenderText.cpp:
(WebCore::RenderText::stringView): Accessor to encapsulate character pointer
and length.
* rendering/RenderText.h: Signature of new accessor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/WidthIterator.cpp
Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderText.h