зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
7b63199d11
Коммит
0284071e77
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче