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

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

Issue 1073863002: Rewrite memset benches, then use results to add a small-N optimization. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: undef Created 5 years, 8 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 | « include/core/SkUtils.h ('k') | no next file » | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkUtils.h" 10 #include "SkUtils.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return proc ? proc : sk_memset32_portable; 127 return proc ? proc : sk_memset32_portable;
128 } 128 }
129 129
130 SkMemcpy32Proc choose_memcpy32() { 130 SkMemcpy32Proc choose_memcpy32() {
131 SkMemcpy32Proc proc = SkMemcpy32GetPlatformProc(); 131 SkMemcpy32Proc proc = SkMemcpy32GetPlatformProc();
132 return proc ? proc : sk_memcpy32_portable; 132 return proc ? proc : sk_memcpy32_portable;
133 } 133 }
134 134
135 } // namespace 135 } // namespace
136 136
137 void sk_memset16(uint16_t dst[], uint16_t value, int count) { 137 void sk_memset16_large(uint16_t dst[], uint16_t value, int count) {
138 SK_DECLARE_STATIC_LAZY_FN_PTR(SkMemset16Proc, proc, choose_memset16); 138 SK_DECLARE_STATIC_LAZY_FN_PTR(SkMemset16Proc, proc, choose_memset16);
139 proc.get()(dst, value, count); 139 proc.get()(dst, value, count);
140 } 140 }
141 141
142 void sk_memset32(uint32_t dst[], uint32_t value, int count) { 142 void sk_memset32_large(uint32_t dst[], uint32_t value, int count) {
143 SK_DECLARE_STATIC_LAZY_FN_PTR(SkMemset32Proc, proc, choose_memset32); 143 SK_DECLARE_STATIC_LAZY_FN_PTR(SkMemset32Proc, proc, choose_memset32);
144 proc.get()(dst, value, count); 144 proc.get()(dst, value, count);
145 } 145 }
146 146
147 void sk_memcpy32(uint32_t dst[], const uint32_t src[], int count) { 147 void sk_memcpy32(uint32_t dst[], const uint32_t src[], int count) {
148 SK_DECLARE_STATIC_LAZY_FN_PTR(SkMemcpy32Proc, proc, choose_memcpy32); 148 SK_DECLARE_STATIC_LAZY_FN_PTR(SkMemcpy32Proc, proc, choose_memcpy32);
149 proc.get()(dst, src, count); 149 proc.get()(dst, src, count);
150 } 150 }
151 151
152 /////////////////////////////////////////////////////////////////////////////// 152 ///////////////////////////////////////////////////////////////////////////////
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 } 413 }
414 } else { 414 } else {
415 char* start = utf8; 415 char* start = utf8;
416 while (utf16 < stop) { 416 while (utf16 < stop) {
417 utf8 += SkUTF8_FromUnichar(SkUTF16_NextUnichar(&utf16), utf8); 417 utf8 += SkUTF8_FromUnichar(SkUTF16_NextUnichar(&utf16), utf8);
418 } 418 }
419 size = utf8 - start; 419 size = utf8 - start;
420 } 420 }
421 return size; 421 return size;
422 } 422 }
OLDNEW
« no previous file with comments | « include/core/SkUtils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698