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

Side by Side Diff: src/opts/SkMatrix_opts.h

Issue 1333983002: use new shuffle to speed up affine matrix mappts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: now 86 on NEON Created 5 years, 3 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 | « no previous file | 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 2015 Google Inc. 2 * Copyright 2015 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 #ifndef SkMatrix_opts_DEFINED 8 #ifndef SkMatrix_opts_DEFINED
9 #define SkMatrix_opts_DEFINED 9 #define SkMatrix_opts_DEFINED
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 SkScalar kx = m.getSkewX(); 82 SkScalar kx = m.getSkewX();
83 SkScalar ky = m.getSkewY(); 83 SkScalar ky = m.getSkewY();
84 if (count & 1) { 84 if (count & 1) {
85 dst->set(src->fX * sx + src->fY * kx + tx, 85 dst->set(src->fX * sx + src->fY * kx + tx,
86 src->fX * ky + src->fY * sy + ty); 86 src->fX * ky + src->fY * sy + ty);
87 src += 1; 87 src += 1;
88 dst += 1; 88 dst += 1;
89 } 89 }
90 Sk4s trans4(tx, ty, tx, ty); 90 Sk4s trans4(tx, ty, tx, ty);
91 Sk4s scale4(sx, sy, sx, sy); 91 Sk4s scale4(sx, sy, sx, sy);
92 Sk4s skew4(kx, ky, kx, ky); // applied to swizzle of src4 92 Sk4s skew4(ky, kx, ky, kx); // applied src4, then x/y swapped
93 count >>= 1; 93 count >>= 1;
94 for (int i = 0; i < count; ++i) { 94 for (int i = 0; i < count; ++i) {
95 Sk4s src4 = Sk4s::Load(&src->fX); 95 Sk4s src4 = Sk4s::Load(&src->fX);
96 Sk4s swz4(src[0].fY, src[0].fX, src[1].fY, src[1].fX); // need ABCD -> BADC 96 (trans4 + src4 * scale4 + SkNx_shuffle<1,0,3,2>(src4 * skew4)).store (&dst->fX);
97 (src4 * scale4 + swz4 * skew4 + trans4).store(&dst->fX);
98 src += 2; 97 src += 2;
99 dst += 2; 98 dst += 2;
100 } 99 }
101 } 100 }
102 } 101 }
103 102
104 } // namespace SK_OPTS_NS 103 } // namespace SK_OPTS_NS
105 104
106 #endif//SkMatrix_opts_DEFINED 105 #endif//SkMatrix_opts_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698