OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006 Alexey Proskuryakov | 3 * Copyright (C) 2006 Alexey Proskuryakov |
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 GlyphPageTreeNode::pruneTreeFontData(this); | 153 GlyphPageTreeNode::pruneTreeFontData(this); |
154 } | 154 } |
155 | 155 |
156 const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const | 156 const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const |
157 { | 157 { |
158 return this; | 158 return this; |
159 } | 159 } |
160 | 160 |
161 Glyph SimpleFontData::glyphForCharacter(UChar32 character) const | 161 Glyph SimpleFontData::glyphForCharacter(UChar32 character) const |
162 { | 162 { |
163 GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, character /
GlyphPage::size); | 163 // As GlyphPage::size is power of 2 so shifting is valid |
164 return node->page() ? node->page()->glyphAt(character % GlyphPage::size) : 0
; | 164 GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, character >>
GlyphPage::sizeBits); |
| 165 return node->page() ? node->page()->glyphAt(character & 0xFF) : 0; |
165 } | 166 } |
166 | 167 |
167 bool SimpleFontData::isSegmented() const | 168 bool SimpleFontData::isSegmented() const |
168 { | 169 { |
169 return false; | 170 return false; |
170 } | 171 } |
171 | 172 |
172 PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData() co
nst | 173 PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData() co
nst |
173 { | 174 { |
174 if (!m_derivedFontData) | 175 if (!m_derivedFontData) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri
ption& fontDescription, float scaleFactor) const | 259 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri
ption& fontDescription, float scaleFactor) const |
259 { | 260 { |
260 // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general th
is should be achievable. | 261 // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general th
is should be achievable. |
261 if (isSVGFont()) | 262 if (isSVGFont()) |
262 return nullptr; | 263 return nullptr; |
263 | 264 |
264 return platformCreateScaledFontData(fontDescription, scaleFactor); | 265 return platformCreateScaledFontData(fontDescription, scaleFactor); |
265 } | 266 } |
266 | 267 |
267 } // namespace WebCore | 268 } // namespace WebCore |
OLD | NEW |