diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2015-11-09 06:25:56 -0800 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2015-12-01 22:08:39 +0000 |
commit | 4ffa4cbdad93a31ef7d9712d3d91777510a1a17d (patch) | |
tree | 6466d31476873a332ab292706e590bb4b2b78102 /src/core/type_conversion.h | |
parent | 8eab04b55e6d01ca2ab473d325eb4337c5f40725 (diff) |
Support custom mouse cursors
Task-number: QTBUG-43009
Change-Id: Ic36554c5137a55d9d4b9143c204d9d4400e23ff8
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
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 9e5461888..eb874a26d 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 "url/gurl.h" @@ -134,6 +137,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( |