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

Side by Side Diff: src/core/SkBlitRow_D32.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/core/Sk4pxXfermode.h ('k') | src/opts/Sk4px_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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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.h" 8 #include "SkBlitRow.h"
9 #include "SkBlitMask.h" 9 #include "SkBlitMask.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 // This Sk4px impl works great on other platforms or when we have NEON. 147 // This Sk4px impl works great on other platforms or when we have NEON.
148 #if defined(SK_CPU_ARM32) && !defined(SK_ARM_HAS_NEON) 148 #if defined(SK_CPU_ARM32) && !defined(SK_ARM_HAS_NEON)
149 if (auto proc = PlatformColor32Proc()) { return proc(dst, src, count, color) ; } 149 if (auto proc = PlatformColor32Proc()) { return proc(dst, src, count, color) ; }
150 #endif 150 #endif
151 151
152 unsigned invA = 255 - SkGetPackedA32(color); 152 unsigned invA = 255 - SkGetPackedA32(color);
153 invA += invA >> 7; 153 invA += invA >> 7;
154 SkASSERT(invA < 256); // We've already handled alpha == 0 above. 154 SkASSERT(invA < 256); // We've already handled alpha == 0 above.
155 155
156 Sk16h colorHighAndRound = Sk4px(color).widenHi() + Sk16h(128); 156 Sk16h colorHighAndRound = Sk4px::DupPMColor(color).widenHi() + Sk16h(128);
157 Sk16b invA_16x(invA); 157 Sk16b invA_16x(invA);
158 158
159 Sk4px::MapSrc(count, dst, src, [&](const Sk4px& src4) -> Sk4px { 159 Sk4px::MapSrc(count, dst, src, [&](const Sk4px& src4) -> Sk4px {
160 return src4.mulWiden(invA_16x).addNarrowHi(colorHighAndRound); 160 return (src4 * invA_16x).addNarrowHi(colorHighAndRound);
161 }); 161 });
162 } 162 }
OLDNEW
« no previous file with comments | « src/core/Sk4pxXfermode.h ('k') | src/opts/Sk4px_NEON.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698