Chromium Code Reviews| 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 int val = character >> 8; |
|
jungshik at Google
2014/04/07 17:13:58
Hmm... compiler was not smart enough? (GlyphPage:
Stephen Chennney
2014/04/07 18:02:49
This hard bakes GlyphPage::size to 256.
At a mini
hj
2014/04/08 02:56:50
Okey, will make changes. as per the shared links w
| |
| 165 GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, val); | |
| 166 return node->page() ? node->page()->glyphAt(character - (val << 8)) : 0; | |
|
Stephen Chennney
2014/04/07 18:02:49
character - (val << 8) would be better implemented
hj
2014/04/08 02:56:50
Thank you, will make required changes.
On 2014/04
| |
| 165 } | 167 } |
| 166 | 168 |
| 167 bool SimpleFontData::isSegmented() const | 169 bool SimpleFontData::isSegmented() const |
| 168 { | 170 { |
| 169 return false; | 171 return false; |
| 170 } | 172 } |
| 171 | 173 |
| 172 PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData() co nst | 174 PassRefPtr<SimpleFontData> SimpleFontData::verticalRightOrientationFontData() co nst |
| 173 { | 175 { |
| 174 if (!m_derivedFontData) | 176 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 | 260 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri ption& fontDescription, float scaleFactor) const |
| 259 { | 261 { |
| 260 // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general th is should be achievable. | 262 // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general th is should be achievable. |
| 261 if (isSVGFont()) | 263 if (isSVGFont()) |
| 262 return nullptr; | 264 return nullptr; |
| 263 | 265 |
| 264 return platformCreateScaledFontData(fontDescription, scaleFactor); | 266 return platformCreateScaledFontData(fontDescription, scaleFactor); |
| 265 } | 267 } |
| 266 | 268 |
| 267 } // namespace WebCore | 269 } // namespace WebCore |
| OLD | NEW |