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

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: Fixed comment comment 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
« no previous file with comments | « include/core/SkColorPriv.h ('k') | src/opts/SkBitmapProcState_opts_SSE2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitRow_D16.cpp
diff --git a/src/core/SkBlitRow_D16.cpp b/src/core/SkBlitRow_D16.cpp
index d5082769c53ae5b5a4a84d5467343dec64839bcf..5aaa7a5805d88e2c21f1a61b3add3e47a8c06149 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 = SkBlend32_RGB16(src_expand, *dst, scale);
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 additional code specializing on opaque alpha at this time
flags >>= 2;
SkASSERT(flags < SK_ARRAY_COUNT(gDefault_565_ColorProcs));
« no previous file with comments | « include/core/SkColorPriv.h ('k') | src/opts/SkBitmapProcState_opts_SSE2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698