summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_blitter.cpp
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2012-01-13 12:07:11 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-07 15:52:01 +0100
commitba1cf5dae397031730fb77321db1807937e81617 (patch)
tree491f6eeeeba37dcb5764c0348ae4704c1e41c1e2 /src/gui/image/qpixmap_blitter.cpp
parentfe2344bd44e183b9893934d175c61a725af29b90 (diff)
Removed image format specific template functions in raster engine.
Simplified the raster engine by treating image formats in a more generic way and removed some unused code. Change-Id: Ib3979a1a6e3e6f17c5002248545779ec36fff7c9 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/gui/image/qpixmap_blitter.cpp')
-rw-r--r--src/gui/image/qpixmap_blitter.cpp26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/gui/image/qpixmap_blitter.cpp b/src/gui/image/qpixmap_blitter.cpp
index e5222fa216..382c0b8d1a 100644
--- a/src/gui/image/qpixmap_blitter.cpp
+++ b/src/gui/image/qpixmap_blitter.cpp
@@ -144,27 +144,11 @@ void QBlittablePlatformPixmap::fill(const QColor &color)
m_alpha = true;
}
- uint pixel;
- switch (blittable()->lock()->format()) {
- case QImage::Format_ARGB32_Premultiplied:
- pixel = PREMUL(color.rgba());
- break;
- case QImage::Format_ARGB8565_Premultiplied:
- pixel = qargb8565(color.rgba()).rawValue();
- break;
- case QImage::Format_ARGB8555_Premultiplied:
- pixel = qargb8555(color.rgba()).rawValue();
- break;
- case QImage::Format_ARGB6666_Premultiplied:
- pixel = qargb6666(color.rgba()).rawValue();
- break;
- case QImage::Format_ARGB4444_Premultiplied:
- pixel = qargb4444(color.rgba()).rawValue();
- break;
- default:
- pixel = color.rgba();
- break;
- }
+ uint pixel = PREMUL(color.rgba());
+ const QPixelLayout *layout = &qPixelLayouts[blittable()->lock()->format()];
+ Q_ASSERT(layout->convertFromARGB32PM);
+ layout->convertFromARGB32PM(&pixel, &pixel, 1, layout, 0);
+
//so premultiplied formats are supported and ARGB32 and RGB32
blittable()->lock()->fill(pixel);
}