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

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

Issue 2139333002: remove unused parameter to make android happy (when this header is moved to private) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | 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 * 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 #ifndef SkNx_DEFINED 8 #ifndef SkNx_DEFINED
9 #define SkNx_DEFINED 9 #define SkNx_DEFINED
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 }; 103 };
104 104
105 // The N -> N/2 recursion bottoms out at N == 1, a scalar value. 105 // The N -> N/2 recursion bottoms out at N == 1, a scalar value.
106 template <typename T> 106 template <typename T>
107 struct SkNx<1,T> { 107 struct SkNx<1,T> {
108 T fVal; 108 T fVal;
109 109
110 SkNx() = default; 110 SkNx() = default;
111 SkNx(T v) : fVal(v) {} 111 SkNx(T v) : fVal(v) {}
112 112
113 T operator[](int k) const { 113 // Android complains against unused parameters, so we guard it
114 T operator[](int SkDEBUGCODE(k)) const {
114 SkASSERT(k == 0); 115 SkASSERT(k == 0);
115 return fVal; 116 return fVal;
116 } 117 }
117 118
118 static SkNx Load(const void* ptr) { 119 static SkNx Load(const void* ptr) {
119 SkNx v; 120 SkNx v;
120 memcpy(&v, ptr, sizeof(T)); 121 memcpy(&v, ptr, sizeof(T));
121 return v; 122 return v;
122 } 123 }
123 void store(void* ptr) const { memcpy(ptr, &fVal, sizeof(T)); } 124 void store(void* ptr) const { memcpy(ptr, &fVal, sizeof(T)); }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 #include "../opts/SkNx_neon.h" 302 #include "../opts/SkNx_neon.h"
302 #endif 303 #endif
303 304
304 SI void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) { 305 SI void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) {
305 SkNx_cast<uint8_t>(SkNx_join(SkNx_join(a,b), SkNx_join(c,d))).store(p); 306 SkNx_cast<uint8_t>(SkNx_join(SkNx_join(a,b), SkNx_join(c,d))).store(p);
306 } 307 }
307 308
308 #undef SI 309 #undef SI
309 310
310 #endif//SkNx_DEFINED 311 #endif//SkNx_DEFINED
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698