Index: Source/platform/fonts/SimpleFontData.cpp |
diff --git a/Source/platform/fonts/SimpleFontData.cpp b/Source/platform/fonts/SimpleFontData.cpp |
index da13c13985b10d54f2ae08a6f0b9b2a019ead071..e358899123dbe87c480fe1fd27dcd87364d79326 100644 |
--- a/Source/platform/fonts/SimpleFontData.cpp |
+++ b/Source/platform/fonts/SimpleFontData.cpp |
@@ -160,8 +160,10 @@ const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const |
Glyph SimpleFontData::glyphForCharacter(UChar32 character) const |
{ |
- GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, character / GlyphPage::size); |
- return node->page() ? node->page()->glyphAt(character % GlyphPage::size) : 0; |
+ // As GlyphPage::size is power of 2 so shifting is valid |
+ 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
|
+ GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, val); |
+ 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
|
} |
bool SimpleFontData::isSegmented() const |