Commit 7dad2572 authored by Jocelyn Turcotte's avatar Jocelyn Turcotte
Browse files

Optimize the QMatrix4x4 after a conversion from SkMatrix44


This avoids using a General matrix for tile transformations which are
usually only translations in our case.

Change-Id: Ic947d7ef9b78de6d5d16ea718cc03255e38a8097
Reviewed-by: default avatarMichael Bruning <michael.bruning@digia.com>
Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
Showing with 3 additions and 1 deletion
...@@ -121,11 +121,13 @@ inline QColor toQt(const SkColor &c) ...@@ -121,11 +121,13 @@ inline QColor toQt(const SkColor &c)
inline QMatrix4x4 toQt(const SkMatrix44 &m) inline QMatrix4x4 toQt(const SkMatrix44 &m)
{ {
return QMatrix4x4( QMatrix4x4 qtMatrix(
m.get(0, 0), m.get(0, 1), m.get(0, 2), m.get(0, 3), m.get(0, 0), m.get(0, 1), m.get(0, 2), m.get(0, 3),
m.get(1, 0), m.get(1, 1), m.get(1, 2), m.get(1, 3), m.get(1, 0), m.get(1, 1), m.get(1, 2), m.get(1, 3),
m.get(2, 0), m.get(2, 1), m.get(2, 2), m.get(2, 3), m.get(2, 0), m.get(2, 1), m.get(2, 2), m.get(2, 3),
m.get(3, 0), m.get(3, 1), m.get(3, 2), m.get(3, 3)); m.get(3, 0), m.get(3, 1), m.get(3, 2), m.get(3, 3));
qtMatrix.optimize();
return qtMatrix;
} }
inline QDateTime toQt(base::Time time) inline QDateTime toQt(base::Time time)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment