Bug 782413: Only paint widgets that have a layer manager. r=cjones

This commit is contained in:
Matt Woodrow 2012-08-13 19:41:09 -07:00
Родитель 94d1e10bd0
Коммит 732d73658c
3 изменённых файлов: 14 добавлений и 5 удалений

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

@ -398,11 +398,11 @@ void nsViewManager::ProcessPendingUpdatesForView(nsView* aView,
// Push out updates after we've processed the children; ensures that
// damage is applied based on the final widget geometry
if (aFlushDirtyRegion) {
if (aFlushDirtyRegion && aView->HasNonEmptyDirtyRegion()) {
FlushDirtyRegionToWidget(aView);
if (IsRefreshDriverPaintingEnabled()) {
nsIWidget *widget = aView->GetWidget();
if (widget && widget->NeedsPaint() && aView->HasNonEmptyDirtyRegion()) {
FlushDirtyRegionToWidget(aView);
if (widget && widget->NeedsPaint()) {
// If an ancestor widget was hidden and then shown, we could
// have a delayed resize to handle.
for (nsViewManager *vm = this; vm;
@ -431,8 +431,6 @@ void nsViewManager::ProcessPendingUpdatesForView(nsView* aView,
#endif
SetPainting(false);
}
} else {
FlushDirtyRegionToWidget(aView);
}
}
}

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

@ -525,6 +525,7 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
if (mLayerManager)
return mLayerManager;
LOG("Creating layer Manaer\n");
// Set mUseAcceleratedRendering here to make it consistent with
// nsBaseWidget::GetLayerManager
mUseAcceleratedRendering = GetShouldAccelerate();
@ -635,6 +636,15 @@ nsWindow::GetNaturalBounds()
return gScreenBounds;
}
bool
nsWindow::NeedsPaint()
{
if (!mLayerManager) {
return false;
}
return nsIWidget::NeedsPaint();
}
// nsScreenGonk.cpp
nsScreenGonk::nsScreenGonk(void *nativeScreen)

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

@ -106,6 +106,7 @@ public:
virtual PRUint32 GetGLFrameBufferFormat() MOZ_OVERRIDE;
virtual nsIntRect GetNaturalBounds() MOZ_OVERRIDE;
virtual bool NeedsPaint();
protected:
nsWindow* mParent;