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

Unified Diff: src/core/SkXfermodeF16.cpp

Issue 2151023003: Revert of Expand _01 half<->float limitation to _finite. Simplify. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « src/core/SkSpanProcs.cpp ('k') | src/effects/gradients/Sk4fGradientPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkXfermodeF16.cpp
diff --git a/src/core/SkXfermodeF16.cpp b/src/core/SkXfermodeF16.cpp
index 63058f9dce3a5f79e4af54a93d45c01493b6ce18..6ca5519afb8bbbb1879f1d82a78ed6bf3c593505 100644
--- a/src/core/SkXfermodeF16.cpp
+++ b/src/core/SkXfermodeF16.cpp
@@ -22,16 +22,16 @@
SkPM4f d;
if (aa) {
for (int i = 0; i < count; ++i) {
- Sk4f d4 = SkHalfToFloat_finite(dst[i]);
+ Sk4f d4 = SkHalfToFloat_01(dst[i]);
d4.store(d.fVec);
Sk4f r4 = Sk4f::Load(proc(*src, d).fVec);
- dst[i] = SkFloatToHalf_finite(lerp_by_coverage(r4, d4, aa[i]));
+ dst[i] = SkFloatToHalf_01(lerp_by_coverage(r4, d4, aa[i]));
}
} else {
for (int i = 0; i < count; ++i) {
- SkHalfToFloat_finite(dst[i]).store(d.fVec);
+ SkHalfToFloat_01(dst[i]).store(d.fVec);
Sk4f r4 = Sk4f::Load(proc(*src, d).fVec);
- dst[i] = SkFloatToHalf_finite(r4);
+ dst[i] = SkFloatToHalf_01(r4);
}
}
}
@@ -42,16 +42,16 @@
SkPM4f d;
if (aa) {
for (int i = 0; i < count; ++i) {
- Sk4f d4 = SkHalfToFloat_finite(dst[i]);
+ Sk4f d4 = SkHalfToFloat_01(dst[i]);
d4.store(d.fVec);
Sk4f r4 = Sk4f::Load(proc(src[i], d).fVec);
- dst[i] = SkFloatToHalf_finite(lerp_by_coverage(r4, d4, aa[i]));
+ dst[i] = SkFloatToHalf_01(lerp_by_coverage(r4, d4, aa[i]));
}
} else {
for (int i = 0; i < count; ++i) {
- SkHalfToFloat_finite(dst[i]).store(d.fVec);
+ SkHalfToFloat_01(dst[i]).store(d.fVec);
Sk4f r4 = Sk4f::Load(proc(src[i], d).fVec);
- dst[i] = SkFloatToHalf_finite(r4);
+ dst[i] = SkFloatToHalf_01(r4);
}
}
}
@@ -64,8 +64,8 @@
if (aa) {
for (int i = 0; i < count; ++i) {
if (aa[i]) {
- const Sk4f d4 = SkHalfToFloat_finite(dst[i]);
- dst[i] = SkFloatToHalf_finite(d4 * Sk4f((255 - aa[i]) * 1.0f/255));
+ const Sk4f d4 = SkHalfToFloat_01(dst[i]);
+ dst[i] = SkFloatToHalf_01(d4 * Sk4f((255 - aa[i]) * 1.0f/255));
}
}
} else {
@@ -82,11 +82,11 @@
const Sk4f s4 = Sk4f::Load(src->fVec);
if (aa) {
for (int i = 0; i < count; ++i) {
- const Sk4f d4 = SkHalfToFloat_finite(dst[i]);
- dst[i] = SkFloatToHalf_finite(lerp_by_coverage(s4, d4, aa[i]));
+ const Sk4f d4 = SkHalfToFloat_01(dst[i]);
+ dst[i] = SkFloatToHalf_01(lerp_by_coverage(s4, d4, aa[i]));
}
} else {
- sk_memset64(dst, SkFloatToHalf_finite(s4), count);
+ sk_memset64(dst, SkFloatToHalf_01(s4), count);
}
}
@@ -95,13 +95,13 @@
if (aa) {
for (int i = 0; i < count; ++i) {
const Sk4f s4 = Sk4f::Load(src[i].fVec);
- const Sk4f d4 = SkHalfToFloat_finite(dst[i]);
- dst[i] = SkFloatToHalf_finite(lerp_by_coverage(s4, d4, aa[i]));
+ const Sk4f d4 = SkHalfToFloat_01(dst[i]);
+ dst[i] = SkFloatToHalf_01(lerp_by_coverage(s4, d4, aa[i]));
}
} else {
for (int i = 0; i < count; ++i) {
const Sk4f s4 = Sk4f::Load(src[i].fVec);
- dst[i] = SkFloatToHalf_finite(s4);
+ dst[i] = SkFloatToHalf_01(s4);
}
}
}
@@ -121,12 +121,12 @@
const Sk4f s4 = Sk4f::Load(src->fVec);
const Sk4f dst_scale = Sk4f(1 - get_alpha(s4));
for (int i = 0; i < count; ++i) {
- const Sk4f d4 = SkHalfToFloat_finite(dst[i]);
+ const Sk4f d4 = SkHalfToFloat_01(dst[i]);
const Sk4f r4 = s4 + d4 * dst_scale;
if (aa) {
- dst[i] = SkFloatToHalf_finite(lerp_by_coverage(r4, d4, aa[i]));
+ dst[i] = SkFloatToHalf_01(lerp_by_coverage(r4, d4, aa[i]));
} else {
- dst[i] = SkFloatToHalf_finite(r4);
+ dst[i] = SkFloatToHalf_01(r4);
}
}
}
@@ -135,12 +135,12 @@
const SkAlpha aa[]) {
for (int i = 0; i < count; ++i) {
Sk4f s = Sk4f::Load(src+i),
- d = SkHalfToFloat_finite(dst[i]),
+ d = SkHalfToFloat_01(dst[i]),
r = s + d*(1.0f - SkNx_shuffle<3,3,3,3>(s));
if (aa) {
r = lerp_by_coverage(r, d, aa[i]);
}
- dst[i] = SkFloatToHalf_finite(r);
+ dst[i] = SkFloatToHalf_01(r);
}
}
« no previous file with comments | « src/core/SkSpanProcs.cpp ('k') | src/effects/gradients/Sk4fGradientPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698