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

Side by Side Diff: src/core/SkMatrix.cpp

Issue 803493008: Fix overlap test for 64-bit pointers in SkMatrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: same style as in mapPoints Created 5 years, 11 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 | no next file » | 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkMatrix.h" 8 #include "SkMatrix.h"
9 #include "SkFloatBits.h" 9 #include "SkFloatBits.h"
10 #include "SkString.h" 10 #include "SkString.h"
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 SkASSERT(src == dst || &dst[count] <= &src[0] || &src[count] <= &dst[0]); 1018 SkASSERT(src == dst || &dst[count] <= &src[0] || &src[count] <= &dst[0]);
1019 1019
1020 this->getMapPtsProc()(*this, dst, src, count); 1020 this->getMapPtsProc()(*this, dst, src, count);
1021 } 1021 }
1022 1022
1023 /////////////////////////////////////////////////////////////////////////////// 1023 ///////////////////////////////////////////////////////////////////////////////
1024 1024
1025 void SkMatrix::mapHomogeneousPoints(SkScalar dst[], const SkScalar src[], int co unt) const { 1025 void SkMatrix::mapHomogeneousPoints(SkScalar dst[], const SkScalar src[], int co unt) const {
1026 SkASSERT((dst && src && count > 0) || 0 == count); 1026 SkASSERT((dst && src && count > 0) || 0 == count);
1027 // no partial overlap 1027 // no partial overlap
1028 SkASSERT(src == dst || SkAbs32((int32_t)(src - dst)) >= 3*count); 1028 SkASSERT(src == dst || &dst[3*count] <= &src[0] || &src[3*count] <= &dst[0]) ;
1029 1029
1030 if (count > 0) { 1030 if (count > 0) {
1031 if (this->isIdentity()) { 1031 if (this->isIdentity()) {
1032 memcpy(dst, src, 3*count*sizeof(SkScalar)); 1032 memcpy(dst, src, 3*count*sizeof(SkScalar));
1033 return; 1033 return;
1034 } 1034 }
1035 do { 1035 do {
1036 SkScalar sx = src[0]; 1036 SkScalar sx = src[0];
1037 SkScalar sy = src[1]; 1037 SkScalar sy = src[1];
1038 SkScalar sw = src[2]; 1038 SkScalar sw = src[2];
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 rotation1->fX = cos1; 1784 rotation1->fX = cos1;
1785 rotation1->fY = sin1; 1785 rotation1->fY = sin1;
1786 } 1786 }
1787 if (rotation2) { 1787 if (rotation2) {
1788 rotation2->fX = cos2; 1788 rotation2->fX = cos2;
1789 rotation2->fY = sin2; 1789 rotation2->fY = sin2;
1790 } 1790 }
1791 1791
1792 return true; 1792 return true;
1793 } 1793 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698