imported patch bug_xxxxxx_gfx_image_16bpp_enabler

This commit is contained in:
Doug Turner 2010-03-19 00:05:29 -07:00
Родитель 0d67a1ea15
Коммит 564856e13b
2 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -105,6 +105,8 @@ _qimage_from_gfximage_format (gfxASurface::gfxImageFormat aFormat)
return QImage::Format_ARGB32_Premultiplied;
case gfxASurface::ImageFormatRGB24:
return QImage::Format_RGB32;
case gfxASurface::ImageFormatRGB16:
return QImage::Format_RGB16;
case gfxASurface::ImageFormatA8:
return QImage::Format_Indexed8;
case gfxASurface::ImageFormatA1:

Просмотреть файл

@ -670,6 +670,8 @@ nsWindow::Invalidate(const nsIntRect &aRect,
if (!mWidget)
return NS_OK;
mDirtyScrollArea = mDirtyScrollArea.united(QRect(aRect.x, aRect.y, aRect.width, aRect.height));
mWidget->update(aRect.x, aRect.y, aRect.width, aRect.height);
// QGraphicsItems cannot trigger a repaint themselves, so we start it on the view
@ -1020,9 +1022,6 @@ nsWindow::DoPaint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption)
if (r.isEmpty())
return nsEventStatus_eIgnore;
if (r.isEmpty())
return nsEventStatus_eIgnore;
if (!mDirtyScrollArea.isEmpty())
mDirtyScrollArea = QRegion();
@ -1123,7 +1122,8 @@ nsWindow::DoPaint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption)
gBufferImage->Width(),
gBufferImage->Height(),
gBufferImage->Stride(),
QImage::Format_RGB32);
gBufferImage->Format() == gfxASurface::ImageFormatRGB16 ?
QImage::Format_RGB16 : QImage::Format_RGB32);
aPainter->drawImage(QPoint(rect.x, rect.y), img,
QRect(0, 0, rect.width, rect.height));
}