Changeset 26696 in webkit


Ignore:
Timestamp:
Oct 16, 2007 9:51:50 PM (17 years ago)
Author:
darin
Message:

Reviewed by Mitz.

  • <rdar://problem/5404359> UI thread stall (>60sec) in MLANG running stress test (related to font data caching)
  • platform/Font.cpp: (WebCore::Font::glyphDataForCharacter): Check for a null value for fontData rather than for glyph to detect non-cached entries in the glyph data.
  • platform/gtk/GlyphPageTreeNodeGtk.cpp: (WebCore::GlyphPage::fill):
  • platform/mac/GlyphPageTreeNodeMac.cpp: (WebCore::GlyphPage::fill):
  • platform/win/GlyphPageTreeNodeWin.cpp: (WebCore::GlyphPage::fill): Set fontData to 0 for missing glyph entries. Also fixed the Windows and GTK versions to return the proper value for haveGlyphs.
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r26695 r26696  
     12007-10-16  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Mitz.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=15536
     6          need to cache missing glyph so we're not slow on pages that show missing glyphs
     7
     8        - <rdar://problem/5404359> UI thread stall (>60sec) in MLANG running stress test
     9          (related to font data caching)
     10
     11        * platform/Font.cpp: (WebCore::Font::glyphDataForCharacter): Check for a null value
     12        for fontData rather than for glyph to detect non-cached entries in the glyph data.
     13
     14        * platform/gtk/GlyphPageTreeNodeGtk.cpp: (WebCore::GlyphPage::fill):
     15        * platform/mac/GlyphPageTreeNodeMac.cpp: (WebCore::GlyphPage::fill):
     16        * platform/win/GlyphPageTreeNodeWin.cpp: (WebCore::GlyphPage::fill):
     17        Set fontData to 0 for missing glyph entries. Also fixed the Windows and GTK versions
     18        to return the proper value for haveGlyphs.
     19
    1202007-10-16  Mark Rowe  <mrowe@apple.com>
    221
  • trunk/WebCore/platform/Font.cpp

    r26638 r26696  
    386386            if (page) {
    387387                const GlyphData& data = page->glyphDataForCharacter(c);
    388                 if (data.glyph)
     388                if (data.fontData)
    389389                    return data;
    390390                if (node->isSystemFallback())
     
    404404            if (page) {
    405405                const GlyphData& data = page->glyphDataForCharacter(c);
    406                 if (data.glyph) {
     406                if (data.fontData) {
    407407                    // The smallCapsFontData function should not normally return 0.
    408408                    // But if it does, we will just render the capital letter big.
     
    413413                    GlyphPageTreeNode* smallCapsNode = GlyphPageTreeNode::getRootChild(smallCapsFontData, pageNumber);
    414414                    const GlyphData& data = smallCapsNode->page()->glyphDataForCharacter(c);
    415                     if (data.glyph)
     415                    if (data.fontData)
    416416                        return data;
    417417
  • trunk/WebCore/platform/gtk/GlyphPageTreeNodeGtk.cpp

    r25703 r26696  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
    44 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk>
    5  * All rights reserved.
    65 *
    76 * Redistribution and use in source and binary forms, with or without
     
    4039{
    4140    FT_Face face = cairo_ft_scaled_font_lock_face(fontData->m_font.m_scaledFont);
    42 
    4341    if (!face)
    4442        return false;
    4543
    46     for (unsigned i = 0; i < bufferLength; i++)
    47         setGlyphDataForIndex(i, FcFreeTypeCharIndex(face, buffer[i]), fontData);
     44    bool haveGlyphs = false;
     45    for (unsigned i = 0; i < bufferLength; i++) {
     46        Glyph glyph = FcFreeTypeCharIndex(face, buffer[i]);
     47        if (!glyph)
     48            setGlyphDataForIndex(i, 0, 0);
     49        else {
     50            setGlyphDataForIndex(i, glyph, fontData);
     51            haveGlyphs = true;
     52        }
     53    }
    4854
    4955    cairo_ft_scaled_font_unlock_face(fontData->m_font.m_scaledFont);
    5056
    51     return true;
     57    return haveGlyphs;
    5258}
    5359
  • trunk/WebCore/platform/mac/GlyphPageTreeNodeMac.cpp

    r18966 r26696  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6161    for (unsigned i = 0; i < GlyphPage::size; i++) {
    6262        Glyph glyph = glyphRecord->glyphID;
    63         setGlyphDataForIndex(i, glyph, fontData);
    64         if (!haveGlyphs && glyph)
     63        if (!glyph)
     64            setGlyphDataForIndex(i, 0, 0);
     65        else {
     66            setGlyphDataForIndex(i, glyph, fontData);
    6567            haveGlyphs = true;
     68        }
    6669        glyphRecord = (ATSLayoutRecord *)((char *)glyphRecord + wkGetGlyphVectorRecordSize(glyphVector));
    6770    }
  • trunk/WebCore/platform/win/GlyphPageTreeNodeWin.cpp

    r24047 r26696  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929#include "config.h"
    3030#include "FontData.h"
     31
    3132#include <WebKitSystemInterface/WebKitSystemInterface.h>
    3233
    33 namespace WebCore
    34 {
     34namespace WebCore {
    3535
    3636bool GlyphPage::fill(UChar* buffer, unsigned bufferLength, const FontData* fontData)
    3737{
    38     // bufferLength will be greater than the glyph page size if the buffer has Unicode supplementary characters.
     38    // The bufferLength will be greater than the glyph page size if the buffer has Unicode supplementary characters.
    3939    // We won't support this for now.
    4040    if (bufferLength > GlyphPage::size)
    4141        return false;
    4242
     43    bool haveGlyphs = false;
    4344    CGGlyph localGlyphBuffer[GlyphPage::size];
    4445    wkGetGlyphs(fontData->platformData().cgFont(), buffer, localGlyphBuffer, bufferLength);
    45     for (unsigned i = 0; i < GlyphPage::size; i++)
    46         setGlyphDataForIndex(i, localGlyphBuffer[i], fontData);
    47     return true;
     46    for (unsigned i = 0; i < GlyphPage::size; i++) {
     47        Glyph glyph = localGlyphBuffer[i];
     48        if (!glyph)
     49            setGlyphDataForIndex(i, 0, 0);
     50        else {
     51            setGlyphDataForIndex(i, glyph, fontData);
     52            haveGlyphs = true;
     53        }
     54    }
     55    return haveGlyphs;
    4856}
    4957
    5058}
    51 
Note: See TracChangeset for help on using the changeset viewer.