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

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

Issue 2138943002: Change mapRectScaleTranslate to pass args/ret by value (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 4 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/SkCanvas.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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 void mapRectToQuad(SkPoint dst[4], const SkRect& rect) const { 558 void mapRectToQuad(SkPoint dst[4], const SkRect& rect) const {
559 // This could potentially be faster if we only transformed each x and y of the rect once. 559 // This could potentially be faster if we only transformed each x and y of the rect once.
560 rect.toQuad(dst); 560 rect.toQuad(dst);
561 this->mapPoints(dst, 4); 561 this->mapPoints(dst, 4);
562 } 562 }
563 563
564 /** 564 /**
565 * Maps a rect to another rect, asserting (in debug mode) that the matrix o nly contains 565 * Maps a rect to another rect, asserting (in debug mode) that the matrix o nly contains
566 * scale and translate elements. If it contains other elements, the results are undefined. 566 * scale and translate elements. If it contains other elements, the results are undefined.
567 */ 567 */
568 void mapRectScaleTranslate(SkRect* dst, const SkRect& src) const; 568 SkRect mapRectScaleTranslate(SkRect src) const;
569 569
570 /** Return the mean radius of a circle after it has been mapped by 570 /** Return the mean radius of a circle after it has been mapped by
571 this matrix. NOTE: in perspective this value assumes the circle 571 this matrix. NOTE: in perspective this value assumes the circle
572 has its center at the origin. 572 has its center at the origin.
573 */ 573 */
574 SkScalar mapRadius(SkScalar radius) const; 574 SkScalar mapRadius(SkScalar radius) const;
575 575
576 typedef void (*MapXYProc)(const SkMatrix& mat, SkScalar x, SkScalar y, 576 typedef void (*MapXYProc)(const SkMatrix& mat, SkScalar x, SkScalar y,
577 SkPoint* result); 577 SkPoint* result);
578 578
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 839
840 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int ); 840 static void Affine_vpts(const SkMatrix&, SkPoint dst[], const SkPoint[], int );
841 841
842 static const MapPtsProc gMapPtsProcs[]; 842 static const MapPtsProc gMapPtsProcs[];
843 843
844 friend class SkPerspIter; 844 friend class SkPerspIter;
845 }; 845 };
846 SK_END_REQUIRE_DENSE 846 SK_END_REQUIRE_DENSE
847 847
848 #endif 848 #endif
OLDNEW
« no previous file with comments | « bench/MatrixBench.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698