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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 const SkXfermode* fXfer; | 241 const SkXfermode* fXfer; |
242 uint32_t fFlags; | 242 uint32_t fFlags; |
243 }; | 243 }; |
244 typedef void (*U64Proc1)(const U64State&, uint64_t dst[], const SkPM4f& src, int count, | 244 typedef void (*U64Proc1)(const U64State&, uint64_t dst[], const SkPM4f& src, int count, |
245 const SkAlpha coverage[]); | 245 const SkAlpha coverage[]); |
246 typedef void (*U64ProcN)(const U64State&, uint64_t dst[], const SkPM4f src[] , int count, | 246 typedef void (*U64ProcN)(const U64State&, uint64_t dst[], const SkPM4f src[] , int count, |
247 const SkAlpha coverage[]); | 247 const SkAlpha coverage[]); |
248 static U64Proc1 GetU64Proc1(Mode, uint32_t flags); | 248 static U64Proc1 GetU64Proc1(Mode, uint32_t flags); |
249 static U64ProcN GetU64ProcN(Mode, uint32_t flags); | 249 static U64ProcN GetU64ProcN(Mode, uint32_t flags); |
250 | 250 |
251 enum LCDFlags { | |
252 kSrcIsOpaque_LCDFlag = 1 << 0, // else src(s) may have alpha < 1 | |
253 kSrcIsSingle_LCDFlag = 1 << 1, // else src[count] | |
254 kDstIsLinearInt_LCDFlag = 1 << 2, // else srgb/half-float | |
mtklein
2016/02/18 16:10:20
Ah,
IsLinearInt -> u32 == 8888, u64 = 16161616
| |
255 }; | |
256 typedef void (*LCD32Proc)(uint32_t* dst, const SkPM4f* src, int count, const uint16_t lcd[]); | |
257 typedef void (*LCD64Proc)(uint64_t* dst, const SkPM4f* src, int count, const uint16_t lcd[]); | |
258 static LCD32Proc GetLCD32Proc(uint32_t flags); | |
259 static LCD64Proc GetLCD64Proc(uint32_t) { return nullptr; } | |
260 | |
251 protected: | 261 protected: |
252 SkXfermode() {} | 262 SkXfermode() {} |
253 /** The default implementation of xfer32/xfer16/xferA8 in turn call this | 263 /** The default implementation of xfer32/xfer16/xferA8 in turn call this |
254 method, 1 color at a time (upscaled to a SkPMColor). The default | 264 method, 1 color at a time (upscaled to a SkPMColor). The default |
255 implementation of this method just returns dst. If performance is | 265 implementation of this method just returns dst. If performance is |
256 important, your subclass should override xfer32/xfer16/xferA8 directly. | 266 important, your subclass should override xfer32/xfer16/xferA8 directly. |
257 | 267 |
258 This method will not be called directly by the client, so it need not | 268 This method will not be called directly by the client, so it need not |
259 be implemented if your subclass has overridden xfer32/xfer16/xferA8 | 269 be implemented if your subclass has overridden xfer32/xfer16/xferA8 |
260 */ | 270 */ |
261 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; | 271 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; |
262 | 272 |
263 private: | 273 private: |
264 enum { | 274 enum { |
265 kModeCount = kLastMode + 1 | 275 kModeCount = kLastMode + 1 |
266 }; | 276 }; |
267 | 277 |
268 typedef SkFlattenable INHERITED; | 278 typedef SkFlattenable INHERITED; |
269 }; | 279 }; |
270 | 280 |
271 #endif | 281 #endif |
OLD | NEW |