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

Unified Diff: src/opts/SkBlitRow_opts_SSE4.cpp

Issue 923523002: Replace SSE optimization of Color32A_D565 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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
Index: src/opts/SkBlitRow_opts_SSE4.cpp
diff --git a/src/opts/SkBlitRow_opts_SSE4.cpp b/src/opts/SkBlitRow_opts_SSE4.cpp
index f4273d27b4b0bfaf81d1df0c5d86f8f25f5a8164..82fc70b4d349667ccaa9b137e5aea1ad120654de 100644
--- a/src/opts/SkBlitRow_opts_SSE4.cpp
+++ b/src/opts/SkBlitRow_opts_SSE4.cpp
@@ -66,11 +66,6 @@ void S32A_Opaque_BlitRow32_SSE4(SkPMColor* SK_RESTRICT dst,
}
}
-static inline uint16_t Color32A_D565_1x(uint16_t dst, unsigned scale, uint32_t src_expand) {
- uint32_t dst_expand = SkExpand_rgb_16(dst) * scale;
- return SkCompact_rgb_16((src_expand + dst_expand) >> 5);
-}
-
void Color32A_D565_SSE4(uint16_t dst[], SkPMColor src, int count, int x, int y) {
SkASSERT(count > 0);
@@ -90,7 +85,7 @@ void Color32A_D565_SSE4(uint16_t dst[], SkPMColor src, int count, int x, int y)
// Align dst to an even 16 byte address (0-7 pixels)
while (((((size_t)dst) & 0x0F) != 0) && (count > 0)) {
- *dst = Color32A_D565_1x(*dst, scale, src_expand);
+ *dst = SkBlend32A_D565(*dst, scale, src_expand);
dst += 1;
count--;
}
@@ -132,7 +127,7 @@ void Color32A_D565_SSE4(uint16_t dst[], SkPMColor src, int count, int x, int y)
// Small loop to handle remaining pixels.
while (count > 0) {
- *dst = Color32A_D565_1x(*dst, scale, src_expand);
+ *dst = SkBlend32A_D565(*dst, scale, src_expand);
dst += 1;
count--;
}

Powered by Google App Engine
This is Rietveld 408576698