OLD | NEW |
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 static_assert(sizeof(Sk4px) == 16, "This file uses memcpy / sk_memset32, so exac
t size matters."); | 10 static_assert(sizeof(Sk4px) == 16, "This file uses memcpy / sk_memset32, so exac
t size matters."); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 a[2], a[2], a[2], a[2], | 70 a[2], a[2], a[2], a[2], |
71 a[3], a[3], a[3], a[3]); | 71 a[3], a[3], a[3], a[3]); |
72 } | 72 } |
73 | 73 |
74 inline Sk4px Sk4px::Load2Alphas(const SkAlpha a[2]) { | 74 inline Sk4px Sk4px::Load2Alphas(const SkAlpha a[2]) { |
75 return Sk16b(a[0], a[0], a[0], a[0], | 75 return Sk16b(a[0], a[0], a[0], a[0], |
76 a[1], a[1], a[1], a[1], | 76 a[1], a[1], a[1], a[1], |
77 0,0,0,0, | 77 0,0,0,0, |
78 0,0,0,0); | 78 0,0,0,0); |
79 } | 79 } |
| 80 |
| 81 inline Sk4px Sk4px::zeroAlphas() const { |
| 82 static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); |
| 83 return Sk16b(this->kth< 0>(), this->kth< 1>(), this->kth< 2>(), 0, |
| 84 this->kth< 4>(), this->kth< 5>(), this->kth< 6>(), 0, |
| 85 this->kth< 8>(), this->kth< 9>(), this->kth<10>(), 0, |
| 86 this->kth<12>(), this->kth<13>(), this->kth<14>(), 0); |
| 87 } |
| 88 |
| 89 inline Sk4px Sk4px::zeroColors() const { |
| 90 static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian."); |
| 91 return Sk16b(0,0,0, this->kth< 3>(), |
| 92 0,0,0, this->kth< 7>(), |
| 93 0,0,0, this->kth<11>(), |
| 94 0,0,0, this->kth<15>()); |
| 95 } |
| 96 |
OLD | NEW |