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

Side by Side Diff: src/utils/SkMatrix44.cpp

Issue 791723006: SkMatrix44(const SkMatrix&) needs to initialize the type mask (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | tests/Matrix44Test.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #include "SkMatrix44.h" 8 #include "SkMatrix44.h"
9 9
10 static inline bool eq4(const SkMScalar* SK_RESTRICT a, 10 static inline bool eq4(const SkMScalar* SK_RESTRICT a,
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 dst[1][2] = 0; 932 dst[1][2] = 0;
933 dst[2][2] = 1; 933 dst[2][2] = 1;
934 dst[3][2] = 0; 934 dst[3][2] = 0;
935 dst[0][3] = SkScalarToMScalar(src[SkMatrix::kMPersp0]); 935 dst[0][3] = SkScalarToMScalar(src[SkMatrix::kMPersp0]);
936 dst[1][3] = SkScalarToMScalar(src[SkMatrix::kMPersp1]); 936 dst[1][3] = SkScalarToMScalar(src[SkMatrix::kMPersp1]);
937 dst[2][3] = 0; 937 dst[2][3] = 0;
938 dst[3][3] = SkScalarToMScalar(src[SkMatrix::kMPersp2]); 938 dst[3][3] = SkScalarToMScalar(src[SkMatrix::kMPersp2]);
939 } 939 }
940 940
941 SkMatrix44::SkMatrix44(const SkMatrix& src) { 941 SkMatrix44::SkMatrix44(const SkMatrix& src) {
942 initFromMatrix(fMat, src); 942 this->operator=(src);
943 } 943 }
944 944
945 SkMatrix44& SkMatrix44::operator=(const SkMatrix& src) { 945 SkMatrix44& SkMatrix44::operator=(const SkMatrix& src) {
946 initFromMatrix(fMat, src); 946 initFromMatrix(fMat, src);
947 947
948 if (src.isIdentity()) { 948 if (src.isIdentity()) {
949 this->setTypeMask(kIdentity_Mask); 949 this->setTypeMask(kIdentity_Mask);
950 } else { 950 } else {
951 this->dirtyTypeMask(); 951 this->dirtyTypeMask();
952 } 952 }
(...skipping 10 matching lines...) Expand all
963 dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]); 963 dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]);
964 dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]); 964 dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]);
965 dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]); 965 dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]);
966 966
967 dst[SkMatrix::kMPersp0] = SkMScalarToScalar(fMat[0][3]); 967 dst[SkMatrix::kMPersp0] = SkMScalarToScalar(fMat[0][3]);
968 dst[SkMatrix::kMPersp1] = SkMScalarToScalar(fMat[1][3]); 968 dst[SkMatrix::kMPersp1] = SkMScalarToScalar(fMat[1][3]);
969 dst[SkMatrix::kMPersp2] = SkMScalarToScalar(fMat[3][3]); 969 dst[SkMatrix::kMPersp2] = SkMScalarToScalar(fMat[3][3]);
970 970
971 return dst; 971 return dst;
972 } 972 }
OLDNEW
« no previous file with comments | « no previous file | tests/Matrix44Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698