Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(782)

Side by Side Diff: src/core/SkUtils.h

Issue 1808963005: 4f linear gradient shader blitters (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rename trunc_from_255 to quiet confused msvc Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkPixmap.cpp ('k') | src/core/SkXfermodeU64.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/core/SkPixmap.cpp ('k') | src/core/SkXfermodeU64.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698