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) { |
|
bsalomon
2013/06/13 12:24:59
Should we have a new type, SkUPMColor? It wouldn't
reed1
2013/06/13 13:51:39
Who calls this? Is it declared in a public header?
scroggo
2013/06/13 19:04:49
It is called by tests/ImageDecodingTest.cpp and sa
|
| + 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) { |