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

Side by Side Diff: Source/platform/transforms/TransformationMatrix.cpp

Issue 352793004: Fix use-of-uninitialized-value in TransformationMatrix::blend() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. 3 * Copyright (C) 2009 Torch Mobile, Inc.
4 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 } 1357 }
1358 1358
1359 void TransformationMatrix::blend(const TransformationMatrix& from, double progre ss) 1359 void TransformationMatrix::blend(const TransformationMatrix& from, double progre ss)
1360 { 1360 {
1361 if (from.isIdentity() && isIdentity()) 1361 if (from.isIdentity() && isIdentity())
1362 return; 1362 return;
1363 1363
1364 // decompose 1364 // decompose
1365 DecomposedType fromDecomp; 1365 DecomposedType fromDecomp;
1366 DecomposedType toDecomp; 1366 DecomposedType toDecomp;
1367 from.decompose(fromDecomp); 1367 if (!from.decompose(fromDecomp) || !decompose(toDecomp)) {
1368 decompose(toDecomp); 1368 if (progress < 0.5)
1369 *this = from;
1370 return;
1371 }
1369 1372
1370 // interpolate 1373 // interpolate
1371 blendFloat(fromDecomp.scaleX, toDecomp.scaleX, progress); 1374 blendFloat(fromDecomp.scaleX, toDecomp.scaleX, progress);
1372 blendFloat(fromDecomp.scaleY, toDecomp.scaleY, progress); 1375 blendFloat(fromDecomp.scaleY, toDecomp.scaleY, progress);
1373 blendFloat(fromDecomp.scaleZ, toDecomp.scaleZ, progress); 1376 blendFloat(fromDecomp.scaleZ, toDecomp.scaleZ, progress);
1374 blendFloat(fromDecomp.skewXY, toDecomp.skewXY, progress); 1377 blendFloat(fromDecomp.skewXY, toDecomp.skewXY, progress);
1375 blendFloat(fromDecomp.skewXZ, toDecomp.skewXZ, progress); 1378 blendFloat(fromDecomp.skewXZ, toDecomp.skewXZ, progress);
1376 blendFloat(fromDecomp.skewYZ, toDecomp.skewYZ, progress); 1379 blendFloat(fromDecomp.skewYZ, toDecomp.skewYZ, progress);
1377 blendFloat(fromDecomp.translateX, toDecomp.translateX, progress); 1380 blendFloat(fromDecomp.translateX, toDecomp.translateX, progress);
1378 blendFloat(fromDecomp.translateY, toDecomp.translateY, progress); 1381 blendFloat(fromDecomp.translateY, toDecomp.translateY, progress);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 ret.setDouble(2, 2, matrix.m33()); 1549 ret.setDouble(2, 2, matrix.m33());
1547 ret.setDouble(2, 3, matrix.m43()); 1550 ret.setDouble(2, 3, matrix.m43());
1548 ret.setDouble(3, 0, matrix.m14()); 1551 ret.setDouble(3, 0, matrix.m14());
1549 ret.setDouble(3, 1, matrix.m24()); 1552 ret.setDouble(3, 1, matrix.m24());
1550 ret.setDouble(3, 2, matrix.m34()); 1553 ret.setDouble(3, 2, matrix.m34());
1551 ret.setDouble(3, 3, matrix.m44()); 1554 ret.setDouble(3, 3, matrix.m44());
1552 return ret; 1555 return ret;
1553 } 1556 }
1554 1557
1555 } 1558 }
OLDNEW
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/transforms/TransformationMatrixTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698