From e659c2e820de0b8d12d81247ed4430022ded0a90 Mon Sep 17 00:00:00 2001 From: "skia.committer@gmail.com" Date: Tue, 4 Dec 2012 02:01:25 +0000 Subject: [PATCH] Sanitizing source files in Skia_Periodic_House_Keeping git-svn-id: http://skia.googlecode.com/svn/trunk@6660 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/fatpathfill.cpp | 2 +- include/utils/SkMatrix44.h | 10 +++++----- src/core/SkTLList.h | 2 +- src/utils/SkMatrix44.cpp | 12 ++++++------ tests/LListTest.cpp | 8 ++++---- tests/Matrix44Test.cpp | 8 ++++---- tests/MatrixTest.cpp | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gm/fatpathfill.cpp b/gm/fatpathfill.cpp index c583d64a45..c23a4ecd6f 100644 --- a/gm/fatpathfill.cpp +++ b/gm/fatpathfill.cpp @@ -81,7 +81,7 @@ protected: for (int i = 0; i < REPEAT_LOOP; ++i) { SkPath line, path; - line.moveTo(SkIntToScalar(1), SkIntToScalar(2)); + line.moveTo(SkIntToScalar(1), SkIntToScalar(2)); line.lineTo(SkIntToScalar(4 + i), SkIntToScalar(1)); paint.getFillPath(line, &path); draw_fatpath(canvas, surface, &path, 1); diff --git a/include/utils/SkMatrix44.h b/include/utils/SkMatrix44.h index 79bc700d14..f63f0df495 100644 --- a/include/utils/SkMatrix44.h +++ b/include/utils/SkMatrix44.h @@ -37,7 +37,7 @@ #endif typedef float SkMScalar; typedef int32_t SkMIntScalar; - + static inline float SkFloatToMScalar(float x) { return x; } @@ -134,7 +134,7 @@ public: kAffine_Mask = 0x04, //!< set if the matrix skews or rotates kPerspective_Mask = 0x08 //!< set if the matrix is in perspective }; - + /** * Returns a bitfield describing the transformations the matrix may * perform. The bitfield is computed conservatively, so it may include @@ -153,7 +153,7 @@ public: inline bool isIdentity() const { return 0 == this->getType(); } - + void setIdentity(); inline void reset() { this->setIdentity();} @@ -319,7 +319,7 @@ private: // we are always packed with no extra bits, allowing us to call memcpy // without fear of copying uninitialized bits. mutable SkMIntScalar fTypeMask; - + enum { kUnknown_Mask = 0x80, @@ -333,7 +333,7 @@ private: SkMScalar scaleX() const { return fMat[0][0]; } SkMScalar scaleY() const { return fMat[1][1]; } SkMScalar scaleZ() const { return fMat[2][2]; } - + SkMScalar perspX() const { return fMat[0][3]; } SkMScalar perspY() const { return fMat[1][3]; } SkMScalar perspZ() const { return fMat[2][3]; } diff --git a/src/core/SkTLList.h b/src/core/SkTLList.h index bf7c93b781..87fd52d32e 100644 --- a/src/core/SkTLList.h +++ b/src/core/SkTLList.h @@ -62,7 +62,7 @@ public: } } } - + void addToHead(const T& t) { this->validate(); Node* node = this->createNode(); diff --git a/src/utils/SkMatrix44.cpp b/src/utils/SkMatrix44.cpp index 489a550ed7..7982c3088b 100644 --- a/src/utils/SkMatrix44.cpp +++ b/src/utils/SkMatrix44.cpp @@ -62,7 +62,7 @@ bool SkMatrix44::operator==(const SkMatrix44& other) const { int SkMatrix44::computeTypeMask() const { unsigned mask = 0; - + if (0 != perspX() || 0 != perspY() || 0 != perspZ() || 1 != fMat[3][3]) { return kTranslate_Mask | kScale_Mask | kAffine_Mask | kPerspective_Mask; } @@ -214,7 +214,7 @@ void SkMatrix44::setTranslate(SkMScalar tx, SkMScalar ty, SkMScalar tz) { fMat[3][1] = ty; fMat[3][2] = tz; fMat[3][3] = 1; - + int mask = kIdentity_Mask; if (0 != tx || 0 != ty || 0 != tz) { mask |= kTranslate_Mask; @@ -243,7 +243,7 @@ void SkMatrix44::setScale(SkMScalar sx, SkMScalar sy, SkMScalar sz) { fMat[1][1] = sy; fMat[2][2] = sz; fMat[3][3] = 1; - + int mask = kIdentity_Mask; if (0 != sx || 0 != sy || 0 != sz) { mask |= kScale_Mask; @@ -485,7 +485,7 @@ void SkMatrix44::mapScalars(const SkScalar src[4], SkScalar dst[4]) const { } result[i] = SkMScalarToScalar(value); } - + if (storage == result) { memcpy(dst, storage, sizeof(storage)); } @@ -496,7 +496,7 @@ void SkMatrix44::mapScalars(const SkScalar src[4], SkScalar dst[4]) const { void SkMatrix44::mapMScalars(const SkMScalar src[4], SkMScalar dst[4]) const { SkMScalar storage[4]; SkMScalar* result = (src == dst) ? storage : dst; - + for (int i = 0; i < 4; i++) { SkMScalar value = 0; for (int j = 0; j < 4; j++) { @@ -504,7 +504,7 @@ void SkMatrix44::mapMScalars(const SkMScalar src[4], SkMScalar dst[4]) const { } result[i] = value; } - + if (storage == result) { memcpy(dst, storage, sizeof(storage)); } diff --git a/tests/LListTest.cpp b/tests/LListTest.cpp index c5a5663c0b..d574e090ec 100644 --- a/tests/LListTest.cpp +++ b/tests/LListTest.cpp @@ -162,14 +162,14 @@ static void TestTLList(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, iter3.get()->fID == iter1.get()->fID); REPORTER_ASSERT(reporter, iter4.get()->fID == iter1.get()->fID); REPORTER_ASSERT(reporter, list1 == list2); - + list2.reset(); // use both before/after in-place construction on an empty list SkNEW_INSERT_IN_LLIST_BEFORE(&list2, list2.headIter(), ListElement, (1)); REPORTER_ASSERT(reporter, list2 == list1); list2.reset(); - + SkNEW_INSERT_IN_LLIST_AFTER(&list2, list2.tailIter(), ListElement, (1)); REPORTER_ASSERT(reporter, list2 == list1); @@ -255,7 +255,7 @@ static void TestTLList(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, prev.next()->fID == iter.get()->fID); } } - } + } } ++count; } else { @@ -263,7 +263,7 @@ static void TestTLList(skiatest::Reporter* reporter) { int n = random.nextULessThan(list1.count()); Iter::IterStart start; ListElement* (Iter::*incrFunc)(); - + if (random.nextBool()) { start = Iter::kHead_IterStart; incrFunc = &Iter::next; diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp index ed8770ae6c..1220f262e0 100644 --- a/tests/Matrix44Test.cpp +++ b/tests/Matrix44Test.cpp @@ -74,10 +74,10 @@ static bool is_identity(const SkMatrix44& m) { static void test_gettype(skiatest::Reporter* reporter) { SkMatrix44 matrix; - + REPORTER_ASSERT(reporter, matrix.isIdentity()); REPORTER_ASSERT(reporter, SkMatrix44::kIdentity_Mask == matrix.getType()); - + int expectedMask; matrix.set(1, 1, 0); @@ -91,7 +91,7 @@ static void test_gettype(skiatest::Reporter* reporter) { matrix.set(2, 0, 1); expectedMask |= SkMatrix44::kAffine_Mask; REPORTER_ASSERT(reporter, matrix.getType() == expectedMask); - + matrix.set(3, 2, 1); REPORTER_ASSERT(reporter, matrix.getType() & SkMatrix44::kPerspective_Mask); } @@ -209,7 +209,7 @@ static void test_set_row_col_major(skiatest::Reporter* reporter) { a.setDouble(row, col, row * 4 + col); } } - + double bufferd[16]; float bufferf[16]; a.asColMajord(bufferd); diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp index ed2be1d926..894278e84b 100644 --- a/tests/MatrixTest.cpp +++ b/tests/MatrixTest.cpp @@ -98,7 +98,7 @@ static void test_matrix_recttorect(skiatest::Reporter* reporter) { dst.fRight += SK_Scalar1; matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit); - REPORTER_ASSERT(reporter, + REPORTER_ASSERT(reporter, (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask) == matrix.getType()); REPORTER_ASSERT(reporter, matrix.rectStaysRect());