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 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 /////////////////////////////////////////////////////////////////////////////// | 13 /////////////////////////////////////////////////////////////////////////////// |
14 | 14 |
15 /** Similar to memset(), but it assigns a 16bit value into the buffer. | 15 /** Similar to memset(), but it assigns a 16bit value into the buffer. |
16 @param buffer The memory to have value copied into it | 16 @param buffer The memory to have value copied into it |
17 @param value The 16bit value to be copied into buffer | 17 @param value The 16bit value to be copied into buffer |
18 @param count The number of times value should be copied into the buffer. | 18 @param count The number of times value should be copied into the buffer. |
19 */ | 19 */ |
20 void sk_memset16_portable(uint16_t dst[], uint16_t value, int count); | 20 void sk_memset16(uint16_t dst[], uint16_t value, int count); |
21 typedef void (*SkMemset16Proc)(uint16_t dst[], uint16_t value, int count); | 21 typedef void (*SkMemset16Proc)(uint16_t dst[], uint16_t value, int count); |
22 SkMemset16Proc SkMemset16GetPlatformProc(); | 22 SkMemset16Proc SkMemset16GetPlatformProc(); |
23 | 23 |
24 /** Similar to memset(), but it assigns a 32bit value into the buffer. | 24 /** Similar to memset(), but it assigns a 32bit value into the buffer. |
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 void sk_memset32_portable(uint32_t dst[], uint32_t value, int count); | 29 void sk_memset32(uint32_t dst[], uint32_t value, int count); |
30 typedef void (*SkMemset32Proc)(uint32_t dst[], uint32_t value, int count); | 30 typedef void (*SkMemset32Proc)(uint32_t dst[], uint32_t value, int count); |
31 SkMemset32Proc SkMemset32GetPlatformProc(); | 31 SkMemset32Proc SkMemset32GetPlatformProc(); |
32 | 32 |
33 #ifndef sk_memset16 | |
34 extern SkMemset16Proc sk_memset16; | |
35 #endif | |
36 | |
37 #ifndef sk_memset32 | |
38 extern SkMemset32Proc sk_memset32; | |
39 #endif | |
40 | |
41 /////////////////////////////////////////////////////////////////////////////// | 33 /////////////////////////////////////////////////////////////////////////////// |
42 | 34 |
43 #define kMaxBytesInUTF8Sequence 4 | 35 #define kMaxBytesInUTF8Sequence 4 |
44 | 36 |
45 #ifdef SK_DEBUG | 37 #ifdef SK_DEBUG |
46 int SkUTF8_LeadByteToCount(unsigned c); | 38 int SkUTF8_LeadByteToCount(unsigned c); |
47 #else | 39 #else |
48 #define SkUTF8_LeadByteToCount(c) ((((0xE5 << 24) >> ((unsigned)c >> 4 <<
1)) & 3) + 1) | 40 #define SkUTF8_LeadByteToCount(c) ((((0xE5 << 24) >> ((unsigned)c >> 4 <<
1)) & 3) + 1) |
49 #endif | 41 #endif |
50 | 42 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 100 } |
109 ~SkAutoTrace() { | 101 ~SkAutoTrace() { |
110 SkDebugf("--- trace: %s Leave\n", fLabel); | 102 SkDebugf("--- trace: %s Leave\n", fLabel); |
111 } | 103 } |
112 private: | 104 private: |
113 const char* fLabel; | 105 const char* fLabel; |
114 }; | 106 }; |
115 #define SkAutoTrace(...) SK_REQUIRE_LOCAL_VAR(SkAutoTrace) | 107 #define SkAutoTrace(...) SK_REQUIRE_LOCAL_VAR(SkAutoTrace) |
116 | 108 |
117 #endif | 109 #endif |
OLD | NEW |