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

Side by Side Diff: src/opts/Sk4px_none.h

Issue 1202013002: Update some Sk4px APIs. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fix none Created 5 years, 6 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/opts/Sk4px_SSE2.h ('k') | src/opts/SkBlitRow_opts_arm_neon.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 2015 Google Inc. 2 * Copyright 2015 Google Inc.
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 #include "SkUtils.h" 8 #include "SkUtils.h"
9 9
10 namespace { // See Sk4px.h 10 namespace { // See Sk4px.h
11 11
12 static_assert(sizeof(Sk4px) == 16, "This file uses memcpy / sk_memset32, so exac t size matters."); 12 static_assert(sizeof(Sk4px) == 16, "This file uses memcpy / sk_memset32, so exac t size matters.");
13 13
14 inline Sk4px::Sk4px(SkPMColor px) { 14 inline Sk4px Sk4px::DupPMColor(SkPMColor px) {
15 sk_memset32((uint32_t*)this, px, 4); 15 Sk4px px4 = Sk16b();
16 sk_memset32((uint32_t*)&px4, px, 4);
17 return px4;
16 } 18 }
17 19
18 inline Sk4px Sk4px::Load4(const SkPMColor px[4]) { 20 inline Sk4px Sk4px::Load4(const SkPMColor px[4]) {
19 Sk4px px4 = Sk16b(); 21 Sk4px px4 = Sk16b();
20 memcpy(&px4, px, 16); 22 memcpy(&px4, px, 16);
21 return px4; 23 return px4;
22 } 24 }
23 25
24 inline Sk4px Sk4px::Load2(const SkPMColor px[2]) { 26 inline Sk4px Sk4px::Load2(const SkPMColor px[2]) {
25 Sk4px px2 = Sk16b(); 27 Sk4px px2 = Sk16b();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 92
91 inline Sk4px Sk4px::zeroColors() const { 93 inline Sk4px Sk4px::zeroColors() const {
92 static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); 94 static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
93 return Sk16b(0,0,0, this->kth< 3>(), 95 return Sk16b(0,0,0, this->kth< 3>(),
94 0,0,0, this->kth< 7>(), 96 0,0,0, this->kth< 7>(),
95 0,0,0, this->kth<11>(), 97 0,0,0, this->kth<11>(),
96 0,0,0, this->kth<15>()); 98 0,0,0, this->kth<15>());
97 } 99 }
98 100
99 } // namespace 101 } // namespace
OLDNEW
« no previous file with comments | « src/opts/Sk4px_SSE2.h ('k') | src/opts/SkBlitRow_opts_arm_neon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698