Bug 693930 - Release layer tree for inactive tabs. r=roc

This commit is contained in:
Oleg Romashin 2011-10-18 15:28:39 -04:00
parent 7e6ba97bfa
commit e8900854ba

View File

@ -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);
}
}
}
}
}