diff options
Diffstat (limited to 'include/core/SkDither.h')
-rw-r--r-- | include/core/SkDither.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/include/core/SkDither.h b/include/core/SkDither.h index 692c7e4850..d82b4167b5 100644 --- a/include/core/SkDither.h +++ b/include/core/SkDither.h @@ -71,7 +71,7 @@ static inline SkPMColor SkDitherARGB32For565(SkPMColor c, unsigned dither) { SkASSERT(dither <= SK_DitherValueMax565); - + unsigned sa = SkGetPackedA32(c); dither = SkAlphaMul(dither, SkAlpha255To256(sa)); @@ -81,21 +81,21 @@ static inline SkPMColor SkDitherARGB32For565(SkPMColor c, unsigned dither) sr = SkDITHER_R32_FOR_565(sr, dither); sg = SkDITHER_G32_FOR_565(sg, dither); sb = SkDITHER_B32_FOR_565(sb, dither); - + return SkPackARGB32(sa, sr, sg, sb); } static inline SkPMColor SkDitherRGB32For565(SkPMColor c, unsigned dither) { SkASSERT(dither <= SK_DitherValueMax565); - + unsigned sr = SkGetPackedR32(c); unsigned sg = SkGetPackedG32(c); unsigned sb = SkGetPackedB32(c); sr = SkDITHER_R32_FOR_565(sr, dither); sg = SkDITHER_G32_FOR_565(sg, dither); sb = SkDITHER_B32_FOR_565(sb, dither); - + return SkPackARGB32(0xFF, sr, sg, sb); } @@ -112,29 +112,29 @@ static inline uint16_t SkDitherRGBTo565(U8CPU r, U8CPU g, U8CPU b, static inline uint16_t SkDitherRGB32To565(SkPMColor c, unsigned dither) { SkASSERT(dither <= SK_DitherValueMax565); - + unsigned sr = SkGetPackedR32(c); unsigned sg = SkGetPackedG32(c); unsigned sb = SkGetPackedB32(c); sr = SkDITHER_R32To565(sr, dither); sg = SkDITHER_G32To565(sg, dither); sb = SkDITHER_B32To565(sb, dither); - + return SkPackRGB16(sr, sg, sb); } static inline uint16_t SkDitherARGB32To565(U8CPU sa, SkPMColor c, unsigned dither) { - SkASSERT(dither <= SK_DitherValueMax565); + SkASSERT(dither <= SK_DitherValueMax565); dither = SkAlphaMul(dither, SkAlpha255To256(sa)); - + unsigned sr = SkGetPackedR32(c); unsigned sg = SkGetPackedG32(c); unsigned sb = SkGetPackedB32(c); sr = SkDITHER_R32To565(sr, dither); sg = SkDITHER_G32To565(sg, dither); sb = SkDITHER_B32To565(sb, dither); - + return SkPackRGB16(sr, sg, sb); } @@ -149,7 +149,7 @@ static inline SkPMColor16 SkDitherARGB32To4444(U8CPU a, U8CPU r, U8CPU g, r = SkDITHER_R32To4444(r, dither); g = SkDITHER_G32To4444(g, dither); b = SkDITHER_B32To4444(b, dither); - + return SkPackARGB4444(a, r, g, b); } @@ -166,7 +166,7 @@ static inline SkPMColor16 SkDitherARGB32To4444(SkPMColor c, unsigned dither) r = SkDITHER_R32To4444(r, dither); g = SkDITHER_G32To4444(g, dither); b = SkDITHER_B32To4444(b, dither); - + return SkPackARGB4444(a, r, g, b); } |