Bug 1083635. Part 7: Fix UpdateLayerTree to sync-decode images and flush pending notifications. r=mattwoodrow

--HG--
extra : rebase_source : d13f993c4dd1b868f47b6c79b39172bb40b3871c
This commit is contained in:
Robert O'Callahan 2014-11-07 13:20:27 +13:00
Родитель 7b63199d11
Коммит 0284071e77
3 изменённых файлов: 13 добавлений и 2 удалений

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

@ -275,8 +275,13 @@ NS_IMETHODIMP
nsDOMWindowUtils::UpdateLayerTree()
{
if (nsIPresShell* presShell = GetPresShell()) {
presShell->FlushPendingNotifications(Flush_Display);
nsRefPtr<nsViewManager> vm = presShell->GetViewManager();
vm->ProcessPendingUpdates();
nsView* view = vm->GetRootView();
if (view) {
presShell->Paint(view, view->GetBounds(),
nsIPresShell::PAINT_LAYERS | nsIPresShell::PAINT_SYNC_DECODE_IMAGES);
}
}
return NS_OK;
}

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

@ -1424,6 +1424,8 @@ public:
PAINT_LAYERS = 0x01,
/* Composite layers to the window. */
PAINT_COMPOSITE = 0x02,
/* Sync-decode images. */
PAINT_SYNC_DECODE_IMAGES = 0x04
};
virtual void Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
uint32_t aFlags) = 0;

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

@ -6270,7 +6270,8 @@ PresShell::Paint(nsView* aViewToPaint,
NS_WARNING("Must complete empty transaction when compositing!");
}
if (!(frame->GetStateBits() & NS_FRAME_UPDATE_LAYER_TREE) &&
if (!(aFlags & PAINT_SYNC_DECODE_IMAGES) &&
!(frame->GetStateBits() & NS_FRAME_UPDATE_LAYER_TREE) &&
!mNextPaintCompressed) {
NotifySubDocInvalidationFunc computeInvalidFunc =
presContext->MayHavePaintEventListenerInSubDocument() ? nsPresContext::NotifySubDocInvalidation : 0;
@ -6323,6 +6324,9 @@ PresShell::Paint(nsView* aViewToPaint,
if (!(aFlags & PAINT_COMPOSITE)) {
flags |= nsLayoutUtils::PAINT_NO_COMPOSITE;
}
if (aFlags & PAINT_SYNC_DECODE_IMAGES) {
flags |= nsLayoutUtils::PAINT_SYNC_DECODE_IMAGES;
}
if (mNextPaintCompressed) {
flags |= nsLayoutUtils::PAINT_COMPRESSED;
mNextPaintCompressed = false;