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

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

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

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

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