Title: [192726] trunk/Source/WebCore
Revision
192726
Author
mmaxfi...@apple.com
Date
2015-11-21 15:06:46 -0800 (Sat, 21 Nov 2015)

Log Message

Tiny cleanup in ComplexTextController::collectComplexTextRuns()
https://bugs.webkit.org/show_bug.cgi?id=151534

Reviewed by Zalan Bujtas.

The isMissingGlyph boolean is completely unnecessary. Its entire
responsiblity is duplicated by the "font" pointer.

No new tests because there is no behavior change.

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::collectComplexTextRuns):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (192725 => 192726)


--- trunk/Source/WebCore/ChangeLog	2015-11-21 20:02:34 UTC (rev 192725)
+++ trunk/Source/WebCore/ChangeLog	2015-11-21 23:06:46 UTC (rev 192726)
@@ -1 +1,16 @@
+2015-11-21  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        Tiny cleanup in ComplexTextController::collectComplexTextRuns()
+        https://bugs.webkit.org/show_bug.cgi?id=151534
+
+        Reviewed by Zalan Bujtas.
+
+        The isMissingGlyph boolean is completely unnecessary. Its entire
+        responsiblity is duplicated by the "font" pointer.
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::collectComplexTextRuns):
+
 == Rolled over to ChangeLog-2015-11-21 ==

Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (192725 => 192726)


--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp	2015-11-21 20:02:34 UTC (rev 192725)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp	2015-11-21 23:06:46 UTC (rev 192726)
@@ -313,9 +313,7 @@
     const UChar* end = cp + m_end;
 
     const Font* font;
-    bool isMissingGlyph;
     const Font* nextFont;
-    bool nextIsMissingGlyph;
 
     unsigned markCount;
     const UChar* sequenceStart = curr;
@@ -335,14 +333,10 @@
             m_smallCapsBuffer[sequenceStart - cp + i + 1] = sequenceStart[i + 1];
     }
 
-    nextIsMissingGlyph = false;
     nextFont = m_font.fontForCombiningCharacterSequence(sequenceStart, curr - sequenceStart, nextIsSmallCaps ? SmallCapsVariant : NormalVariant);
-    if (!nextFont)
-        nextIsMissingGlyph = true;
 
     while (curr < end) {
         font = nextFont;
-        isMissingGlyph = nextIsMissingGlyph;
         isSmallCaps = nextIsSmallCaps;
         int index = curr - cp;
 
@@ -360,19 +354,15 @@
             }
         }
 
-        nextIsMissingGlyph = false;
         if (baseCharacter == zeroWidthJoiner)
             nextFont = font;
-        else {
+        else
             nextFont = m_font.fontForCombiningCharacterSequence(cp + index, curr - cp - index, nextIsSmallCaps ? SmallCapsVariant : NormalVariant);
-            if (!nextFont)
-                nextIsMissingGlyph = true;
-        }
 
-        if (nextFont != font || nextIsMissingGlyph != isMissingGlyph) {
+        if (nextFont != font) {
             int itemStart = static_cast<int>(indexOfFontTransition);
             int itemLength = index - indexOfFontTransition;
-            collectComplexTextRunsForCharacters((isSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, !isMissingGlyph ? font : 0);
+            collectComplexTextRunsForCharacters((isSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, font);
             indexOfFontTransition = index;
         }
     }
@@ -380,7 +370,7 @@
     int itemLength = m_end - indexOfFontTransition;
     if (itemLength) {
         int itemStart = indexOfFontTransition;
-        collectComplexTextRunsForCharacters((nextIsSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, !nextIsMissingGlyph ? nextFont : 0);
+        collectComplexTextRunsForCharacters((nextIsSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, nextFont);
     }
 
     if (!m_run.ltr())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to