diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-03 19:36:29 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-12-03 19:36:29 +0100 |
commit | 90d3044e3a6ad58819be6787b5edcbc9daa948dc (patch) | |
tree | 27d54322988fe60a420bbb058608b9b9d637329b /src/core/type_conversion.h | |
parent | 03301c0fbdf034fb987e1c1ed1bec7c206dcd27e (diff) | |
parent | d0ae9b50cc01e4c0f65f17467276d4af40284ae1 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I052fdc4245e25e58457d51f6e49703bc7dd8ff00
Diffstat (limited to 'src/core/type_conversion.h')
-rw-r--r-- | src/core/type_conversion.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h index 84b66c62c..abc002ea5 100644 --- a/src/core/type_conversion.h +++ b/src/core/type_conversion.h @@ -40,6 +40,7 @@ #include <QColor> #include <QDateTime> #include <QDir> +#include <QImage> #include <QMatrix4x4> #include <QNetworkCookie> #include <QRect> @@ -49,8 +50,10 @@ #include "base/time/time.h" #include "content/public/common/file_chooser_file_info.h" #include "net/cookies/canonical_cookie.h" -#include "third_party/skia/include/utils/SkMatrix44.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" +#include "third_party/skia/include/core/SkPixelRef.h" +#include "third_party/skia/include/utils/SkMatrix44.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_f.h" #include "url/gurl.h" @@ -140,6 +143,12 @@ inline SkColor toSk(const QColor &c) return c.rgba(); } +inline QImage toQImage(const SkBitmap &bitmap, QImage::Format format) +{ + SkPixelRef *pixelRef = bitmap.pixelRef(); + return QImage((uchar *)pixelRef->pixels(), bitmap.width(), bitmap.height(), format); +} + inline QMatrix4x4 toQt(const SkMatrix44 &m) { QMatrix4x4 qtMatrix( |