Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Bug 782413: Only paint widgets that have a layer manager. r=cjones
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwoodrow committed Aug 14, 2012
1 parent 45b1a92 commit 9f4e1d0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
8 changes: 3 additions & 5 deletions view/src/nsViewManager.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -431,8 +431,6 @@ void nsViewManager::ProcessPendingUpdatesForView(nsView* aView,
#endif
SetPainting(false);
}
} else {
FlushDirtyRegionToWidget(aView);
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions widget/gonk/nsWindow.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -635,6 +636,15 @@ nsWindow::GetNaturalBounds()
return gScreenBounds;
}

bool
nsWindow::NeedsPaint()
{
if (!mLayerManager) {
return false;
}
return nsIWidget::NeedsPaint();
}

// nsScreenGonk.cpp

nsScreenGonk::nsScreenGonk(void *nativeScreen)
Expand Down
1 change: 1 addition & 0 deletions widget/gonk/nsWindow.h
Expand Up @@ -106,6 +106,7 @@ class nsWindow : public nsBaseWidget
virtual PRUint32 GetGLFrameBufferFormat() MOZ_OVERRIDE;

virtual nsIntRect GetNaturalBounds() MOZ_OVERRIDE;
virtual bool NeedsPaint();

protected:
nsWindow* mParent;
Expand Down

0 comments on commit 9f4e1d0

Please sign in to comment.