OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 for (size_t i = 0; i < size; ++i) { | 167 for (size_t i = 0; i < size; ++i) { |
168 if (m_perGlyphFontData[i] == fontData) { | 168 if (m_perGlyphFontData[i] == fontData) { |
169 m_glyphs[i] = 0; | 169 m_glyphs[i] = 0; |
170 m_perGlyphFontData[i] = 0; | 170 m_perGlyphFontData[i] = 0; |
171 } | 171 } |
172 } | 172 } |
173 } | 173 } |
174 | 174 |
175 GlyphPageTreeNode* owner() const { return m_owner; } | 175 GlyphPageTreeNode* owner() const { return m_owner; } |
176 | 176 |
177 // Implemented by the platform. | |
178 bool fill(unsigned offset, unsigned length, UChar* characterBuffer, unsigned
bufferLength, const SimpleFontData*); | |
179 | |
180 private: | 177 private: |
181 explicit GlyphPage(GlyphPageTreeNode* owner, const SimpleFontData* fontDataF
orAllGlyphs = 0) | 178 explicit GlyphPage(GlyphPageTreeNode* owner, const SimpleFontData* fontDataF
orAllGlyphs = 0) |
182 : m_fontDataForAllGlyphs(fontDataForAllGlyphs) | 179 : m_fontDataForAllGlyphs(fontDataForAllGlyphs) |
183 , m_owner(owner) | 180 , m_owner(owner) |
184 { | 181 { |
185 memset(m_glyphs, 0, sizeof(m_glyphs)); | 182 memset(m_glyphs, 0, sizeof(m_glyphs)); |
186 if (hasPerGlyphFontData()) | 183 if (hasPerGlyphFontData()) |
187 memset(m_perGlyphFontData, 0, sizeof(SimpleFontData*) * GlyphPage::s
ize); | 184 memset(m_perGlyphFontData, 0, sizeof(SimpleFontData*) * GlyphPage::s
ize); |
188 } | 185 } |
189 | 186 |
190 bool hasPerGlyphFontData() const { return !m_fontDataForAllGlyphs; } | 187 bool hasPerGlyphFontData() const { return !m_fontDataForAllGlyphs; } |
191 | 188 |
192 const SimpleFontData* m_fontDataForAllGlyphs; | 189 const SimpleFontData* m_fontDataForAllGlyphs; |
193 GlyphPageTreeNode* m_owner; | 190 GlyphPageTreeNode* m_owner; |
194 Glyph m_glyphs[size]; | 191 Glyph m_glyphs[size]; |
195 | 192 |
196 // NOTE: This array has (GlyphPage::size) elements if m_fontDataForAllGlyphs
is null. | 193 // NOTE: This array has (GlyphPage::size) elements if m_fontDataForAllGlyphs
is null. |
197 const SimpleFontData* m_perGlyphFontData[0]; | 194 const SimpleFontData* m_perGlyphFontData[0]; |
198 }; | 195 }; |
199 | 196 |
200 #if COMPILER(MSVC) | 197 #if COMPILER(MSVC) |
201 #pragma warning(pop) | 198 #pragma warning(pop) |
202 #endif | 199 #endif |
203 | 200 |
204 } // namespace WebCore | 201 } // namespace WebCore |
205 | 202 |
206 #endif // GlyphPage_h | 203 #endif // GlyphPage_h |
OLD | NEW |