aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkUtils.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-01-04 14:44:20 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-24 18:01:16 +0000
commit57bc1e7bc804be4779dd09409046f62c4d43e3cd (patch)
tree039d2d3f2b9eb57d3ba2f9d4f68d0f25585335e6 /src/core/SkUtils.cpp
parentaee504beb2185e7297b30c02a1541d1306196416 (diff)
move sk_memset16,32,64 out-of-line
This helps pick it out on profiles and when debugging. This will have a negligible impact on speed in most cases (small memsets are always fast, large memsets dwarf function call overhead), and clients like Chrome that use link-time optimization should see exactly zero impact. This does however affect code size: it makes libskia 43K smaller on my laptop. Change-Id: I55bdc75b7429a63024ab3b7d55dc1f886bde102a Reviewed-on: https://skia-review.googlesource.com/6589 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkUtils.cpp')
-rw-r--r--src/core/SkUtils.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/SkUtils.cpp b/src/core/SkUtils.cpp
index 85ebb3e29c..311394d70c 100644
--- a/src/core/SkUtils.cpp
+++ b/src/core/SkUtils.cpp
@@ -8,6 +8,22 @@
#include "SkUtils.h"
+void sk_memset16(uint16_t buffer[], uint16_t value, int count) {
+ for (int i = 0; i < count; i++) {
+ buffer[i] = value;
+ }
+}
+void sk_memset32(uint32_t buffer[], uint32_t value, int count) {
+ for (int i = 0; i < count; i++) {
+ buffer[i] = value;
+ }
+}
+void sk_memset64(uint64_t buffer[], uint64_t value, int count) {
+ for (int i = 0; i < count; i++) {
+ buffer[i] = value;
+ }
+}
+
/* 0xxxxxxx 1 total
10xxxxxx // never a leading byte
110xxxxx 2 total