OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkXfermode_DEFINED | 10 #ifndef SkXfermode_DEFINED |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 }; | 239 }; |
240 typedef void (*PM4fProc1)(const PM4fState&, uint32_t dst[], const SkPM4f& sr
c, | 240 typedef void (*PM4fProc1)(const PM4fState&, uint32_t dst[], const SkPM4f& sr
c, |
241 int count, const SkAlpha coverage[]); | 241 int count, const SkAlpha coverage[]); |
242 typedef void (*PM4fProcN)(const PM4fState&, uint32_t dst[], const SkPM4f src
[], | 242 typedef void (*PM4fProcN)(const PM4fState&, uint32_t dst[], const SkPM4f src
[], |
243 int count, const SkAlpha coverage[]); | 243 int count, const SkAlpha coverage[]); |
244 static PM4fProc1 GetPM4fProc1(Mode, uint32_t flags); | 244 static PM4fProc1 GetPM4fProc1(Mode, uint32_t flags); |
245 static PM4fProcN GetPM4fProcN(Mode, uint32_t flags); | 245 static PM4fProcN GetPM4fProcN(Mode, uint32_t flags); |
246 virtual PM4fProc1 getPM4fProc1(uint32_t flags) const; | 246 virtual PM4fProc1 getPM4fProc1(uint32_t flags) const; |
247 virtual PM4fProcN getPM4fProcN(uint32_t flags) const; | 247 virtual PM4fProcN getPM4fProcN(uint32_t flags) const; |
248 | 248 |
| 249 enum U64Flags { |
| 250 kSrcIsOpaque_U64Flag = 1 << 0, |
| 251 kDstIsFloat16_U64Flag = 1 << 1, // else U16 bit components |
| 252 }; |
| 253 struct U64State { |
| 254 const SkXfermode* fXfer; |
| 255 uint32_t fFlags; |
| 256 }; |
| 257 typedef void (*U64Proc1)(const U64State&, uint64_t dst[], const SkPM4f& src,
int count, |
| 258 const SkAlpha coverage[]); |
| 259 typedef void (*U64ProcN)(const U64State&, uint64_t dst[], const SkPM4f src[]
, int count, |
| 260 const SkAlpha coverage[]); |
| 261 static U64Proc1 GetU64Proc1(Mode, uint32_t flags); |
| 262 static U64ProcN GetU64ProcN(Mode, uint32_t flags); |
| 263 |
249 protected: | 264 protected: |
250 SkXfermode() {} | 265 SkXfermode() {} |
251 /** The default implementation of xfer32/xfer16/xferA8 in turn call this | 266 /** The default implementation of xfer32/xfer16/xferA8 in turn call this |
252 method, 1 color at a time (upscaled to a SkPMColor). The default | 267 method, 1 color at a time (upscaled to a SkPMColor). The default |
253 implementation of this method just returns dst. If performance is | 268 implementation of this method just returns dst. If performance is |
254 important, your subclass should override xfer32/xfer16/xferA8 directly. | 269 important, your subclass should override xfer32/xfer16/xferA8 directly. |
255 | 270 |
256 This method will not be called directly by the client, so it need not | 271 This method will not be called directly by the client, so it need not |
257 be implemented if your subclass has overridden xfer32/xfer16/xferA8 | 272 be implemented if your subclass has overridden xfer32/xfer16/xferA8 |
258 */ | 273 */ |
259 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; | 274 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; |
260 | 275 |
261 private: | 276 private: |
262 enum { | 277 enum { |
263 kModeCount = kLastMode + 1 | 278 kModeCount = kLastMode + 1 |
264 }; | 279 }; |
265 | 280 |
266 typedef SkFlattenable INHERITED; | 281 typedef SkFlattenable INHERITED; |
267 }; | 282 }; |
268 | 283 |
269 #endif | 284 #endif |
OLD | NEW |