Changeset 158012 in webkit


Ignore:
Timestamp:
Oct 25, 2013, 8:58:24 AM (12 years ago)
Author:
Antti Koivisto
Message:

Faster way for simple line layout to check if text has fallback fonts
https://bugs.webkit.org/show_bug.cgi?id=123342

Reviewed by Andreas Kling.

Don't use RenderText::knownToHaveNoOverflowAndNoFallbackFonts as it is slow.

Simple text code path test already guarantees there is no overflow. Test for fallback
fonts explicitly.

  • platform/graphics/SimpleFontData.h:


Make FINAL.

  • rendering/RenderText.cpp:
  • rendering/RenderText.h:


Remove knownToHaveNoOverflowAndNoFallbackFonts() as it has no clients.

  • rendering/SimpleLineLayout.cpp:

(WebCore::SimpleLineLayout::canUseFor):

Check if all characters can be found from the primary font.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r158011 r158012  
     12013-10-25  Antti Koivisto  <antti@apple.com>
     2
     3        Faster way for simple line layout to check if text has fallback fonts
     4        https://bugs.webkit.org/show_bug.cgi?id=123342
     5
     6        Reviewed by Andreas Kling.
     7       
     8        Don't use RenderText::knownToHaveNoOverflowAndNoFallbackFonts as it is slow.
     9
     10        Simple text code path test already guarantees there is no overflow. Test for fallback
     11        fonts explicitly.
     12
     13        * platform/graphics/SimpleFontData.h:
     14       
     15            Make FINAL.
     16
     17        * rendering/RenderText.cpp:
     18        * rendering/RenderText.h:
     19       
     20            Remove knownToHaveNoOverflowAndNoFallbackFonts() as it has no clients.
     21
     22        * rendering/SimpleLineLayout.cpp:
     23        (WebCore::SimpleLineLayout::canUseFor):
     24       
     25            Check if all characters can be found from the primary font.
     26
    1272013-10-25  Andreas Kling  <akling@apple.com>
    228
  • trunk/Source/WebCore/platform/graphics/SimpleFontData.h

    r157653 r158012  
    6666enum Pitch { UnknownPitch, FixedPitch, VariablePitch };
    6767
    68 class SimpleFontData : public FontData {
     68class SimpleFontData FINAL : public FontData {
    6969public:
    7070    class AdditionalFontData {
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r157985 r158012  
    511511}
    512512
    513 bool RenderText::knownToHaveNoOverflowAndNoFallbackFonts() const
    514 {
    515     if (preferredLogicalWidthsDirty())
    516         const_cast<RenderText*>(this)->computePreferredLogicalWidths(0);
    517 
    518     return m_knownToHaveNoOverflowAndNoFallbackFonts;
    519 }
    520 
    521513void RenderText::computePreferredLogicalWidths(float leadWidth)
    522514{
  • trunk/Source/WebCore/rendering/RenderText.h

    r157950 r158012  
    141141
    142142    bool canUseSimpleFontCodePath() const { return m_canUseSimpleFontCodePath; }
    143     bool knownToHaveNoOverflowAndNoFallbackFonts() const;
    144143
    145144    void removeAndDestroyTextBoxes();
  • trunk/Source/WebCore/rendering/SimpleLineLayout.cpp

    r158007 r158012  
    149149    if (style.font().codePath(TextRun(textRenderer.text())) != Font::Simple)
    150150        return false;
    151     if (!textRenderer.knownToHaveNoOverflowAndNoFallbackFonts())
    152         return false;
     151
     152    auto primaryFontData = style.font().primaryFont();
    153153
    154154    unsigned length = textRenderer.textLength();
     
    179179                return false;
    180180        }
     181        if (!primaryFontData->glyphForCharacter(character))
     182            return false;
    181183    }
    182184    return true;
Note: See TracChangeset for help on using the changeset viewer.