OLD | NEW |
1 #include "SkBlitMask.h" | 1 #include "SkBlitMask.h" |
2 #include "SkColor.h" | 2 #include "SkColor.h" |
3 #include "SkColorPriv.h" | 3 #include "SkColorPriv.h" |
4 | 4 |
5 static void D32_A8_Color(void* SK_RESTRICT dst, size_t dstRB, | 5 static void D32_A8_Color(void* SK_RESTRICT dst, size_t dstRB, |
6 const void* SK_RESTRICT maskPtr, size_t maskRB, | 6 const void* SK_RESTRICT maskPtr, size_t maskRB, |
7 SkColor color, int width, int height) { | 7 SkColor color, int width, int height) { |
8 SkPMColor pmc = SkPreMultiplyColor(color); | 8 SkPMColor pmc = SkPreMultiplyColor(color); |
9 size_t dstOffset = dstRB - (width << 2); | 9 size_t dstOffset = dstRB - (width << 2); |
10 size_t maskOffset = maskRB - width; | 10 size_t maskOffset = maskRB - width; |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // instead of | 346 // instead of |
347 // expand..combine add expand..combine | 347 // expand..combine add expand..combine |
348 // | 348 // |
349 #define EXPAND0(v, m, s) ((v) & (m)) * (s) | 349 #define EXPAND0(v, m, s) ((v) & (m)) * (s) |
350 #define EXPAND1(v, m, s) (((v) >> 8) & (m)) * (s) | 350 #define EXPAND1(v, m, s) (((v) >> 8) & (m)) * (s) |
351 #define COMBINE(e0, e1, m) ((((e0) >> 8) & (m)) | ((e1) & ~(m))) | 351 #define COMBINE(e0, e1, m) ((((e0) >> 8) & (m)) | ((e1) & ~(m))) |
352 | 352 |
353 static void A8_RowProc_Opaque(SkPMColor* SK_RESTRICT dst, | 353 static void A8_RowProc_Opaque(SkPMColor* SK_RESTRICT dst, |
354 const uint8_t* SK_RESTRICT mask, | 354 const uint8_t* SK_RESTRICT mask, |
355 const SkPMColor* SK_RESTRICT src, int count) { | 355 const SkPMColor* SK_RESTRICT src, int count) { |
356 #if 0 // suppress warning | |
357 const uint32_t rbmask = gMask_00FF00FF; | |
358 #endif | |
359 for (int i = 0; i < count; ++i) { | 356 for (int i = 0; i < count; ++i) { |
360 int m = mask[i]; | 357 int m = mask[i]; |
361 if (m) { | 358 if (m) { |
362 m += (m >> 7); | 359 m += (m >> 7); |
363 #if 1 | 360 #if 1 |
364 // this is slightly slower than the expand/combine version, but it | 361 // this is slightly slower than the expand/combine version, but it |
365 // is much closer to the old results, so we use it for now to reduce | 362 // is much closer to the old results, so we use it for now to reduce |
366 // rebaselining. | 363 // rebaselining. |
367 dst[i] = SkAlphaMulQ(src[i], m) + SkAlphaMulQ(dst[i], 256 - m); | 364 dst[i] = SkAlphaMulQ(src[i], m) + SkAlphaMulQ(dst[i], 256 - m); |
368 #else | 365 #else |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 if (flags & kSrcIsOpaque_RowFlag) { | 580 if (flags & kSrcIsOpaque_RowFlag) { |
584 index |= 1; | 581 index |= 1; |
585 } | 582 } |
586 SkASSERT((size_t)index < SK_ARRAY_COUNT(gProcs)); | 583 SkASSERT((size_t)index < SK_ARRAY_COUNT(gProcs)); |
587 return gProcs[index]; | 584 return gProcs[index]; |
588 default: | 585 default: |
589 break; | 586 break; |
590 } | 587 } |
591 return NULL; | 588 return NULL; |
592 } | 589 } |
OLD | NEW |