Changeset 46388 in webkit
- Timestamp:
- Jul 24, 2009 8:50:23 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r46383 r46388 1 2009-07-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Add functions to print the glyph page trees for debugging 6 https://bugs.webkit.org/show_bug.cgi?id=27671 7 8 * platform/graphics/FontData.h: Defined a description() method. 9 10 * platform/graphics/GlyphPageTreeNode.cpp: 11 (WebCore::GlyphPageTreeNode::showSubtree): Added. Prints the node and 12 its descendants. 13 (showGlyphPageTrees): Added. Prints all glyph page trees. 14 (showGlyphPageTree): Added. Prints the glyph page tree for a given page. 15 * platform/graphics/GlyphPageTreeNode.h: 16 17 * platform/graphics/SegmentedFontData.cpp: 18 (WebCore::SegmentedFontData::description): Added. 19 20 * platform/graphics/SegmentedFontData.h: 21 * platform/graphics/SimpleFontData.cpp: 22 (WebCore::SimpleFontData::description): Added. Uses the platform data 23 as the description for non-svg, non-custom fonts. 24 * platform/graphics/SimpleFontData.h: 25 26 * platform/graphics/gtk/FontPlatformData.h: 27 * platform/graphics/gtk/FontPlatformDataGtk.cpp: 28 (WebCore::FontPlatformData::description): Added. Returns a null string. 29 * platform/graphics/gtk/FontPlatformDataPango.cpp: 30 (WebCore::FontPlatformData::description): Added. Returns a null string. 31 32 * platform/graphics/mac/FontPlatformData.h: 33 * platform/graphics/mac/FontPlatformDataMac.mm: 34 (WebCore::FontPlatformData::description): Added. Returns the 35 description of the CGFont, the size and the synthetic style flags, 36 if set. 37 38 * platform/graphics/qt/FontPlatformData.h: 39 * platform/graphics/qt/FontPlatformDataQt.cpp: 40 (WebCore::FontPlatformData::description): Added. Returns a null string. 41 42 * platform/graphics/win/FontPlatformData.h: 43 * platform/graphics/win/FontPlatformDataWin.cpp: 44 (WebCore::FontPlatformData::description): Added. Returns a null string. 45 46 * platform/graphics/wince/FontPlatformData.cpp: 47 (WebCore::FontPlatformData::description): Added. Returns a null string. 48 * platform/graphics/wince/FontPlatformData.h: 49 50 * platform/graphics/wx/FontPlatformData.h: 51 * platform/graphics/wx/FontPlatformDataWx.cpp: 52 (WebCore::FontPlatformData::description): Added. Returns a null string. 53 1 54 2009-07-24 Mads Ager <ager@chromium.org> 2 55 -
trunk/WebCore/platform/graphics/FontData.h
r45891 r46388 33 33 34 34 class SimpleFontData; 35 class String; 35 36 36 37 class FontData : public Noncopyable { … … 52 53 unsigned maxGlyphPageTreeLevel() const { return m_maxGlyphPageTreeLevel; } 53 54 55 #ifndef NDEBUG 56 virtual String description() const = 0; 57 #endif 58 54 59 private: 55 60 mutable unsigned m_maxGlyphPageTreeLevel; -
trunk/WebCore/platform/graphics/GlyphPageTreeNode.cpp
r43364 r46388 30 30 #include "GlyphPageTreeNode.h" 31 31 32 #include "CString.h" 32 33 #include "CharacterNames.h" 33 34 #include "SegmentedFontData.h" … … 378 379 } 379 380 380 } 381 #ifndef NDEBUG 382 void GlyphPageTreeNode::showSubtree() 383 { 384 Vector<char> indent(level()); 385 indent.fill('\t', level()); 386 indent.append(0); 387 388 HashMap<const FontData*, GlyphPageTreeNode*>::iterator end = m_children.end(); 389 for (HashMap<const FontData*, GlyphPageTreeNode*>::iterator it = m_children.begin(); it != end; ++it) { 390 printf("%s\t%p %s\n", indent.data(), it->first, it->first->description().utf8().data()); 391 it->second->showSubtree(); 392 } 393 if (m_systemFallbackChild) { 394 printf("%s\t* fallback\n", indent.data()); 395 m_systemFallbackChild->showSubtree(); 396 } 397 } 398 #endif 399 400 } 401 402 #ifndef NDEBUG 403 void showGlyphPageTrees() 404 { 405 printf("Page 0:\n"); 406 showGlyphPageTree(0); 407 HashMap<int, WebCore::GlyphPageTreeNode*>::iterator end = WebCore::GlyphPageTreeNode::roots->end(); 408 for (HashMap<int, WebCore::GlyphPageTreeNode*>::iterator it = WebCore::GlyphPageTreeNode::roots->begin(); it != end; ++it) { 409 printf("\nPage %d:\n", it->first); 410 showGlyphPageTree(it->first); 411 } 412 } 413 414 void showGlyphPageTree(unsigned pageNumber) 415 { 416 WebCore::GlyphPageTreeNode::getRoot(pageNumber)->showSubtree(); 417 } 418 #endif -
trunk/WebCore/platform/graphics/GlyphPageTreeNode.h
r43373 r46388 36 36 #include <wtf/unicode/Unicode.h> 37 37 38 #ifndef NDEBUG 39 void showGlyphPageTrees(); 40 void showGlyphPageTree(unsigned pageNumber); 41 #endif 42 38 43 namespace WebCore { 39 44 … … 211 216 void initializePage(const FontData*, unsigned pageNumber); 212 217 218 #ifndef NDEBUG 219 void showSubtree(); 220 #endif 221 213 222 GlyphPageTreeNode* m_parent; 214 223 RefPtr<GlyphPage> m_page; … … 221 230 #ifndef NDEBUG 222 231 unsigned m_pageNumber; 232 233 friend void ::showGlyphPageTree(unsigned pageNumber); 223 234 #endif 224 235 }; -
trunk/WebCore/platform/graphics/SegmentedFontData.cpp
r39818 r46388 27 27 #include "SegmentedFontData.h" 28 28 29 #include "PlatformString.h" 29 30 #include "SimpleFontData.h" 30 31 #include <wtf/Assertions.h> … … 88 89 } 89 90 91 #ifndef NDEBUG 92 String SegmentedFontData::description() const 93 { 94 return "[segmented font]"; 95 } 96 #endif 97 90 98 } // namespace WebCore -
trunk/WebCore/platform/graphics/SegmentedFontData.h
r39818 r46388 60 60 const FontDataRange& rangeAt(unsigned i) const { return m_ranges[i]; } 61 61 62 #ifndef NDEBUG 63 virtual String description() const; 64 #endif 65 62 66 private: 63 67 virtual const SimpleFontData* fontDataForCharacter(UChar32) const; -
trunk/WebCore/platform/graphics/SimpleFontData.cpp
r44439 r46388 191 191 } 192 192 193 #ifndef NDEBUG 194 String SimpleFontData::description() const 195 { 196 if (isSVGFont()) 197 return "[SVG font]"; 198 if (isCustomFont()) 199 return "[custom font]"; 200 201 return platformData().description(); 202 } 203 #endif 204 193 205 } // namespace WebCore -
trunk/WebCore/platform/graphics/SimpleFontData.h
r44442 r46388 106 106 const GlyphData& missingGlyphData() const { return m_missingGlyphData; } 107 107 108 #ifndef NDEBUG 109 virtual String description() const; 110 #endif 111 108 112 #if PLATFORM(MAC) 109 113 NSFont* getNSFont() const { return m_platformData.font(); } -
trunk/WebCore/platform/graphics/gtk/FontPlatformData.h
r44272 r46388 42 42 43 43 namespace WebCore { 44 45 class String; 44 46 45 47 class FontPlatformData { … … 108 110 }; 109 111 112 #ifndef NDEBUG 113 String description() const; 114 #endif 115 110 116 #if defined(USE_FREETYPE) 111 117 FcPattern* m_pattern; -
trunk/WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp
r42199 r46388 260 260 } 261 261 262 } 262 #ifndef NDEBUG 263 String FontPlatformData::description() const 264 { 265 return String(); 266 } 267 #endif 268 269 } -
trunk/WebCore/platform/graphics/gtk/FontPlatformDataPango.cpp
r46333 r46388 276 276 } 277 277 278 } 278 #ifndef NDEBUG 279 String FontPlatformData::description() const 280 { 281 return String(); 282 } 283 #endif 284 285 } -
trunk/WebCore/platform/graphics/mac/FontPlatformData.h
r44272 r46388 45 45 46 46 namespace WebCore { 47 48 class String; 47 49 48 50 #ifndef BUILDING_ON_TIGER … … 119 121 #endif 120 122 123 #ifndef NDEBUG 124 String description() const; 125 #endif 126 121 127 private: 122 128 static NSFont *hashTableDeletedFontValue() { return reinterpret_cast<NSFont *>(-1); } -
trunk/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
r41939 r46388 24 24 #import "FontPlatformData.h" 25 25 26 #import "PlatformString.h" 26 27 #import "WebCoreSystemInterface.h" 27 28 #import <AppKit/NSFont.h> … … 108 109 } 109 110 111 #ifndef NDEBUG 112 String FontPlatformData::description() const 113 { 114 RetainPtr<CFStringRef> cgFontDescription(AdoptCF, CFCopyDescription(cgFont())); 115 return String(cgFontDescription.get()) + " " + String::number(m_size) + (m_syntheticBold ? " synthetic bold" : "") + (m_syntheticOblique ? " syntheitic oblique" : ""); 116 } 117 #endif 118 110 119 } // namespace WebCore -
trunk/WebCore/platform/graphics/qt/FontPlatformData.h
r46124 r46388 25 25 26 26 #include "FontDescription.h" 27 28 27 #include <QFont> 29 28 30 29 namespace WebCore { 30 31 class String; 31 32 32 33 class FontPlatformData … … 48 49 int pixelSize() const { return m_font.pixelSize(); } 49 50 51 #ifndef NDEBUG 52 String description() const; 53 #endif 54 50 55 float m_size; 51 56 bool m_bold; -
trunk/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
r46124 r46388 21 21 #include "config.h" 22 22 #include "FontPlatformData.h" 23 24 #include "PlatformString.h" 23 25 24 26 namespace WebCore { … … 79 81 } 80 82 83 #ifndef NDEBUG 84 String FontPlatformData::description() const 85 { 86 return String(); 81 87 } 88 #endif 89 90 } -
trunk/WebCore/platform/graphics/win/FontPlatformData.h
r44740 r46388 40 40 41 41 class FontDescription; 42 class String; 42 43 43 44 class FontPlatformData { … … 108 109 } 109 110 111 #ifndef NDEBUG 112 String description() const; 113 #endif 114 110 115 private: 111 116 class RefCountedHFONT : public RefCounted<RefCountedHFONT> { -
trunk/WebCore/platform/graphics/win/FontPlatformDataWin.cpp
r44628 r46388 86 86 } 87 87 88 #ifndef NDEBUG 89 String FontPlatformData::description() const 90 { 91 return String(); 88 92 } 93 #endif 94 95 } -
trunk/WebCore/platform/graphics/wince/FontPlatformData.cpp
r46196 r46388 25 25 #include "FontCache.h" 26 26 #include "FontData.h" 27 #include "PlatformString.h" 27 28 #include "SimpleFontData.h" 28 29 #include "UnicodeRange.h" … … 522 523 } 523 524 524 } 525 525 #ifndef NDEBUG 526 String FontPlatformData::description() const 527 { 528 return String(); 529 } 530 #endif 531 532 } -
trunk/WebCore/platform/graphics/wince/FontPlatformData.h
r46196 r46388 36 36 37 37 class FontPlatformPrivateData; 38 class String; 38 39 39 40 class FontPlatformData { … … 76 77 static const String& defaultFontFamily(); 77 78 static LONG adjustedGDIFontWeight(LONG gdiFontWeight, const String& family); 79 80 #ifndef NDEBUG 81 String description() const; 82 #endif 83 78 84 private: 79 85 FontPlatformPrivateData* m_private; -
trunk/WebCore/platform/graphics/wx/FontPlatformData.h
r41044 r46388 40 40 41 41 namespace WebCore { 42 43 class String; 42 44 43 45 class FontHolder: public WTF::RefCounted<FontHolder> … … 112 114 bool isHashTableDeletedValue() const { return m_fontState == DELETED; } 113 115 114 116 #ifndef NDEBUG 117 String description() const; 118 #endif 115 119 116 120 private: -
trunk/WebCore/platform/graphics/wx/FontPlatformDataWx.cpp
r40965 r46388 28 28 29 29 #include "FontDescription.h" 30 30 #include "PlatformString.h" 31 31 #include <wx/defs.h> 32 32 #include <wx/gdicmn.h> … … 123 123 } 124 124 125 #ifndef NDEBUG 126 String FontPlatformData::description() const 127 { 128 return String(); 125 129 } 130 #endif 131 132 }
Note: See TracChangeset
for help on using the changeset viewer.