From 52ddfb36c80f1f0cba4e90d40b43c426687fac41 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 27 Apr 2015 12:10:12 +0200 Subject: Fix two errors in RGB30 conversions The one converters from RGB30 was misplaced in the method table, and the unpremultiplication from A2RGB30 to RGB30 had an underflow mistake when alpha was 2. Change-Id: I92c11ede28611a3dbdce72aca1898845c120c209 Reviewed-by: Gunnar Sletta --- src/gui/image/qimage_conversions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index 28e3a48689..e1be032215 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -557,7 +557,7 @@ static inline uint qUnpremultiplyRgb30(uint rgb30) } case 2: { uint rgb = rgb30 & 0x3fffffff; - rgb += rgb >> 1; + rgb += (rgb >> 1) & 0x5ff7fdff; return (a << 30) | rgb; } case 3: @@ -2348,10 +2348,10 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat 0, 0, 0, + 0, convert_BGR30_to_RGB30, convert_BGR30_to_RGB30, 0, - 0, convert_passthrough, 0, 0 }, // Format_RGB30 -- cgit v1.2.3