diff options
author | brianosman <brianosman@google.com> | 2016-06-24 11:55:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-24 11:55:32 -0700 |
commit | e2cddc5342d5aacacce4429441c94d1e0ff67d8c (patch) | |
tree | f6b6b8278d4a7316e380b8709bb4d08140f2011a /src/core/SkPM4f.h | |
parent | 23e9f7c501950ba98dad4fe1c1d834005f9db904 (diff) |
Fix incorrect swizzle on BGRA platforms in filterColor4f path
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2091923003
Review-Url: https://codereview.chromium.org/2091923003
Diffstat (limited to 'src/core/SkPM4f.h')
-rw-r--r-- | src/core/SkPM4f.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/SkPM4f.h b/src/core/SkPM4f.h index e99ddccd8e..f983101f41 100644 --- a/src/core/SkPM4f.h +++ b/src/core/SkPM4f.h @@ -50,6 +50,13 @@ struct SkPM4f { Sk4f to4f_bgra() const { return swizzle_rb(this->to4f()); } Sk4f to4f_pmorder() const { return swizzle_rb_if_bgra(this->to4f()); } + SkPMColor toPMColor() const { + Sk4f value = swizzle_rb_if_bgra(this->to4f()); + SkPMColor result; + SkNx_cast<uint8_t>(value * Sk4f(255) + Sk4f(0.5f)).store(&result); + return result; + } + void toF16(uint16_t[4]) const; uint64_t toF16() const; // 4 float16 values packed into uint64_t |