aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkXfermodeU64.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-04-12 10:32:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-12 10:32:56 -0700
commit0a74c9d86c7a2fb32184c109170d1946a2cff02d (patch)
tree4c2951f0fb6dd808676f7d24809c506f1b4c6a76 /src/core/SkXfermodeU64.cpp
parent68d9134bec16e91c4a6cde071bcaa579bc0801a7 (diff)
f16 and pm4f are always the same swizzle, so remove adaptor
Diffstat (limited to 'src/core/SkXfermodeU64.cpp')
-rw-r--r--src/core/SkXfermodeU64.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/core/SkXfermodeU64.cpp b/src/core/SkXfermodeU64.cpp
index 630a9d0683..2cf3e1b97e 100644
--- a/src/core/SkXfermodeU64.cpp
+++ b/src/core/SkXfermodeU64.cpp
@@ -50,15 +50,6 @@ template <DstType D> uint64_t store_to_dst(const Sk4f& x4) {
return (D == kU16_Dst) ? store_to_u16(x4) : SkFloatToHalf_01(x4);
}
-static inline Sk4f pm_to_rgba_order(const Sk4f& x) {
- if (SkPM4f::R == 0) {
- return x; // we're already RGBA
- } else {
- // we're BGRA, so swap R and B
- return SkNx_shuffle<2, 1, 0, 3>(x);
- }
-}
-
///////////////////////////////////////////////////////////////////////////////////////////////////
template <DstType D> void xfer_u64_1(const SkXfermode* xfer, uint64_t dst[],
@@ -135,7 +126,7 @@ const SkXfermode::D64Proc gProcs_Clear[] = {
template <DstType D> void src_1(const SkXfermode*, uint64_t dst[],
const SkPM4f* src, int count, const SkAlpha aa[]) {
- const Sk4f s4 = pm_to_rgba_order(unit_to_bias<D>(Sk4f::Load(src->fVec)));
+ const Sk4f s4 = unit_to_bias<D>(Sk4f::Load(src->fVec));
if (aa) {
for (int i = 0; i < count; ++i) {
const Sk4f d4 = load_from_dst<D>(dst[i]);
@@ -150,13 +141,13 @@ template <DstType D> void src_n(const SkXfermode*, uint64_t dst[],
const SkPM4f src[], int count, const SkAlpha aa[]) {
if (aa) {
for (int i = 0; i < count; ++i) {
- const Sk4f s4 = pm_to_rgba_order(unit_to_bias<D>(Sk4f::Load(src[i].fVec)));
+ const Sk4f s4 = unit_to_bias<D>(Sk4f::Load(src[i].fVec));
const Sk4f d4 = load_from_dst<D>(dst[i]);
dst[i] = store_to_dst<D>(lerp_by_coverage(s4, d4, aa[i]));
}
} else {
for (int i = 0; i < count; ++i) {
- const Sk4f s4 = pm_to_rgba_order(unit_to_bias<D>(Sk4f::Load(src[i].fVec)));
+ const Sk4f s4 = unit_to_bias<D>(Sk4f::Load(src[i].fVec));
dst[i] = store_to_dst<D>(s4);
}
}
@@ -181,7 +172,7 @@ const SkXfermode::D64Proc gProcs_Dst[] = {
template <DstType D> void srcover_1(const SkXfermode*, uint64_t dst[],
const SkPM4f* src, int count, const SkAlpha aa[]) {
- const Sk4f s4 = pm_to_rgba_order(Sk4f::Load(src->fVec));
+ const Sk4f s4 = Sk4f::Load(src->fVec);
const Sk4f dst_scale = Sk4f(1 - get_alpha(s4));
const Sk4f s4bias = unit_to_bias<D>(s4);
for (int i = 0; i < count; ++i) {
@@ -198,7 +189,7 @@ template <DstType D> void srcover_1(const SkXfermode*, uint64_t dst[],
template <DstType D> void srcover_n(const SkXfermode*, uint64_t dst[],
const SkPM4f src[], int count, const SkAlpha aa[]) {
for (int i = 0; i < count; ++i) {
- const Sk4f s4 = pm_to_rgba_order(Sk4f::Load(src[i].fVec));
+ const Sk4f s4 = Sk4f::Load(src[i].fVec);
const Sk4f dst_scale = Sk4f(1 - get_alpha(s4));
const Sk4f s4bias = unit_to_bias<D>(s4);
const Sk4f d4bias = load_from_dst<D>(dst[i]);