Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: Source/platform/fonts/GlyphPage.h

Issue 227473005: Performance related change, Optimization for / and % operator. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Commet fixes Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/fonts/SimpleFontData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/GlyphPage.h
diff --git a/Source/platform/fonts/GlyphPage.h b/Source/platform/fonts/GlyphPage.h
index 98812862bef202ef52c385d08af2e62e96294793..47f3fca493316124551fa926fab64bd1b9f11938 100644
--- a/Source/platform/fonts/GlyphPage.h
+++ b/Source/platform/fonts/GlyphPage.h
@@ -98,8 +98,9 @@ public:
~GlyphPage() { }
- static const size_t size = 256; // Covers Latin-1 in a single page.
- static unsigned indexForCharacter(UChar32 c) { return c % GlyphPage::size; }
+ static const unsigned char sizeBits = 8;
+ static const size_t size = (1 << GlyphPage::sizeBits); // Covers Latin-1 in a single page.
+ static unsigned indexForCharacter(UChar32 c) { return c & 0xFF; }
ALWAYS_INLINE GlyphData glyphDataForCharacter(UChar32 c) const
{
« no previous file with comments | « no previous file | Source/platform/fonts/SimpleFontData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698