Chromium Code Reviews| Index: src/core/SkColor.cpp |
| diff --git a/src/core/SkColor.cpp b/src/core/SkColor.cpp |
| index 6fa239ff539399eb0b061348ee0f0170f014cd97..1133e53f2538d2cac83b467fd2cd8a05709c837f 100644 |
| --- a/src/core/SkColor.cpp |
| +++ b/src/core/SkColor.cpp |
| @@ -19,6 +19,18 @@ SkPMColor SkPreMultiplyColor(SkColor c) { |
| SkColorGetG(c), SkColorGetB(c)); |
| } |
| +/** |
| + * Interprets c as an unpremultiplied color, and returns the |
| + * premultiplied equivalent. |
| + */ |
| +SkPMColor SkPreMultiplyUnPMColor(SkPMColor c) { |
|
reed1
2013/06/13 19:33:07
Since there is no header for this method, and it i
scroggo
2013/06/13 20:10:40
Done.
|
| + U8CPU a = SkGetPackedA32(c); |
| + U8CPU r = SkGetPackedR32(c); |
| + U8CPU g = SkGetPackedG32(c); |
| + U8CPU b = SkGetPackedB32(c); |
| + return SkPreMultiplyARGB(a, r, g, b); |
| +} |
| + |
| /////////////////////////////////////////////////////////////////////////////// |
| static inline SkScalar ByteToScalar(U8CPU x) { |