diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-11 11:02:15 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-22 17:17:26 +0200 |
commit | 85e3e88e1e68d9834346593c6b4819694f8a1a59 (patch) | |
tree | dbaa4c3a29361b0b8616fc2ce6fd977ee19ed3f8 /src/gui/painting | |
parent | f3ecda32e0f7bd21b44e7737d2939dcce2c26517 (diff) |
Handle wide images in raster engine
QImages internally use a qsizetype bytes_per_line, so should
QRasterBuffer, even if this won't be relevant until Qt 6.
Task-number: QTBUG-73731
Fixes: QTBUG-75082
Change-Id: Id296795d54f3ff36c48c1ebae0594a72b8e33b52
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpaintengine_raster_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index 089aadc3f7..1244ea6709 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -434,14 +434,14 @@ public: QImage::Format prepare(QImage *image); - uchar *scanLine(int y) { Q_ASSERT(y>=0); Q_ASSERT(y<m_height); return m_buffer + y * qsizetype(bytes_per_line); } + uchar *scanLine(int y) { Q_ASSERT(y>=0); Q_ASSERT(y<m_height); return m_buffer + y * bytes_per_line; } int width() const { return m_width; } int height() const { return m_height; } - int bytesPerLine() const { return bytes_per_line; } + qsizetype bytesPerLine() const { return bytes_per_line; } int bytesPerPixel() const { return bytes_per_pixel; } template<typename T> - int stride() { return bytes_per_line / sizeof(T); } + int stride() { return static_cast<int>(bytes_per_line / sizeof(T)); } uchar *buffer() const { return m_buffer; } @@ -456,7 +456,7 @@ public: private: int m_width; int m_height; - int bytes_per_line; + qsizetype bytes_per_line; int bytes_per_pixel; uchar *m_buffer; }; |