diff options
author | brianosman <brianosman@google.com> | 2016-06-24 06:31:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-24 06:31:47 -0700 |
commit | e074d1fa6ace83dd77971b971c07166bedeb28ef (patch) | |
tree | ffdbdc9ce69615ca7923b4816343d01fddad7bac /include/core/SkColor.h | |
parent | 7bde5659d354b4ef227c487a4e9fa8de12573c31 (diff) |
Change SkColor4f to RGBA channel order
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2093763003
Review-Url: https://codereview.chromium.org/2093763003
Diffstat (limited to 'include/core/SkColor.h')
-rw-r--r-- | include/core/SkColor.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/core/SkColor.h b/include/core/SkColor.h index a40e5f1f15..e473db486a 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; |