From bc0a0281d535079745ed1544a063571b86ca718e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 12 Jul 2011 09:49:12 +0200 Subject: Get rid of some obsolete functions in QImage / QPixmap / QPixmapData. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0d2412c9196475b926a17de9fcc3281f6625fae0 Reviewed-on: http://codereview.qt.nokia.com/1733 Reviewed-by: Qt Sanity Bot Reviewed-by: Olivier Goffart Reviewed-by: Jørgen Lind --- src/gui/image/qpixmap_raster.cpp | 47 ---------------------------------------- 1 file changed, 47 deletions(-) (limited to 'src/gui/image/qpixmap_raster.cpp') diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 6c8952b10e..a0ae88dc70 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -58,9 +58,6 @@ QT_BEGIN_NAMESPACE -const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, - 0x10, 0x20, 0x40, 0x80 }; - QPixmap qt_toRasterPixmap(const QImage &image) { QPixmapData *data = @@ -265,45 +262,6 @@ void QRasterPixmapData::fill(const QColor &color) image.fill(pixel); } -void QRasterPixmapData::setMask(const QBitmap &mask) -{ - if (mask.size().isEmpty()) { - if (image.depth() != 1) { // hw: ???? - image = image.convertToFormat(QImage::Format_RGB32); - } - } else { - const int w = image.width(); - const int h = image.height(); - - switch (image.depth()) { - case 1: { - const QImage imageMask = mask.toImage().convertToFormat(image.format()); - for (int y = 0; y < h; ++y) { - const uchar *mscan = imageMask.scanLine(y); - uchar *tscan = image.scanLine(y); - int bytesPerLine = image.bytesPerLine(); - for (int i = 0; i < bytesPerLine; ++i) - tscan[i] &= mscan[i]; - } - break; - } - default: { - const QImage imageMask = mask.toImage().convertToFormat(QImage::Format_MonoLSB); - image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied); - for (int y = 0; y < h; ++y) { - const uchar *mscan = imageMask.scanLine(y); - QRgb *tscan = (QRgb *)image.scanLine(y); - for (int x = 0; x < w; ++x) { - if (!(mscan[x>>3] & qt_pixmap_bit_mask[x&7])) - tscan[x] = 0; - } - } - break; - } - } - } -} - bool QRasterPixmapData::hasAlphaChannel() const { return image.hasAlphaChannel(); @@ -337,11 +295,6 @@ QImage QRasterPixmapData::toImage(const QRect &rect) const return image.copy(clipped); } -void QRasterPixmapData::setAlphaChannel(const QPixmap &alphaChannel) -{ - image.setAlphaChannel(alphaChannel.toImage()); -} - QPaintEngine* QRasterPixmapData::paintEngine() const { return image.paintEngine(); -- cgit v1.2.3