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

Side by Side Diff: src/opts/SkBlitRow_opts_arm_neon.cpp

Issue 1273203002: The compiler can generate smulbb perfectly well nowadays. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: parens Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/core/SkScan_Antihair.cpp ('k') | src/opts/SkBlitRow_opts_mips_dsp.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBlitRow_opts_arm_neon.h" 8 #include "SkBlitRow_opts_arm_neon.h"
9 9
10 #include "SkBlitMask.h" 10 #include "SkBlitMask.h"
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 count -= 8; 707 count -= 8;
708 } while (count >= 8); 708 } while (count >= 8);
709 } 709 }
710 710
711 // leftovers 711 // leftovers
712 while (count-- > 0) { 712 while (count-- > 0) {
713 SkPMColor sc = *src++; 713 SkPMColor sc = *src++;
714 if (sc) { 714 if (sc) {
715 uint16_t dc = *dst; 715 uint16_t dc = *dst;
716 unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alph a); 716 unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alph a);
717 unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + SkMulS16(SkGetP ackedR16(dc), dst_scale); 717 unsigned dr = (SkPacked32ToR16(sc) * alpha) + (SkGetPackedR16(dc) * dst_scale);
718 unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + SkMulS16(SkGetP ackedG16(dc), dst_scale); 718 unsigned dg = (SkPacked32ToG16(sc) * alpha) + (SkGetPackedG16(dc) * dst_scale);
719 unsigned db = SkMulS16(SkPacked32ToB16(sc), alpha) + SkMulS16(SkGetP ackedB16(dc), dst_scale); 719 unsigned db = (SkPacked32ToB16(sc) * alpha) + (SkGetPackedB16(dc) * dst_scale);
720 *dst = SkPackRGB16(SkDiv255Round(dr), SkDiv255Round(dg), SkDiv255Rou nd(db)); 720 *dst = SkPackRGB16(SkDiv255Round(dr), SkDiv255Round(dg), SkDiv255Rou nd(db));
721 } 721 }
722 dst += 1; 722 dst += 1;
723 } 723 }
724 } 724 }
725 725
726 /* dither matrix for Neon, derived from gDitherMatrix_3Bit_16. 726 /* dither matrix for Neon, derived from gDitherMatrix_3Bit_16.
727 * each dither value is spaced out into byte lanes, and repeated 727 * each dither value is spaced out into byte lanes, and repeated
728 * to allow an 8-byte load from offsets 0, 1, 2 or 3 from the 728 * to allow an 8-byte load from offsets 0, 1, 2 or 3 from the
729 * start of each row. 729 * start of each row.
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 invA += invA >> 7; 1592 invA += invA >> 7;
1593 SkASSERT(invA < 256); // Our caller has already handled the alpha == 0 case . 1593 SkASSERT(invA < 256); // Our caller has already handled the alpha == 0 case .
1594 1594
1595 Sk16h colorHighAndRound = Sk4px::DupPMColor(color).widenHi() + Sk16h(128); 1595 Sk16h colorHighAndRound = Sk4px::DupPMColor(color).widenHi() + Sk16h(128);
1596 Sk16b invA_16x(invA); 1596 Sk16b invA_16x(invA);
1597 1597
1598 Sk4px::MapSrc(count, dst, src, [&](const Sk4px& src4) -> Sk4px { 1598 Sk4px::MapSrc(count, dst, src, [&](const Sk4px& src4) -> Sk4px {
1599 return (src4 * invA_16x).addNarrowHi(colorHighAndRound); 1599 return (src4 * invA_16x).addNarrowHi(colorHighAndRound);
1600 }); 1600 });
1601 } 1601 }
OLDNEW
« no previous file with comments | « src/core/SkScan_Antihair.cpp ('k') | src/opts/SkBlitRow_opts_mips_dsp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698