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

Unified Diff: src/core/SkBlitRow_D16.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/core/SkBlitRow_D16.cpp
diff --git a/src/core/SkBlitRow_D16.cpp b/src/core/SkBlitRow_D16.cpp
index d5082769c53ae5b5a4a84d5467343dec64839bcf..6cdd8ea8b188b2914410e06d0bb8c93a04748a73 100644
--- a/src/core/SkBlitRow_D16.cpp
+++ b/src/core/SkBlitRow_D16.cpp
@@ -216,8 +216,7 @@ static void Color32A_D565(uint16_t dst[], SkPMColor src, int count, int x, int y
uint32_t src_expand = pmcolor_to_expand16(src);
unsigned scale = SkAlpha255To256(0xFF - SkGetPackedA32(src)) >> 3;
do {
- uint32_t dst_expand = SkExpand_rgb_16(*dst) * scale;
- *dst = SkCompact_rgb_16((src_expand + dst_expand) >> 5);
+ *dst = SkBlend32A_D565(*dst, scale, src_expand);
dst += 1;
} while (--count != 0);
}
@@ -269,7 +268,7 @@ SkBlitRow::ColorProc16 SkBlitRow::ColorFactory16(unsigned flags) {
// just so we don't crash
flags &= kFlags16_Mask;
// we ignore both kGlobalAlpha_Flag and kSrcPixelAlpha_Flag, so shift down
- // since this factory is only used for transparent source alphas
+ // no need for the addition code specializing on opaque alpha at this time
flags >>= 2;
SkASSERT(flags < SK_ARRAY_COUNT(gDefault_565_ColorProcs));

Powered by Google App Engine
This is Rietveld 408576698