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 #ifndef Sk4px_DEFINED | 8 #ifndef Sk4px_DEFINED |
9 #define Sk4px_DEFINED | 9 #define Sk4px_DEFINED |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return v.addNarrowHi(v >> 8); | 63 return v.addNarrowHi(v >> 8); |
64 } | 64 } |
65 | 65 |
66 // These just keep the types as Wide so the user doesn't have to keep ca
sting. | 66 // These just keep the types as Wide so the user doesn't have to keep ca
sting. |
67 Wide operator * (const Wide& o) const { return INHERITED::operator*(o);
} | 67 Wide operator * (const Wide& o) const { return INHERITED::operator*(o);
} |
68 Wide operator + (const Wide& o) const { return INHERITED::operator+(o);
} | 68 Wide operator + (const Wide& o) const { return INHERITED::operator+(o);
} |
69 Wide operator - (const Wide& o) const { return INHERITED::operator-(o);
} | 69 Wide operator - (const Wide& o) const { return INHERITED::operator-(o);
} |
70 Wide operator >> (int bits) const { return INHERITED::operator>>(bits);
} | 70 Wide operator >> (int bits) const { return INHERITED::operator>>(bits);
} |
71 Wide operator << (int bits) const { return INHERITED::operator<<(bits);
} | 71 Wide operator << (int bits) const { return INHERITED::operator<<(bits);
} |
72 static Wide Min(const Wide& a, const Wide& b) { return INHERITED::Min(a,
b); } | 72 static Wide Min(const Wide& a, const Wide& b) { return INHERITED::Min(a,
b); } |
| 73 Wide thenElse(const Wide& t, const Wide& e) const { return INHERITED::th
enElse(t,e); } |
73 | 74 |
74 private: | 75 private: |
75 typedef Sk16h INHERITED; | 76 typedef Sk16h INHERITED; |
76 }; | 77 }; |
77 | 78 |
78 Wide widenLo() const; // ARGB -> 0A 0R 0G 0B | 79 Wide widenLo() const; // ARGB -> 0A 0R 0G 0B |
79 Wide widenHi() const; // ARGB -> A0 R0 G0 B0 | 80 Wide widenHi() const; // ARGB -> A0 R0 G0 B0 |
| 81 Wide widenLoHi() const; // ARGB -> AA RR GG BB |
80 Wide mulWiden(const Sk16b&) const; // 8-bit x 8-bit -> 16-bit components. | 82 Wide mulWiden(const Sk16b&) const; // 8-bit x 8-bit -> 16-bit components. |
81 | 83 |
82 // The only 8-bit multiply we use is 8-bit x 8-bit -> 16-bit. Might as well
make it pithy. | 84 // The only 8-bit multiply we use is 8-bit x 8-bit -> 16-bit. Might as well
make it pithy. |
83 Wide operator * (const Sk4px& o) const { return this->mulWiden(o); } | 85 Wide operator * (const Sk4px& o) const { return this->mulWiden(o); } |
84 | 86 |
85 // These just keep the types as Sk4px so the user doesn't have to keep casti
ng. | 87 // These just keep the types as Sk4px so the user doesn't have to keep casti
ng. |
86 Sk4px operator + (const Sk4px& o) const { return INHERITED::operator+(o); } | 88 Sk4px operator + (const Sk4px& o) const { return INHERITED::operator+(o); } |
87 Sk4px operator - (const Sk4px& o) const { return INHERITED::operator-(o); } | 89 Sk4px operator - (const Sk4px& o) const { return INHERITED::operator-(o); } |
88 Sk4px operator < (const Sk4px& o) const { return INHERITED::operator<(o); } | 90 Sk4px operator < (const Sk4px& o) const { return INHERITED::operator<(o); } |
89 Sk4px thenElse(const Sk4px& t, const Sk4px& e) const { return INHERITED::the
nElse(t,e); } | 91 Sk4px thenElse(const Sk4px& t, const Sk4px& e) const { return INHERITED::the
nElse(t,e); } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 197 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
196 #include "../opts/Sk4px_SSE2.h" | 198 #include "../opts/Sk4px_SSE2.h" |
197 #elif defined(SK_ARM_HAS_NEON) | 199 #elif defined(SK_ARM_HAS_NEON) |
198 #include "../opts/Sk4px_NEON.h" | 200 #include "../opts/Sk4px_NEON.h" |
199 #else | 201 #else |
200 #include "../opts/Sk4px_none.h" | 202 #include "../opts/Sk4px_none.h" |
201 #endif | 203 #endif |
202 #endif | 204 #endif |
203 | 205 |
204 #endif//Sk4px_DEFINED | 206 #endif//Sk4px_DEFINED |
OLD | NEW |