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

Unified Diff: src/core/SkXfermodeF16.cpp

Issue 1897433002: Revert of skcpu: sse4.1 floor, f16c f16<->f32 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/SkHalf.h ('k') | src/opts/SkNx_sse.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 2c6873f764e748092c40a0b09f82dc1409547a00..dfcefa2de5ba4df925b4b7b0f5df349b5722a0bf 100644
--- a/src/core/SkXfermodeF16.cpp
+++ b/src/core/SkXfermodeF16.cpp
@@ -134,13 +134,15 @@
static void srcover_n(const SkXfermode*, uint64_t dst[], const SkPM4f src[], int count,
const SkAlpha aa[]) {
for (int i = 0; i < count; ++i) {
- Sk4f s = Sk4f::Load(src+i),
- d = SkHalfToFloat_01(dst+i),
- r = s + d*(1.0f - SkNx_shuffle<3,3,3,3>(s));
+ const Sk4f s4 = Sk4f::Load(src[i].fVec);
+ const Sk4f dst_scale = Sk4f(1 - get_alpha(s4));
+ const Sk4f d4 = SkHalfToFloat_01(dst[i]);
+ const Sk4f r4 = s4 + d4 * dst_scale;
if (aa) {
- r = lerp_by_coverage(r, d, aa[i]);
+ dst[i] = SkFloatToHalf_01(lerp_by_coverage(r4, d4, aa[i]));
+ } else {
+ dst[i] = SkFloatToHalf_01(r4);
}
- SkFloatToHalf_01(r, dst+i);
}
}
« no previous file with comments | « src/core/SkHalf.h ('k') | src/opts/SkNx_sse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698