OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2009 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 template <> | 104 template <> |
105 inline FloatRect GlyphMetricsMap<FloatRect>::unknownMetrics() { | 105 inline FloatRect GlyphMetricsMap<FloatRect>::unknownMetrics() { |
106 return FloatRect(0, 0, cGlyphSizeUnknown, cGlyphSizeUnknown); | 106 return FloatRect(0, 0, cGlyphSizeUnknown, cGlyphSizeUnknown); |
107 } | 107 } |
108 | 108 |
109 template <class T> | 109 template <class T> |
110 typename GlyphMetricsMap<T>::GlyphMetricsPage* | 110 typename GlyphMetricsMap<T>::GlyphMetricsPage* |
111 GlyphMetricsMap<T>::locatePageSlowCase(unsigned pageNumber) { | 111 GlyphMetricsMap<T>::locatePageSlowCase(unsigned pageNumber) { |
112 GlyphMetricsPage* page; | 112 GlyphMetricsPage* page; |
113 if (!pageNumber) { | 113 if (!pageNumber) { |
114 ASSERT(!m_filledPrimaryPage); | 114 DCHECK(!m_filledPrimaryPage); |
115 page = &m_primaryPage; | 115 page = &m_primaryPage; |
116 m_filledPrimaryPage = true; | 116 m_filledPrimaryPage = true; |
117 } else { | 117 } else { |
118 if (m_pages) { | 118 if (m_pages) { |
119 page = m_pages->at(pageNumber); | 119 page = m_pages->at(pageNumber); |
120 if (page) | 120 if (page) |
121 return page; | 121 return page; |
122 } else { | 122 } else { |
123 m_pages = | 123 m_pages = |
124 WTF::wrapUnique(new HashMap<int, std::unique_ptr<GlyphMetricsPage>>); | 124 WTF::wrapUnique(new HashMap<int, std::unique_ptr<GlyphMetricsPage>>); |
125 } | 125 } |
126 page = new GlyphMetricsPage; | 126 page = new GlyphMetricsPage; |
127 m_pages->set(pageNumber, WTF::wrapUnique(page)); | 127 m_pages->set(pageNumber, WTF::wrapUnique(page)); |
128 } | 128 } |
129 | 129 |
130 // Fill in the whole page with the unknown glyph information. | 130 // Fill in the whole page with the unknown glyph information. |
131 for (unsigned i = 0; i < GlyphMetricsPage::size; i++) | 131 for (unsigned i = 0; i < GlyphMetricsPage::size; i++) |
132 page->setMetricsForIndex(i, unknownMetrics()); | 132 page->setMetricsForIndex(i, unknownMetrics()); |
133 | 133 |
134 return page; | 134 return page; |
135 } | 135 } |
136 | 136 |
137 } // namespace blink | 137 } // namespace blink |
138 | 138 |
139 #endif | 139 #endif |
OLD | NEW |