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

Unified Diff: src/opts/SkMatrix_opts.h

Issue 1872193002: Graduate matrix map-point procs out of SkOpts. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: missed Created 4 years, 8 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 | « src/core/SkOpts.cpp ('k') | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkMatrix_opts.h
diff --git a/src/opts/SkMatrix_opts.h b/src/opts/SkMatrix_opts.h
deleted file mode 100644
index b3d3f618e0f0c21adf72fc06efe024796b97880e..0000000000000000000000000000000000000000
--- a/src/opts/SkMatrix_opts.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkMatrix_opts_DEFINED
-#define SkMatrix_opts_DEFINED
-
-#include "SkMatrix.h"
-#include "SkNx.h"
-
-namespace SK_OPTS_NS {
-
-static void matrix_translate(const SkMatrix& m, SkPoint* dst, const SkPoint* src, int count) {
- SkASSERT(m.getType() <= SkMatrix::kTranslate_Mask);
- if (count > 0) {
- SkScalar tx = m.getTranslateX();
- SkScalar ty = m.getTranslateY();
- if (count & 1) {
- dst->fX = src->fX + tx;
- dst->fY = src->fY + ty;
- src += 1;
- dst += 1;
- }
- Sk4s trans4(tx, ty, tx, ty);
- count >>= 1;
- if (count & 1) {
- (Sk4s::Load(src) + trans4).store(dst);
- src += 2;
- dst += 2;
- }
- count >>= 1;
- for (int i = 0; i < count; ++i) {
- (Sk4s::Load(src+0) + trans4).store(dst+0);
- (Sk4s::Load(src+2) + trans4).store(dst+2);
- src += 4;
- dst += 4;
- }
- }
-}
-
-static void matrix_scale_translate(const SkMatrix& m, SkPoint* dst, const SkPoint* src, int count) {
- SkASSERT(m.getType() <= (SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask));
- if (count > 0) {
- SkScalar tx = m.getTranslateX();
- SkScalar ty = m.getTranslateY();
- SkScalar sx = m.getScaleX();
- SkScalar sy = m.getScaleY();
- if (count & 1) {
- dst->fX = src->fX * sx + tx;
- dst->fY = src->fY * sy + ty;
- src += 1;
- dst += 1;
- }
- Sk4s trans4(tx, ty, tx, ty);
- Sk4s scale4(sx, sy, sx, sy);
- count >>= 1;
- if (count & 1) {
- (Sk4s::Load(src) * scale4 + trans4).store(dst);
- src += 2;
- dst += 2;
- }
- count >>= 1;
- for (int i = 0; i < count; ++i) {
- (Sk4s::Load(src+0) * scale4 + trans4).store(dst+0);
- (Sk4s::Load(src+2) * scale4 + trans4).store(dst+2);
- src += 4;
- dst += 4;
- }
- }
-}
-
-static void matrix_affine(const SkMatrix& m, SkPoint* dst, const SkPoint* src, int count) {
- SkASSERT(m.getType() != SkMatrix::kPerspective_Mask);
- if (count > 0) {
- SkScalar tx = m.getTranslateX();
- SkScalar ty = m.getTranslateY();
- SkScalar sx = m.getScaleX();
- SkScalar sy = m.getScaleY();
- SkScalar kx = m.getSkewX();
- SkScalar ky = m.getSkewY();
- if (count & 1) {
- dst->set(src->fX * sx + src->fY * kx + tx,
- src->fX * ky + src->fY * sy + ty);
- src += 1;
- dst += 1;
- }
- Sk4s trans4(tx, ty, tx, ty);
- Sk4s scale4(sx, sy, sx, sy);
- Sk4s skew4(kx, ky, kx, ky); // applied to swizzle of src4
- count >>= 1;
- for (int i = 0; i < count; ++i) {
- Sk4s src4 = Sk4s::Load(src);
- Sk4s swz4 = SkNx_shuffle<1,0,3,2>(src4); // y0 x0, y1 x1
- (src4 * scale4 + swz4 * skew4 + trans4).store(dst);
- src += 2;
- dst += 2;
- }
- }
-}
-
-} // namespace SK_OPTS_NS
-
-#endif//SkMatrix_opts_DEFINED
« no previous file with comments | « src/core/SkOpts.cpp ('k') | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698