OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 pageZeroRoot = new GlyphPageTreeNode; | 54 pageZeroRoot = new GlyphPageTreeNode; |
55 } | 55 } |
56 | 56 |
57 if (!pageNumber) | 57 if (!pageNumber) |
58 return pageZeroRoot; | 58 return pageZeroRoot; |
59 | 59 |
60 if (GlyphPageTreeNode* foundNode = roots->get(pageNumber)) | 60 if (GlyphPageTreeNode* foundNode = roots->get(pageNumber)) |
61 return foundNode; | 61 return foundNode; |
62 | 62 |
63 GlyphPageTreeNode* node = new GlyphPageTreeNode; | 63 GlyphPageTreeNode* node = new GlyphPageTreeNode; |
64 #ifndef NDEBUG | 64 #if ENABLE(ASSERT) |
65 node->m_pageNumber = pageNumber; | 65 node->m_pageNumber = pageNumber; |
66 #endif | 66 #endif |
67 roots->set(pageNumber, node); | 67 roots->set(pageNumber, node); |
68 return node; | 68 return node; |
69 } | 69 } |
70 | 70 |
71 size_t GlyphPageTreeNode::treeGlyphPageCount() | 71 size_t GlyphPageTreeNode::treeGlyphPageCount() |
72 { | 72 { |
73 size_t count = 0; | 73 size_t count = 0; |
74 if (roots) { | 74 if (roots) { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 return foundChild; | 315 return foundChild; |
316 | 316 |
317 GlyphPageTreeNode* child = new GlyphPageTreeNode; | 317 GlyphPageTreeNode* child = new GlyphPageTreeNode; |
318 child->m_parent = this; | 318 child->m_parent = this; |
319 child->m_level = m_level + 1; | 319 child->m_level = m_level + 1; |
320 if (fontData && fontData->isCustomFont()) { | 320 if (fontData && fontData->isCustomFont()) { |
321 for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent) | 321 for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent) |
322 curr->m_customFontCount++; | 322 curr->m_customFontCount++; |
323 } | 323 } |
324 | 324 |
325 #ifndef NDEBUG | 325 #if ENABLE(ASSERT) |
326 child->m_pageNumber = m_pageNumber; | 326 child->m_pageNumber = m_pageNumber; |
327 #endif | 327 #endif |
328 if (fontData) { | 328 if (fontData) { |
329 m_children.set(fontData, adoptPtr(child)); | 329 m_children.set(fontData, adoptPtr(child)); |
330 fontData->setMaxGlyphPageTreeLevel(max(fontData->maxGlyphPageTreeLevel()
, child->m_level)); | 330 fontData->setMaxGlyphPageTreeLevel(max(fontData->maxGlyphPageTreeLevel()
, child->m_level)); |
331 } else { | 331 } else { |
332 m_systemFallbackChild = adoptPtr(child); | 332 m_systemFallbackChild = adoptPtr(child); |
333 child->m_isSystemFallback = true; | 333 child->m_isSystemFallback = true; |
334 } | 334 } |
335 child->initializePage(fontData, pageNumber); | 335 child->initializePage(fontData, pageNumber); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 printf("\nPage %d:\n", it->key); | 414 printf("\nPage %d:\n", it->key); |
415 showGlyphPageTree(it->key); | 415 showGlyphPageTree(it->key); |
416 } | 416 } |
417 } | 417 } |
418 | 418 |
419 void showGlyphPageTree(unsigned pageNumber) | 419 void showGlyphPageTree(unsigned pageNumber) |
420 { | 420 { |
421 WebCore::GlyphPageTreeNode::getRoot(pageNumber)->showSubtree(); | 421 WebCore::GlyphPageTreeNode::getRoot(pageNumber)->showSubtree(); |
422 } | 422 } |
423 #endif | 423 #endif |
OLD | NEW |