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 namespace { // See Sk4px.h | 8 namespace { // See Sk4px.h |
9 | 9 |
10 inline Sk4px::Sk4px(SkPMColor px) : INHERITED(_mm_set1_epi32(px)) {} | 10 inline Sk4px Sk4px::DupPMColor(SkPMColor px) { return Sk16b(_mm_set1_epi32(px));
} |
11 | 11 |
12 inline Sk4px Sk4px::Load4(const SkPMColor px[4]) { | 12 inline Sk4px Sk4px::Load4(const SkPMColor px[4]) { |
13 return Sk16b(_mm_loadu_si128((const __m128i*)px)); | 13 return Sk16b(_mm_loadu_si128((const __m128i*)px)); |
14 } | 14 } |
15 inline Sk4px Sk4px::Load2(const SkPMColor px[2]) { | 15 inline Sk4px Sk4px::Load2(const SkPMColor px[2]) { |
16 return Sk16b(_mm_loadl_epi64((const __m128i*)px)); | 16 return Sk16b(_mm_loadl_epi64((const __m128i*)px)); |
17 } | 17 } |
18 inline Sk4px Sk4px::Load1(const SkPMColor px[1]) { return Sk16b(_mm_cvtsi32_si12
8(*px)); } | 18 inline Sk4px Sk4px::Load1(const SkPMColor px[1]) { return Sk16b(_mm_cvtsi32_si12
8(*px)); } |
19 | 19 |
20 inline void Sk4px::store4(SkPMColor px[4]) const { _mm_storeu_si128((__m128i*)px
, this->fVec); } | 20 inline void Sk4px::store4(SkPMColor px[4]) const { _mm_storeu_si128((__m128i*)px
, this->fVec); } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 inline Sk4px Sk4px::zeroColors() const { | 82 inline Sk4px Sk4px::zeroColors() const { |
83 return Sk16b(_mm_and_si128(_mm_set1_epi32(0xFF << SK_A32_SHIFT), this->fVec)
); | 83 return Sk16b(_mm_and_si128(_mm_set1_epi32(0xFF << SK_A32_SHIFT), this->fVec)
); |
84 } | 84 } |
85 | 85 |
86 inline Sk4px Sk4px::zeroAlphas() const { | 86 inline Sk4px Sk4px::zeroAlphas() const { |
87 // andnot(a,b) == ~a & b | 87 // andnot(a,b) == ~a & b |
88 return Sk16b(_mm_andnot_si128(_mm_set1_epi32(0xFF << SK_A32_SHIFT), this->fV
ec)); | 88 return Sk16b(_mm_andnot_si128(_mm_set1_epi32(0xFF << SK_A32_SHIFT), this->fV
ec)); |
89 } | 89 } |
90 | 90 |
91 } // namespace | 91 } // namespace |
OLD | NEW |