зеркало из https://github.com/mozilla/gecko-dev.git
Bug 782413: Only paint widgets that have a layer manager. r=cjones
This commit is contained in:
Родитель
94d1e10bd0
Коммит
732d73658c
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче