From 7dad257209972b86efa327892073cf0d293a5afe Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Date: Wed, 15 Oct 2014 14:47:00 +0200 Subject: [PATCH] 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: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com> --- src/core/type_conversion.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h index 8d33b5ffa..9d9cdd675 100644 --- a/src/core/type_conversion.h +++ b/src/core/type_conversion.h @@ -121,11 +121,13 @@ inline QColor toQt(const SkColor &c) 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(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(3, 0), m.get(3, 1), m.get(3, 2), m.get(3, 3)); + qtMatrix.optimize(); + return qtMatrix; } inline QDateTime toQt(base::Time time) -- GitLab