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

Unified Diff: include/core/SkColor.h

Issue 2093763003: Change SkColor4f to RGBA channel order (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reorder Pin arguments, too Created 4 years, 6 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 | « gm/color4f.cpp ('k') | src/core/SkColor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkColor.h
diff --git a/include/core/SkColor.h b/include/core/SkColor.h
index a40e5f1f1588eddbe37bad16f5705acb496f7c13..e473db486ae50ee6a9aee3a2bc1794d023cf1939 100644
--- a/include/core/SkColor.h
+++ b/include/core/SkColor.h
@@ -166,10 +166,10 @@ struct SkPM4f;
* The float values are 0...1 unpremultiplied
*/
struct SkColor4f {
- float fA;
float fR;
float fG;
float fB;
+ float fA;
bool operator==(const SkColor4f& other) const {
return fA == other.fA && fR == other.fR && fG == other.fG && fB == other.fB;
@@ -178,14 +178,16 @@ struct SkColor4f {
return !(*this == other);
}
- const float* vec() const { return &fA; }
- float* vec() { return &fA; }
+ const float* vec() const { return &fR; }
+ float* vec() { return &fR; }
- static SkColor4f Pin(float a, float r, float g, float b);
+ static SkColor4f Pin(float r, float g, float b, float a);
static SkColor4f FromColor(SkColor);
+ SkColor toSkColor() const;
+
SkColor4f pin() const {
- return Pin(fA, fR, fG, fB);
+ return Pin(fR, fG, fB, fA);
}
SkPM4f premul() const;
« no previous file with comments | « gm/color4f.cpp ('k') | src/core/SkColor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698