Changeset 150085 in webkit


Ignore:
Timestamp:
May 14, 2013 1:22:52 PM (11 years ago)
Author:
akling@apple.com
Message:
Assertion failure in GlyphPage::setGlyphDataForIndex: (!glyph
fontData == m_fontDataForAllGlyphs)

<http://webkit.org/b/116113>
<rdar://problem/13833790>

Reviewed by Dan Bernstein.

If we're filling a full GlyphPage with a SimpleFontData that is actually a composite font reference,
we need to make sure we have per-glyph font data pointers, since it may end up using them.

Added GlyphPage::mayUseMixedFontDataWhenFilling() which can be implemented by the platform to let
GlyphPageTreeNode know that it should allocate a full-sized GlyphPage for mixed font data pointers
in case the font is a composite font reference, or if there are CJK ideographs in the text.

This code can be made smarter, but that's outside the scope of this change.
Fixes heavy asserting on bots running unreleased software.

  • platform/graphics/GlyphPage.h:

(GlyphPage):
(WebCore::GlyphPage::mayUseMixedFontDataWhenFilling):

  • platform/graphics/GlyphPageTreeNode.cpp:

(WebCore::GlyphPageTreeNode::initializePage):

  • platform/graphics/mac/GlyphPageTreeNodeMac.cpp:

(WebCore::shouldUseCoreText):
(WebCore::GlyphPage::mayUseMixedFontDataWhenFilling):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r150084 r150085  
     12013-05-14  Andreas Kling  <akling@apple.com>
     2
     3        Assertion failure in GlyphPage::setGlyphDataForIndex: (!glyph || fontData == m_fontDataForAllGlyphs)
     4        <http://webkit.org/b/116113>
     5        <rdar://problem/13833790>
     6
     7        Reviewed by Dan Bernstein.
     8
     9        If we're filling a full GlyphPage with a SimpleFontData that is actually a composite font reference,
     10        we need to make sure we have per-glyph font data pointers, since it may end up using them.
     11
     12        Added GlyphPage::mayUseMixedFontDataWhenFilling() which can be implemented by the platform to let
     13        GlyphPageTreeNode know that it should allocate a full-sized GlyphPage for mixed font data pointers
     14        in case the font is a composite font reference, or if there are CJK ideographs in the text.
     15
     16        This code can be made smarter, but that's outside the scope of this change.
     17        Fixes heavy asserting on bots running unreleased software.
     18
     19        * platform/graphics/GlyphPage.h:
     20        (GlyphPage):
     21        (WebCore::GlyphPage::mayUseMixedFontDataWhenFilling):
     22        * platform/graphics/GlyphPageTreeNode.cpp:
     23        (WebCore::GlyphPageTreeNode::initializePage):
     24        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
     25        (WebCore::shouldUseCoreText):
     26        (WebCore::GlyphPage::mayUseMixedFontDataWhenFilling):
     27
    1282013-05-14  Bem Jones-Bey  <bjonesbe@adobe.com>
    229
  • trunk/Source/WebCore/platform/graphics/GlyphPage.h

    r149529 r150085  
    169169    // Implemented by the platform.
    170170    bool fill(unsigned offset, unsigned length, UChar* characterBuffer, unsigned bufferLength, const SimpleFontData*);
     171#if PLATFORM(MAC)
     172    static bool mayUseMixedFontDataWhenFilling(const UChar* characterBuffer, unsigned bufferLength, const SimpleFontData*);
     173#else
     174    static bool mayUseMixedFontDataWhenFilling(const UChar*, unsigned, const SimpleFontData*) { return false; }
     175#endif
    171176
    172177private:
  • trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp

    r147691 r150085  
    212212            bool haveGlyphs;
    213213            if (!fontData->isSegmented()) {
    214                 m_page = GlyphPage::createForSingleFontData(this, static_cast<const SimpleFontData*>(fontData));
     214                if (GlyphPage::mayUseMixedFontDataWhenFilling(buffer, bufferLength, static_cast<const SimpleFontData*>(fontData)))
     215                    m_page = GlyphPage::createForMixedFontData(this);
     216                else
     217                    m_page = GlyphPage::createForSingleFontData(this, static_cast<const SimpleFontData*>(fontData));
    215218                haveGlyphs = fill(m_page.get(), 0, GlyphPage::size, buffer, bufferLength, static_cast<const SimpleFontData*>(fontData));
    216219            } else {
  • trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp

    r149255 r150085  
    3737namespace WebCore {
    3838
    39 static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
     39static bool shouldUseCoreText(const UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
    4040{
    4141    if (fontData->platformData().isCompositeFontReference())
     
    5050
    5151    return false;
     52}
     53
     54bool GlyphPage::mayUseMixedFontDataWhenFilling(const UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
     55{
     56    // FIXME: This could be smarter if the logic currently in GlyphPage::fill() got to make the decision about what kind of GlyphPage to construct.
     57    return shouldUseCoreText(buffer, bufferLength, fontData);
    5258}
    5359
Note: See TracChangeset for help on using the changeset viewer.