Skip to content

Commit

Permalink
Remove an unused argument markCount of ComplexTextController::advance…
Browse files Browse the repository at this point in the history
…ByCombiningCharacterSequence

https://bugs.webkit.org/show_bug.cgi?id=271693

Reviewed by Charlie Wolfe.

The argument markCount was added by 84260@main, but not used after
253278@main. Removed it. No behavior change.

* Source/WebCore/platform/graphics/ComplexTextController.cpp:
* Source/WebCore/platform/graphics/ComplexTextController.h:

Canonical link: https://commits.webkit.org/276679@main
  • Loading branch information
fujii committed Mar 26, 2024
1 parent 9038ec0 commit df11425
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions Source/WebCore/platform/graphics/ComplexTextController.cpp
Expand Up @@ -262,7 +262,7 @@ unsigned ComplexTextController::offsetForPosition(float h, bool includePartialGl
return 0;
}

bool ComplexTextController::advanceByCombiningCharacterSequence(const CachedTextBreakIterator& graphemeClusterIterator, unsigned& currentIndex, char32_t& baseCharacter, unsigned& markCount)
bool ComplexTextController::advanceByCombiningCharacterSequence(const CachedTextBreakIterator& graphemeClusterIterator, unsigned& currentIndex, char32_t& baseCharacter)
{
unsigned remainingCharacters = m_end - currentIndex;
ASSERT(remainingCharacters);
Expand All @@ -279,7 +279,6 @@ bool ComplexTextController::advanceByCombiningCharacterSequence(const CachedText
unsigned i = 0;
U16_NEXT(buffer, i, bufferLength, baseCharacter);
if (U_IS_SURROGATE(baseCharacter)) {
markCount = 0;
currentIndex += i;
return false;
}
Expand All @@ -288,7 +287,6 @@ bool ComplexTextController::advanceByCombiningCharacterSequence(const CachedText
if (auto following = graphemeClusterIterator.following(currentIndex))
delta = *following - currentIndex;

markCount = delta - 1;
currentIndex += delta;

return true;
Expand Down Expand Up @@ -330,9 +328,8 @@ void ComplexTextController::collectComplexTextRuns()

CachedTextBreakIterator graphemeClusterIterator(m_run.text(), { }, TextBreakIterator::CharacterMode { }, m_font.fontDescription().computedLocale());

unsigned markCount;
char32_t baseCharacter;
if (!advanceByCombiningCharacterSequence(graphemeClusterIterator, currentIndex, baseCharacter, markCount))
if (!advanceByCombiningCharacterSequence(graphemeClusterIterator, currentIndex, baseCharacter))
return;

// We don't perform font fallback on the capitalized characters when small caps is synthesized.
Expand Down Expand Up @@ -360,7 +357,7 @@ void ComplexTextController::collectComplexTextRuns()
isSmallCaps = nextIsSmallCaps;
auto previousIndex = currentIndex;

if (!advanceByCombiningCharacterSequence(graphemeClusterIterator, currentIndex, baseCharacter, markCount))
if (!advanceByCombiningCharacterSequence(graphemeClusterIterator, currentIndex, baseCharacter))
return;

if (synthesizedFont) {
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/graphics/ComplexTextController.h
Expand Up @@ -164,7 +164,7 @@ class ComplexTextController {

FloatPoint glyphOrigin(unsigned index) const { return index < m_glyphOrigins.size() ? m_glyphOrigins[index] : FloatPoint(); }

bool advanceByCombiningCharacterSequence(const WTF::CachedTextBreakIterator& graphemeClusterIterator, unsigned& location, char32_t& baseCharacter, unsigned& markCount);
bool advanceByCombiningCharacterSequence(const WTF::CachedTextBreakIterator& graphemeClusterIterator, unsigned& location, char32_t& baseCharacter);

Vector<FloatSize, 256> m_adjustedBaseAdvances;
Vector<FloatPoint, 256> m_glyphOrigins;
Expand Down

0 comments on commit df11425

Please sign in to comment.