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

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

Issue 1202013002: Update some Sk4px APIs. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fix none Created 5 years, 6 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/opts/Sk4px_none.h ('k') | src/opts/SkNx_neon.h » ('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 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1733 1733
1734 #include "Sk4px.h" 1734 #include "Sk4px.h"
1735 1735
1736 void sk_blitrow_color32_arm_neon(SkPMColor* dst, const SkPMColor* src, int count , SkPMColor color) { 1736 void sk_blitrow_color32_arm_neon(SkPMColor* dst, const SkPMColor* src, int count , SkPMColor color) {
1737 // Until it becomes a little more reasonable to assume we'll be built with N EON, 1737 // Until it becomes a little more reasonable to assume we'll be built with N EON,
1738 // we copy our Sk4px implementation of SkBlitRow::Color32 here so it picks u p NEON at runtime. 1738 // we copy our Sk4px implementation of SkBlitRow::Color32 here so it picks u p NEON at runtime.
1739 unsigned invA = 255 - SkGetPackedA32(color); 1739 unsigned invA = 255 - SkGetPackedA32(color);
1740 invA += invA >> 7; 1740 invA += invA >> 7;
1741 SkASSERT(invA < 256); // Our caller has already handled the alpha == 0 case . 1741 SkASSERT(invA < 256); // Our caller has already handled the alpha == 0 case .
1742 1742
1743 Sk16h colorHighAndRound = Sk4px(color).widenHi() + Sk16h(128); 1743 Sk16h colorHighAndRound = Sk4px::DupPMColor(color).widenHi() + Sk16h(128);
1744 Sk16b invA_16x(invA); 1744 Sk16b invA_16x(invA);
1745 1745
1746 Sk4px::MapSrc(count, dst, src, [&](const Sk4px& src4) -> Sk4px { 1746 Sk4px::MapSrc(count, dst, src, [&](const Sk4px& src4) -> Sk4px {
1747 return src4.mulWiden(invA_16x).addNarrowHi(colorHighAndRound); 1747 return (src4 * invA_16x).addNarrowHi(colorHighAndRound);
1748 }); 1748 });
1749 } 1749 }
OLDNEW
« no previous file with comments | « src/opts/Sk4px_none.h ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698