зеркало из https://github.com/mozilla/gecko-dev.git
Bug 826817. Part 3: Remove will-send-did-paint flag from nsIWidgetListener::WillPaintWindow. r=tnikkel
This commit is contained in:
Родитель
956f4861da
Коммит
15c63857c3
|
@ -380,7 +380,7 @@ public:
|
|||
virtual bool WindowMoved(nsIWidget* aWidget, int32_t x, int32_t y) MOZ_OVERRIDE;
|
||||
virtual bool WindowResized(nsIWidget* aWidget, int32_t aWidth, int32_t aHeight) MOZ_OVERRIDE;
|
||||
virtual bool RequestWindowClose(nsIWidget* aWidget) MOZ_OVERRIDE;
|
||||
virtual void WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint) MOZ_OVERRIDE;
|
||||
virtual void WillPaintWindow(nsIWidget* aWidget) MOZ_OVERRIDE;
|
||||
virtual bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion, uint32_t aFlags) MOZ_OVERRIDE;
|
||||
virtual void DidPaintWindow() MOZ_OVERRIDE;
|
||||
virtual void RequestRepaint() MOZ_OVERRIDE;
|
||||
|
|
|
@ -332,7 +332,7 @@ private:
|
|||
/**
|
||||
* Call WillPaint() on all view observers under this vm root.
|
||||
*/
|
||||
void CallWillPaintOnObservers(bool aWillSendDidPaint);
|
||||
void CallWillPaintOnObservers();
|
||||
void ReparentChildWidgets(nsView* aView, nsIWidget *aNewWidget);
|
||||
void ReparentWidgets(nsView* aView, nsView *aParent);
|
||||
void InvalidateWidgetArea(nsView *aWidgetView, const nsRegion &aDamagedRegion);
|
||||
|
@ -340,7 +340,7 @@ private:
|
|||
void InvalidateViews(nsView *aView);
|
||||
|
||||
// aView is the view for aWidget and aRegion is relative to aWidget.
|
||||
void Refresh(nsView *aView, const nsIntRegion& aRegion, bool aWillSendDidPaint);
|
||||
void Refresh(nsView *aView, const nsIntRegion& aRegion);
|
||||
|
||||
void InvalidateRectDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut);
|
||||
void InvalidateHorizontalBandDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut,
|
||||
|
@ -377,7 +377,7 @@ private:
|
|||
// be deferred while refresh is disabled.
|
||||
bool IsPaintingAllowed() { return RootViewManager()->mRefreshDisableCount == 0; }
|
||||
|
||||
void WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint);
|
||||
void WillPaintWindow(nsIWidget* aWidget);
|
||||
bool PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion,
|
||||
uint32_t aFlags);
|
||||
void DidPaintWindow();
|
||||
|
|
|
@ -951,10 +951,10 @@ nsView::RequestWindowClose(nsIWidget* aWidget)
|
|||
}
|
||||
|
||||
void
|
||||
nsView::WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint)
|
||||
nsView::WillPaintWindow(nsIWidget* aWidget)
|
||||
{
|
||||
nsRefPtr<nsViewManager> vm = mViewManager;
|
||||
vm->WillPaintWindow(aWidget, aWillSendDidPaint);
|
||||
vm->WillPaintWindow(aWidget);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -288,8 +288,7 @@ nsView* nsViewManager::GetDisplayRootFor(nsView* aView)
|
|||
aContext may be null, in which case layers should be used for
|
||||
rendering.
|
||||
*/
|
||||
void nsViewManager::Refresh(nsView *aView, const nsIntRegion& aRegion,
|
||||
bool aWillSendDidPaint)
|
||||
void nsViewManager::Refresh(nsView *aView, const nsIntRegion& aRegion)
|
||||
{
|
||||
NS_ASSERTION(aView->GetViewManager() == this, "wrong view manager");
|
||||
|
||||
|
@ -333,7 +332,7 @@ void nsViewManager::Refresh(nsView *aView, const nsIntRegion& aRegion,
|
|||
#endif
|
||||
mPresShell->Paint(aView, damageRegion,
|
||||
nsIPresShell::PAINT_COMPOSITE |
|
||||
(aWillSendDidPaint ? nsIPresShell::PAINT_WILL_SEND_DID_PAINT : 0));
|
||||
nsIPresShell::PAINT_WILL_SEND_DID_PAINT);
|
||||
#ifdef DEBUG_INVALIDATIONS
|
||||
printf("--ENDCOMPOSITE--\n");
|
||||
#endif
|
||||
|
@ -615,7 +614,7 @@ void nsViewManager::InvalidateViews(nsView *aView)
|
|||
}
|
||||
}
|
||||
|
||||
void nsViewManager::WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint)
|
||||
void nsViewManager::WillPaintWindow(nsIWidget* aWidget)
|
||||
{
|
||||
if (aWidget) {
|
||||
nsView* view = nsView::GetViewFor(aWidget);
|
||||
|
@ -632,7 +631,7 @@ void nsViewManager::WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint)
|
|||
|
||||
nsCOMPtr<nsIPresShell> shell = mPresShell;
|
||||
if (shell) {
|
||||
shell->WillPaintWindow(aWillSendDidPaint);
|
||||
shell->WillPaintWindow(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -649,7 +648,7 @@ bool nsViewManager::PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion,
|
|||
// destroyed it during CallWillPaintOnObservers (bug 378273).
|
||||
nsView* view = nsView::GetViewFor(aWidget);
|
||||
if (view && !aRegion.IsEmpty()) {
|
||||
Refresh(view, aRegion, true);
|
||||
Refresh(view, aRegion);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1117,7 +1116,7 @@ nsViewManager::ProcessPendingUpdates()
|
|||
|
||||
// Flush things like reflows by calling WillPaint on observer presShells.
|
||||
if (mPresShell) {
|
||||
CallWillPaintOnObservers(true);
|
||||
CallWillPaintOnObservers();
|
||||
}
|
||||
ProcessPendingUpdatesForView(mRootView, true);
|
||||
}
|
||||
|
@ -1137,7 +1136,7 @@ nsViewManager::UpdateWidgetGeometry()
|
|||
}
|
||||
|
||||
void
|
||||
nsViewManager::CallWillPaintOnObservers(bool aWillSendDidPaint)
|
||||
nsViewManager::CallWillPaintOnObservers()
|
||||
{
|
||||
NS_PRECONDITION(IsRootVM(), "Must be root VM for this to be called!");
|
||||
|
||||
|
@ -1149,7 +1148,7 @@ nsViewManager::CallWillPaintOnObservers(bool aWillSendDidPaint)
|
|||
if (vm->mRootView && vm->mRootView->IsEffectivelyVisible()) {
|
||||
nsCOMPtr<nsIPresShell> shell = vm->GetPresShell();
|
||||
if (shell) {
|
||||
shell->WillPaint(aWillSendDidPaint);
|
||||
shell->WillPaint(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1014,7 +1014,7 @@ nsWindow::DrawTo(gfxASurface *targetSurface, const nsIntRect &invalidRect)
|
|||
bool painted = false;
|
||||
nsIntRegion region = invalidRect;
|
||||
|
||||
mWidgetListener->WillPaintWindow(this, true);
|
||||
mWidgetListener->WillPaintWindow(this);
|
||||
|
||||
switch (GetLayerManager(nullptr)->GetBackendType()) {
|
||||
case mozilla::layers::LAYERS_BASIC: {
|
||||
|
|
|
@ -2683,7 +2683,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
|||
|
||||
nsIWidgetListener* listener = mGeckoChild->GetWidgetListener();
|
||||
if (listener) {
|
||||
listener->WillPaintWindow(mGeckoChild, false);
|
||||
listener->WillPaintWindow(mGeckoChild);
|
||||
}
|
||||
}
|
||||
[super viewWillDraw];
|
||||
|
|
|
@ -224,7 +224,7 @@ nsWindow::DoDraw(void)
|
|||
|
||||
nsIWidgetListener* listener = gWindowToRedraw->GetWidgetListener();
|
||||
if (listener) {
|
||||
listener->WillPaintWindow(gWindowToRedraw, true);
|
||||
listener->WillPaintWindow(gWindowToRedraw);
|
||||
}
|
||||
|
||||
LayerManager* lm = gWindowToRedraw->GetLayerManager();
|
||||
|
|
|
@ -2008,7 +2008,7 @@ nsWindow::OnExposeEvent(cairo_t *cr)
|
|||
// Dispatch WillPaintWindow notification to allow scripts etc. to run
|
||||
// before we paint
|
||||
{
|
||||
listener->WillPaintWindow(this, true);
|
||||
listener->WillPaintWindow(this);
|
||||
|
||||
// If the window has been destroyed during the will paint notification,
|
||||
// there is nothing left to do.
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
* at a time when it's OK to change the geometry of this widget or of
|
||||
* other widgets. Must be called before every call to PaintWindow.
|
||||
*/
|
||||
virtual void WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint) { }
|
||||
virtual void WillPaintWindow(nsIWidget* aWidget) { }
|
||||
|
||||
/**
|
||||
* Paint the specified region of the window. Returns true if the
|
||||
|
|
|
@ -1034,7 +1034,7 @@ nsWindow::DoPaint(QPainter* aPainter, const QStyleOptionGraphicsItem* aOption, Q
|
|||
// Call WillPaintWindow to allow scripts etc. to run before we paint
|
||||
{
|
||||
if (mWidgetListener)
|
||||
mWidgetListener->WillPaintWindow(this, true);
|
||||
mWidgetListener->WillPaintWindow(this);
|
||||
}
|
||||
|
||||
if (!mWidget)
|
||||
|
|
|
@ -214,7 +214,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel)
|
|||
|
||||
nsIWidgetListener* listener = GetPaintListener();
|
||||
if (listener) {
|
||||
listener->WillPaintWindow(this, true);
|
||||
listener->WillPaintWindow(this);
|
||||
}
|
||||
// Re-get the listener since the will paint notification may have killed it.
|
||||
listener = GetPaintListener();
|
||||
|
|
|
@ -521,7 +521,7 @@ PuppetWidget::Paint()
|
|||
mDirtyRegion.SetEmpty();
|
||||
mPaintTask.Revoke();
|
||||
|
||||
mAttachedWidgetListener->WillPaintWindow(this, true);
|
||||
mAttachedWidgetListener->WillPaintWindow(this);
|
||||
|
||||
if (mAttachedWidgetListener) {
|
||||
#ifdef DEBUG
|
||||
|
|
Загрузка…
Ссылка в новой задаче