Changeset 26696 in webkit
- Timestamp:
- Oct 16, 2007, 9:51:50 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/WebCore/ChangeLog ¶
r26695 r26696 1 2007-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 1 20 2007-10-16 Mark Rowe <mrowe@apple.com> 2 21 -
TabularUnified trunk/WebCore/platform/Font.cpp ¶
r26638 r26696 386 386 if (page) { 387 387 const GlyphData& data = page->glyphDataForCharacter(c); 388 if (data. glyph)388 if (data.fontData) 389 389 return data; 390 390 if (node->isSystemFallback()) … … 404 404 if (page) { 405 405 const GlyphData& data = page->glyphDataForCharacter(c); 406 if (data. glyph) {406 if (data.fontData) { 407 407 // The smallCapsFontData function should not normally return 0. 408 408 // But if it does, we will just render the capital letter big. … … 413 413 GlyphPageTreeNode* smallCapsNode = GlyphPageTreeNode::getRootChild(smallCapsFontData, pageNumber); 414 414 const GlyphData& data = smallCapsNode->page()->glyphDataForCharacter(c); 415 if (data. glyph)415 if (data.fontData) 416 416 return data; 417 417 -
TabularUnified trunk/WebCore/platform/gtk/GlyphPageTreeNodeGtk.cpp ¶
r25703 r26696 1 1 /* 2 * Copyright (C) 2006 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com 4 4 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> 5 * All rights reserved.6 5 * 7 6 * Redistribution and use in source and binary forms, with or without … … 40 39 { 41 40 FT_Face face = cairo_ft_scaled_font_lock_face(fontData->m_font.m_scaledFont); 42 43 41 if (!face) 44 42 return false; 45 43 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 } 48 54 49 55 cairo_ft_scaled_font_unlock_face(fontData->m_font.m_scaledFont); 50 56 51 return true;57 return haveGlyphs; 52 58 } 53 59 -
TabularUnified trunk/WebCore/platform/mac/GlyphPageTreeNodeMac.cpp ¶
r18966 r26696 1 1 /* 2 * Copyright (C) 2006 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 61 61 for (unsigned i = 0; i < GlyphPage::size; i++) { 62 62 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); 65 67 haveGlyphs = true; 68 } 66 69 glyphRecord = (ATSLayoutRecord *)((char *)glyphRecord + wkGetGlyphVectorRecordSize(glyphVector)); 67 70 } -
TabularUnified trunk/WebCore/platform/win/GlyphPageTreeNodeWin.cpp ¶
r24047 r26696 1 1 /* 2 * Copyright (C) 2006, 2007 Apple Inc. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "config.h" 30 30 #include "FontData.h" 31 31 32 #include <WebKitSystemInterface/WebKitSystemInterface.h> 32 33 33 namespace WebCore 34 { 34 namespace WebCore { 35 35 36 36 bool GlyphPage::fill(UChar* buffer, unsigned bufferLength, const FontData* fontData) 37 37 { 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. 39 39 // We won't support this for now. 40 40 if (bufferLength > GlyphPage::size) 41 41 return false; 42 42 43 bool haveGlyphs = false; 43 44 CGGlyph localGlyphBuffer[GlyphPage::size]; 44 45 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; 48 56 } 49 57 50 58 } 51
Note:
See TracChangeset
for help on using the changeset viewer.