Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 #include "wtf/HashTableDeletedValueType.h" | 35 #include "wtf/HashTableDeletedValueType.h" |
| 36 #include "wtf/text/AtomicStringHash.h" | 36 #include "wtf/text/AtomicStringHash.h" |
| 37 #include "wtf/text/StringHash.h" | 37 #include "wtf/text/StringHash.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 // Multiplying the floating point size by 100 gives two decimal point | 41 // Multiplying the floating point size by 100 gives two decimal point |
| 42 // precision which should be sufficient. | 42 // precision which should be sufficient. |
| 43 static const unsigned s_fontSizePrecisionMultiplier = 100; | 43 static const unsigned s_fontSizePrecisionMultiplier = 100; |
| 44 | 44 |
| 45 struct FontCacheKey { | 45 struct PLATFORM_EXPORT FontCacheKey { |
|
abarth-chromium
2013/10/29 05:26:35
Don't we need to #include "platform/PlatformExport
rwlbuis
2013/10/29 18:38:00
Ok, good point.
| |
| 46 WTF_MAKE_FAST_ALLOCATED; | 46 WTF_MAKE_FAST_ALLOCATED; |
| 47 public: | 47 public: |
| 48 FontCacheKey() | 48 FontCacheKey() |
| 49 : m_familyName() | 49 : m_familyName() |
| 50 , m_fontSize(0) | 50 , m_fontSize(0) |
| 51 , m_options(0) { } | 51 , m_options(0) { } |
| 52 FontCacheKey(AtomicString familyName, float fontSize, unsigned options) | 52 FontCacheKey(AtomicString familyName, float fontSize, unsigned options) |
| 53 : m_familyName(familyName) | 53 : m_familyName(familyName) |
| 54 , m_fontSize(fontSize * s_fontSizePrecisionMultiplier) | 54 , m_fontSize(fontSize * s_fontSizePrecisionMultiplier) |
| 55 , m_options(options) { } | 55 , m_options(options) { } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 } | 101 } |
| 102 | 102 |
| 103 static bool equal(const FontCacheKey& a, const FontCacheKey& b) | 103 static bool equal(const FontCacheKey& a, const FontCacheKey& b) |
| 104 { | 104 { |
| 105 return a == b; | 105 return a == b; |
| 106 } | 106 } |
| 107 | 107 |
| 108 static const bool safeToCompareToEmptyOrDeleted = true; | 108 static const bool safeToCompareToEmptyOrDeleted = true; |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 struct FontCacheKeyTraits : WTF::SimpleClassHashTraits<FontCacheKey> { }; | 111 struct PLATFORM_EXPORT FontCacheKeyTraits : WTF::SimpleClassHashTraits<FontCache Key> { }; |
|
abarth-chromium
2013/10/29 05:26:35
This class looks entirely inline. I don't think t
rwlbuis
2013/10/29 18:38:00
Fixed.
| |
| 112 | 112 |
| 113 } | 113 } |
| 114 | 114 |
| 115 #endif // FontCacheKey_h | 115 #endif // FontCacheKey_h |
| OLD | NEW |