author | Lars T Hansen <lhansen@mozilla.com> |
Fri, 07 Nov 2014 12:08:03 +0100 | |
changeset 214589 | 730b160795028dd09c72f7ba3877e2d5515b1e73 |
parent 214588 | 97982a1129a2338a6d5c23cdc1d44fbf077ceb66 (current diff) |
parent 214587 | 5bebfbefb3c269af57215be004997e3293b1218d (diff) |
child 214590 | d6e705456c796af6dbd1994dc8d962af24725095 |
push id | 27788 |
push user | ryanvm@gmail.com |
push date | Fri, 07 Nov 2014 18:23:58 +0000 |
treeherder | mozilla-central@c39ff12ad6eb [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
milestone | 36.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -270,18 +270,23 @@ nsDOMWindowUtils::Redraw(uint32_t aCount } return NS_ERROR_FAILURE; } 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; } NS_IMETHODIMP nsDOMWindowUtils::SetCSSViewport(float aWidthPx, float aHeightPx) { if (!nsContentUtils::IsCallerChrome()) {
--- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -1419,16 +1419,18 @@ public: enum PaintFlags { /* Update the layer tree and paint PaintedLayers. If this is not specified, * we may still have to do it if the layer tree lost PaintedLayer contents * we need for compositing. */ 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; virtual nsresult HandleEvent(nsIFrame* aFrame, mozilla::WidgetGUIEvent* aEvent, bool aDontRetargetEvents, nsEventStatus* aEventStatus) = 0; virtual bool ShouldIgnoreInvalidation() = 0;
--- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -6265,17 +6265,18 @@ PresShell::Paint(nsView* aViewToP if (!(aFlags & PAINT_LAYERS)) { if (layerManager->EndEmptyTransaction()) { return; } 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; bool computeInvalidRect = computeInvalidFunc || (layerManager->GetBackendType() == LayersBackend::LAYERS_BASIC); UniquePtr<LayerProperties> props; if (computeInvalidRect) { @@ -6318,16 +6319,19 @@ PresShell::Paint(nsView* aViewToP frame->ClearPresShellsFromLastPaint(); } nscolor bgcolor = ComputeBackstopColor(aViewToPaint); uint32_t flags = nsLayoutUtils::PAINT_WIDGET_LAYERS | nsLayoutUtils::PAINT_EXISTING_TRANSACTION; 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; } if (frame) { // We can paint directly into the widget using its layer manager. nsLayoutUtils::PaintFrame(nullptr, frame, aDirtyRegion, bgcolor, flags);