| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 unsigned size = m_fontFaces.size(); | 45 unsigned size = m_fontFaces.size(); |
| 46 for (unsigned i = 0; i < size; i++) | 46 for (unsigned i = 0; i < size; i++) |
| 47 m_fontFaces[i]->removedFromSegmentedFontFace(this); | 47 m_fontFaces[i]->removedFromSegmentedFontFace(this); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void CSSSegmentedFontFace::pruneTable() | 50 void CSSSegmentedFontFace::pruneTable() |
| 51 { | 51 { |
| 52 // Make sure the glyph page tree prunes out all uses of this custom font. | 52 // Make sure the glyph page tree prunes out all uses of this custom font. |
| 53 if (m_fontDataTable.isEmpty()) | 53 if (m_fontDataTable.isEmpty()) |
| 54 return; | 54 return; |
| 55 |
| 55 HashMap<unsigned, SegmentedFontData*>::iterator end = m_fontDataTable.end(); | 56 HashMap<unsigned, SegmentedFontData*>::iterator end = m_fontDataTable.end(); |
| 56 for (HashMap<unsigned, SegmentedFontData*>::iterator it = m_fontDataTable.be
gin(); it != end; ++it) | 57 for (HashMap<unsigned, SegmentedFontData*>::iterator it = m_fontDataTable.be
gin(); it != end; ++it) |
| 57 GlyphPageTreeNode::pruneTreeCustomFontData(it->second); | 58 m_fontSelector->retireCustomFont(it->second); |
| 58 deleteAllValues(m_fontDataTable); | 59 |
| 59 m_fontDataTable.clear(); | 60 m_fontDataTable.clear(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 bool CSSSegmentedFontFace::isValid() const | 63 bool CSSSegmentedFontFace::isValid() const |
| 63 { | 64 { |
| 64 // Valid if at least one font face is valid. | 65 // Valid if at least one font face is valid. |
| 65 unsigned size = m_fontFaces.size(); | 66 unsigned size = m_fontFaces.size(); |
| 66 for (unsigned i = 0; i < size; i++) { | 67 for (unsigned i = 0; i < size; i++) { |
| 67 if (m_fontFaces[i]->isValid()) | 68 if (m_fontFaces[i]->isValid()) |
| 68 return true; | 69 return true; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 m_fontDataTable.set(hashKey, fontData); | 120 m_fontDataTable.set(hashKey, fontData); |
| 120 else { | 121 else { |
| 121 delete fontData; | 122 delete fontData; |
| 122 fontData = 0; | 123 fontData = 0; |
| 123 } | 124 } |
| 124 | 125 |
| 125 return fontData; | 126 return fontData; |
| 126 } | 127 } |
| 127 | 128 |
| 128 } | 129 } |
| OLD | NEW |