| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkUtils_DEFINED | 8 #ifndef SkUtils_DEFINED |
| 9 #define SkUtils_DEFINED | 9 #define SkUtils_DEFINED |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 @param buffer The memory to have value copied into it | 25 @param buffer The memory to have value copied into it |
| 26 @param value The 32bit value to be copied into buffer | 26 @param value The 32bit value to be copied into buffer |
| 27 @param count The number of times value should be copied into the buffer. | 27 @param count The number of times value should be copied into the buffer. |
| 28 */ | 28 */ |
| 29 static inline void sk_memset32(uint32_t buffer[], uint32_t value, int count) { | 29 static inline void sk_memset32(uint32_t buffer[], uint32_t value, int count) { |
| 30 for (int i = 0; i < count; i++) { | 30 for (int i = 0; i < count; i++) { |
| 31 buffer[i] = value; | 31 buffer[i] = value; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 /** Similar to memset(), but it assigns a 64bit value into the buffer. |
| 36 @param buffer The memory to have value copied into it |
| 37 @param value The 64bit value to be copied into buffer |
| 38 @param count The number of times value should be copied into the buffer. |
| 39 */ |
| 40 static inline void sk_memset64(uint64_t buffer[], uint64_t value, int count) { |
| 41 for (int i = 0; i < count; i++) { |
| 42 buffer[i] = value; |
| 43 } |
| 44 } |
| 35 /////////////////////////////////////////////////////////////////////////////// | 45 /////////////////////////////////////////////////////////////////////////////// |
| 36 | 46 |
| 37 #define kMaxBytesInUTF8Sequence 4 | 47 #define kMaxBytesInUTF8Sequence 4 |
| 38 | 48 |
| 39 #ifdef SK_DEBUG | 49 #ifdef SK_DEBUG |
| 40 int SkUTF8_LeadByteToCount(unsigned c); | 50 int SkUTF8_LeadByteToCount(unsigned c); |
| 41 #else | 51 #else |
| 42 #define SkUTF8_LeadByteToCount(c) ((((0xE5 << 24) >> ((unsigned)c >> 4 <<
1)) & 3) + 1) | 52 #define SkUTF8_LeadByteToCount(c) ((((0xE5 << 24) >> ((unsigned)c >> 4 <<
1)) & 3) + 1) |
| 43 #endif | 53 #endif |
| 44 | 54 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if (uni < 0x180B || uni > 0xE01EF) { | 94 if (uni < 0x180B || uni > 0xE01EF) { |
| 85 return false; | 95 return false; |
| 86 } | 96 } |
| 87 if ((uni > 0x180D && uni < 0xFE00) || (uni > 0xFE0F && uni < 0xE0100)) { | 97 if ((uni > 0x180D && uni < 0xFE00) || (uni > 0xFE0F && uni < 0xE0100)) { |
| 88 return false; | 98 return false; |
| 89 } | 99 } |
| 90 return true; | 100 return true; |
| 91 } | 101 } |
| 92 | 102 |
| 93 #endif | 103 #endif |
| OLD | NEW |