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

Side by Side Diff: include/core/SkMatrix.h

Issue 1030653002: remove meaningless matrix benches, add mapPts() and add new benches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove loop-unrolling for now (separate CL perhaps) Created 5 years, 9 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 | « bench/MatrixBench.cpp ('k') | src/core/SkMatrix.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkMatrix_DEFINED 10 #ifndef SkMatrix_DEFINED
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 transformed values. 407 transformed values.
408 dst[] = M * pts[] 408 dst[] = M * pts[]
409 @param pts The points to be transformed. It must contain at least 409 @param pts The points to be transformed. It must contain at least
410 count entries 410 count entries
411 @param count The number of points in pts. 411 @param count The number of points in pts.
412 */ 412 */
413 void mapPoints(SkPoint pts[], int count) const { 413 void mapPoints(SkPoint pts[], int count) const {
414 this->mapPoints(pts, pts, count); 414 this->mapPoints(pts, pts, count);
415 } 415 }
416 416
417 void mapPts(SkPoint dst[], const SkPoint src[], int count) const;
418
417 /** Like mapPoints but with custom byte stride between the points. Stride 419 /** Like mapPoints but with custom byte stride between the points. Stride
418 * should be a multiple of sizeof(SkScalar). 420 * should be a multiple of sizeof(SkScalar).
419 */ 421 */
420 void mapPointsWithStride(SkPoint pts[], size_t stride, int count) const { 422 void mapPointsWithStride(SkPoint pts[], size_t stride, int count) const {
421 SkASSERT(stride >= sizeof(SkPoint)); 423 SkASSERT(stride >= sizeof(SkPoint));
422 SkASSERT(0 == stride % sizeof(SkScalar)); 424 SkASSERT(0 == stride % sizeof(SkScalar));
423 for (int i = 0; i < count; ++i) { 425 for (int i = 0; i < count; ++i) {
424 this->mapPoints(pts, pts, 1); 426 this->mapPoints(pts, pts, 1);
425 pts = (SkPoint*)((intptr_t)pts + stride); 427 pts = (SkPoint*)((intptr_t)pts + stride);
426 } 428 }
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], 786 static void RotTrans_pts(const SkMatrix&, SkPoint dst[], const SkPoint[],
785 int count); 787 int count);
786 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int); 788 static void Persp_pts(const SkMatrix&, SkPoint dst[], const SkPoint[], int);
787 789
788 static const MapPtsProc gMapPtsProcs[]; 790 static const MapPtsProc gMapPtsProcs[];
789 791
790 friend class SkPerspIter; 792 friend class SkPerspIter;
791 }; 793 };
792 794
793 #endif 795 #endif
OLDNEW
« no previous file with comments | « bench/MatrixBench.cpp ('k') | src/core/SkMatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698