aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPM4fPriv.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-08 10:09:18 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-08 10:09:18 -0800
commit93bb080503eec5df5674a1bcfe4baaceced799ff (patch)
treef5503b474d579ea5dc9bed06f7996aabf9bf7839 /src/core/SkPM4fPriv.h
parent08e65e718a3464a594e6dfca0351dfed19ac2445 (diff)
make pm4f be RGBA always, not pmcolor order
Diffstat (limited to 'src/core/SkPM4fPriv.h')
-rw-r--r--src/core/SkPM4fPriv.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/SkPM4fPriv.h b/src/core/SkPM4fPriv.h
index b39891ea20..0326eaf33c 100644
--- a/src/core/SkPM4fPriv.h
+++ b/src/core/SkPM4fPriv.h
@@ -5,9 +5,8 @@
* found in the LICENSE file.
*/
-#include "SkPM4f.h"
#include "SkColorPriv.h"
-#include "SkNx.h"
+#include "SkPM4f.h"
static inline float get_alpha(const Sk4f& f4) {
return f4[SkPM4f::A];
@@ -28,6 +27,10 @@ static inline Sk4f to_4f(uint32_t b4) {
return SkNx_cast<float>(Sk4b::Load((const uint8_t*)&b4));
}
+static inline Sk4f to_4f_rgba(uint32_t b4) {
+ return swizzle_rb_if_bgra(to_4f(b4));
+}
+
static inline Sk4f srgb_to_linear(const Sk4f& s4) {
return set_alpha(s4 * s4, get_alpha(s4));
}