Fix A2RGB30 compositing tests

With two alpha-bits half opacity can not be represented, so we must use
one third (85) instead of half (127).

Change-Id: I2b3f1c983a3034196bf2604840945ad3a81f5b38
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
This commit is contained in:
Allan Sandfeld Jensen 2015-07-01 10:48:33 +02:00 committed by Liang Qi
parent 6251d4dafc
commit cd297f99a2

View File

@ -4877,17 +4877,17 @@ void tst_QPainter::blendARGBonRGB_data()
QTest::newRow("ARGB_PM source-in RGB666") << QImage::Format_RGB666 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_SourceIn << qRgba(127, 0, 0, 127) << 125;
QTest::newRow("ARGB over RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
<< QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 127) << 127;
<< QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 85) << 85;
QTest::newRow("ARGB_PM over RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_SourceOver << qRgba(127, 0, 0, 127) << 127;
<< QPainter::CompositionMode_SourceOver << qRgba(85, 0, 0, 85) << 85;
QTest::newRow("ARGB source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
<< QPainter::CompositionMode_Source << qRgba(255, 0, 0, 127) << 127;
<< QPainter::CompositionMode_Source << qRgba(255, 0, 0, 85) << 85;
QTest::newRow("ARGB_PM source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_Source << qRgba(127, 0, 0, 127) << 127;
<< QPainter::CompositionMode_Source << qRgba(85, 0, 0, 85) << 85;
QTest::newRow("ARGB source-in RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
<< QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 127) << 127;
<< QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 85) << 85;
QTest::newRow("ARGB_PM source-in RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_SourceIn << qRgba(127, 0, 0, 127) << 127;
<< QPainter::CompositionMode_SourceIn << qRgba(85, 0, 0, 85) << 85;
}
void tst_QPainter::blendARGBonRGB()