| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef SkSizeHash_h | 26 #ifndef SkSizeHash_h |
| 27 #define SkSizeHash_h | 27 #define SkSizeHash_h |
| 28 | 28 |
| 29 #include "SkScalar.h" | 29 #include "SkScalar.h" |
| 30 #include "SkSize.h" | 30 #include "SkSize.h" |
| 31 | 31 |
| 32 #include "wtf/HashMap.h" | 32 #include "platform/wtf/HashMap.h" |
| 33 | 33 |
| 34 namespace WTF { | 34 namespace WTF { |
| 35 | 35 |
| 36 template <> | 36 template <> |
| 37 struct DefaultHash<SkSize> { | 37 struct DefaultHash<SkSize> { |
| 38 STATIC_ONLY(DefaultHash); | 38 STATIC_ONLY(DefaultHash); |
| 39 struct Hash { | 39 struct Hash { |
| 40 STATIC_ONLY(Hash); | 40 STATIC_ONLY(Hash); |
| 41 static unsigned hash(const SkSize& key) { | 41 static unsigned hash(const SkSize& key) { |
| 42 return hashInts(key.width(), key.height()); | 42 return hashInts(key.width(), key.height()); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 slot = SkISize::Make(-1, -1); | 81 slot = SkISize::Make(-1, -1); |
| 82 } | 82 } |
| 83 static bool isDeletedValue(const SkISize& value) { | 83 static bool isDeletedValue(const SkISize& value) { |
| 84 return value.width() == -1 && value.height() == -1; | 84 return value.width() == -1 && value.height() == -1; |
| 85 } | 85 } |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace WTF | 88 } // namespace WTF |
| 89 | 89 |
| 90 #endif // SkSizeHash_h | 90 #endif // SkSizeHash_h |
| OLD | NEW |