QImage::Format_Indexed8 image filling from QColor optimization

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-08-29 00:04:00 +03:00
parent 37aaef6a81
commit 10fe32ba4d

View file

@ -1534,8 +1534,9 @@ void QImage::fill(const QColor &color)
} else if (d->depth == 8) {
uint pixel = 0;
const QRgb crgba = color.rgba();
for (int i=0; i<d->colortable.size(); ++i) {
if (color.rgba() == d->colortable.at(i)) {
if (crgba == d->colortable.at(i)) {
pixel = i;
break;
}