зеркало из https://github.com/mozilla/gecko-dev.git
Bug 693930 - Release layer tree for inactive tabs. r=roc
This commit is contained in:
Родитель
671ab8b183
Коммит
c7bbdd04ae
|
@ -73,6 +73,7 @@
|
|||
#include "nsStyleAnimation.h"
|
||||
#include "nsCSSProps.h"
|
||||
#include "nsDOMFile.h"
|
||||
#include "BasicLayers.h"
|
||||
|
||||
#if defined(MOZ_X11) && defined(MOZ_WIDGET_GTK2)
|
||||
#include <gdk/gdk.h>
|
||||
|
@ -339,6 +340,21 @@ nsDOMWindowUtils::SetDisplayPortForElement(float aXPx, float aYPx,
|
|||
rootFrame->InvalidateWithFlags(
|
||||
usingDisplayport ? rootDisplayport : rootFrame->GetVisualOverflowRect(),
|
||||
nsIFrame::INVALIDATE_NO_THEBES_LAYERS);
|
||||
|
||||
// Send empty paint transaction in order to release retained layers
|
||||
if (displayport.IsEmpty()) {
|
||||
nsCOMPtr<nsIWidget> widget = GetWidget();
|
||||
if (widget) {
|
||||
bool isRetainingManager;
|
||||
LayerManager* manager = widget->GetLayerManager(&isRetainingManager);
|
||||
if (isRetainingManager) {
|
||||
manager->BeginTransaction();
|
||||
nsLayoutUtils::PaintFrame(nsnull, rootFrame, nsRegion(), NS_RGB(255, 255, 255),
|
||||
nsLayoutUtils::PAINT_WIDGET_LAYERS |
|
||||
nsLayoutUtils::PAINT_EXISTING_TRANSACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче