OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2015 Google Inc. All rights reserved. | 3 * Copyright (C) 2015 Google Inc. All rights reserved. |
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 * 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 11 matching lines...) Expand all Loading... |
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef ShapeCache_h | 27 #ifndef ShapeCache_h |
28 #define ShapeCache_h | 28 #define ShapeCache_h |
29 | 29 |
30 #include "platform/fonts/shaping/ShapeResult.h" | 30 #include "platform/fonts/shaping/ShapeResult.h" |
31 #include "platform/text/TextRun.h" | 31 #include "platform/text/TextRun.h" |
32 #include "wtf/Forward.h" | 32 #include "platform/wtf/Forward.h" |
33 #include "wtf/HashFunctions.h" | 33 #include "platform/wtf/HashFunctions.h" |
34 #include "wtf/HashSet.h" | 34 #include "platform/wtf/HashSet.h" |
35 #include "wtf/HashTableDeletedValueType.h" | 35 #include "platform/wtf/HashTableDeletedValueType.h" |
36 #include "wtf/StringHasher.h" | 36 #include "platform/wtf/StringHasher.h" |
37 #include "wtf/WeakPtr.h" | 37 #include "platform/wtf/WeakPtr.h" |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 struct ShapeCacheEntry { | 41 struct ShapeCacheEntry { |
42 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 42 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
43 ShapeCacheEntry() { m_shapeResult = nullptr; } | 43 ShapeCacheEntry() { m_shapeResult = nullptr; } |
44 RefPtr<const ShapeResult> m_shapeResult; | 44 RefPtr<const ShapeResult> m_shapeResult; |
45 }; | 45 }; |
46 | 46 |
47 class ShapeCache { | 47 class ShapeCache { |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 inline bool operator==(const ShapeCache::SmallStringKey& a, | 250 inline bool operator==(const ShapeCache::SmallStringKey& a, |
251 const ShapeCache::SmallStringKey& b) { | 251 const ShapeCache::SmallStringKey& b) { |
252 if (a.length() != b.length() || a.direction() != b.direction()) | 252 if (a.length() != b.length() || a.direction() != b.direction()) |
253 return false; | 253 return false; |
254 return WTF::equal(a.characters(), b.characters(), a.length()); | 254 return WTF::equal(a.characters(), b.characters(), a.length()); |
255 } | 255 } |
256 | 256 |
257 } // namespace blink | 257 } // namespace blink |
258 | 258 |
259 #endif // ShapeCache_h | 259 #endif // ShapeCache_h |
OLD | NEW |