Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: src/core/SkColor.cpp

Issue 1774523002: make pm4f be RGBA always, not pmcolor order (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkColorMatrixFilterRowMajor255.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColor.cpp
diff --git a/src/core/SkColor.cpp b/src/core/SkColor.cpp
index 497c328162acd170147df5b769001a557b9d5fbe..ab6330011978610a999ca1effe02161cbf495ad8 100644
--- a/src/core/SkColor.cpp
+++ b/src/core/SkColor.cpp
@@ -102,12 +102,11 @@ SkColor SkHSVToColor(U8CPU a, const SkScalar hsv[3]) {
}
///////////////////////////////////////////////////////////////////////////////////////////////////
-#include "SkPM4f.h"
-#include "SkNx.h"
+#include "SkPM4fPriv.h"
#include "SkHalf.h"
SkPM4f SkPM4f::FromPMColor(SkPMColor c) {
- Sk4f value = SkNx_cast<float>(Sk4b::Load(&c));
+ Sk4f value = to_4f_rgba(c);
SkPM4f c4;
(value * Sk4f(1.0f / 255)).store(&c4);
return c4;
@@ -171,15 +170,8 @@ SkPM4f SkColor4f::premul() const {
float srcAlpha = src[0]; // need the pinned version of our alpha
src = src * Sk4f(1, srcAlpha, srcAlpha, srcAlpha);
-#ifdef SK_PMCOLOR_IS_BGRA
- // ARGB -> BGRA
- Sk4f dst = SkNx_shuffle<3,2,1,0>(src);
-#else
// ARGB -> RGBA
Sk4f dst = SkNx_shuffle<1,2,3,0>(src);
-#endif
- SkPM4f pm4;
- dst.store(&pm4);
- return pm4;
+ return SkPM4f::From4f(dst);
}
« no previous file with comments | « no previous file | src/core/SkColorMatrixFilterRowMajor255.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698