summaryrefslogtreecommitdiffstats
path: root/src/core/type_conversion.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/type_conversion.h')
-rw-r--r--src/core/type_conversion.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h
index afc3c3336..7b1f1b4d6 100644
--- a/src/core/type_conversion.h
+++ b/src/core/type_conversion.h
@@ -45,7 +45,6 @@
#include <QDir>
#include <QIcon>
#include <QImage>
-#include <QMatrix4x4>
#include <QNetworkCookie>
#include <QRect>
#include <QString>
@@ -64,6 +63,8 @@
#include "ui/gfx/geometry/rect_f.h"
#include "url/gurl.h"
+QT_FORWARD_DECLARE_CLASS(QMatrix4x4)
+
namespace content {
struct FaviconURL;
}
@@ -171,6 +172,11 @@ inline gfx::SizeF toGfx(const QSizeF& size)
return gfx::SizeF(size.width(), size.height());
}
+inline gfx::Rect toGfx(const QRect &rect)
+{
+ return gfx::Rect(rect.x(), rect.y(), rect.width(), rect.height());
+}
+
inline QSizeF toQt(const gfx::SizeF &size)
{
return QSizeF(size.width(), size.height());
@@ -198,16 +204,7 @@ SkBitmap toSkBitmap(const QImage &image);
QIcon toQIcon(const std::vector<SkBitmap> &bitmaps);
-inline QMatrix4x4 toQt(const SkMatrix44 &m)
-{
- 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;
-}
+void convertToQt(const SkMatrix44 &m, QMatrix4x4 &c);
inline QDateTime toQt(base::Time time)
{