SkMatrix44(const SkMatrix&) needs to initialize the type mask

Review URL: https://codereview.chromium.org/791723006
This commit is contained in:
fs 2014-12-16 08:36:11 -08:00 committed by Commit bot
parent 478dd72336
commit 88640cf363
2 changed files with 9 additions and 1 deletions

View File

@ -939,7 +939,7 @@ static void initFromMatrix(SkMScalar dst[4][4], const SkMatrix& src) {
}
SkMatrix44::SkMatrix44(const SkMatrix& src) {
initFromMatrix(fMat, src);
this->operator=(src);
}
SkMatrix44& SkMatrix44::operator=(const SkMatrix& src) {

View File

@ -104,6 +104,14 @@ static void test_constructor(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, testMatrix == placeholderMatrix);
REPORTER_ASSERT(reporter, testMatrix->isIdentity());
REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I());
// Verify that that constructing from an SkMatrix initializes everything.
SkMatrix44 scaleMatrix(SkMatrix44::kUninitialized_Constructor);
scaleMatrix.setScale(3, 4, 5);
REPORTER_ASSERT(reporter, scaleMatrix.isScale());
testMatrix = new(&scaleMatrix) SkMatrix44(SkMatrix::I());
REPORTER_ASSERT(reporter, testMatrix->isIdentity());
REPORTER_ASSERT(reporter, *testMatrix == SkMatrix44::I());
}
static void test_translate(skiatest::Reporter* reporter) {