mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 598482 part 7 - Remove NS_VMREFRESH_* flags. NS_VMREFRESH_NO_SYNC is now the unchangable default. r=roc
This commit is contained in:
parent
b4421e4a3b
commit
cb70f28632
@ -4732,8 +4732,7 @@ nsDocShell::Repaint(bool aForce)
|
||||
nsIViewManager* viewManager = presShell->GetViewManager();
|
||||
NS_ENSURE_TRUE(viewManager, NS_ERROR_FAILURE);
|
||||
|
||||
// what about aForce ?
|
||||
NS_ENSURE_SUCCESS(viewManager->UpdateAllViews(0), NS_ERROR_FAILURE);
|
||||
NS_ENSURE_SUCCESS(viewManager->UpdateAllViews(), NS_ERROR_FAILURE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -7324,7 +7323,7 @@ nsDocShell::RestoreFromHistory()
|
||||
// call Thaw. So we issue the invalidate here.
|
||||
newRootView = newVM->GetRootView();
|
||||
if (newRootView) {
|
||||
newVM->UpdateView(newRootView, NS_VMREFRESH_NO_SYNC);
|
||||
newVM->UpdateView(newRootView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4250,7 +4250,7 @@ nsresult nsEditor::EndUpdateViewBatch()
|
||||
|
||||
StCaretHider caretHider(caret);
|
||||
|
||||
mBatch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
mBatch.EndUpdateViewBatch();
|
||||
|
||||
// Turn selection updating and notifications back on.
|
||||
|
||||
|
@ -7785,7 +7785,7 @@ ApplyRenderingChangeToTree(nsPresContext* aPresContext,
|
||||
gInApplyRenderingChangeToTree = false;
|
||||
#endif
|
||||
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -7832,7 +7832,7 @@ InvalidateCanvasIfNeeded(nsIPresShell* presShell, nsIContent* node)
|
||||
nsIViewManager::UpdateViewBatch batch(presShell->GetViewManager());
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
rootFrame->InvalidateFrameSubtree();
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_DEFERRED);
|
||||
batch.EndUpdateViewBatch();
|
||||
}
|
||||
|
||||
nsresult
|
||||
@ -11615,7 +11615,7 @@ nsCSSFrameConstructor::RebuildAllStyleData(nsChangeHint aExtraHint)
|
||||
// so we can recalculate while maintaining rule tree immutability
|
||||
nsresult rv = mPresShell->StyleSet()->BeginReconstruct();
|
||||
if (NS_FAILED(rv)) {
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -11650,7 +11650,7 @@ nsCSSFrameConstructor::RebuildAllStyleData(nsChangeHint aExtraHint)
|
||||
// reconstructed will still have their old style context pointers
|
||||
// until they are destroyed).
|
||||
mPresShell->StyleSet()->EndReconstruct();
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1569,8 +1569,7 @@ DocumentViewerImpl::Destroy()
|
||||
// the Freeze call above sets painting to be suppressed for our
|
||||
// document. So we do it ourselves and make it happen.
|
||||
vm->UpdateViewNoSuppression(rootView,
|
||||
rootView->GetBounds() - rootView->GetPosition(),
|
||||
NS_VMREFRESH_NO_SYNC);
|
||||
rootView->GetBounds() - rootView->GetPosition());
|
||||
|
||||
nsIView *rootViewParent = rootView->GetParent();
|
||||
if (rootViewParent) {
|
||||
@ -2845,7 +2844,7 @@ DocumentViewerImpl::SetTextZoom(float aTextZoom)
|
||||
// And do the external resources
|
||||
mDocument->EnumerateExternalResources(SetExtResourceTextZoom, &ZoomInfo);
|
||||
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2886,7 +2885,7 @@ DocumentViewerImpl::SetMinFontSize(PRInt32 aMinFontSize)
|
||||
mDocument->EnumerateExternalResources(SetExtResourceMinFontSize,
|
||||
NS_INT32_TO_PTR(aMinFontSize));
|
||||
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -2929,7 +2928,7 @@ DocumentViewerImpl::SetFullZoom(float aFullZoom)
|
||||
nsRect rect(nsPoint(0, 0), rootFrame->GetSize());
|
||||
rootFrame->Invalidate(rect);
|
||||
}
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
@ -2949,7 +2948,7 @@ DocumentViewerImpl::SetFullZoom(float aFullZoom)
|
||||
// And do the external resources
|
||||
mDocument->EnumerateExternalResources(SetExtResourceFullZoom, &ZoomInfo);
|
||||
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2145,7 +2145,7 @@ PresShell::ResizeReflowIgnoreOverride(nscoord aWidth, nscoord aHeight)
|
||||
DidDoReflow(true);
|
||||
}
|
||||
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
}
|
||||
|
||||
rootFrame = FrameManager()->GetRootFrame();
|
||||
@ -2974,7 +2974,7 @@ PresShell::RecreateFramesFor(nsIContent* aContent)
|
||||
nsresult rv = mFrameConstructor->ProcessRestyledFrames(changeList);
|
||||
--mChangeNestCount;
|
||||
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -4095,13 +4095,7 @@ PresShell::FlushPendingNotifications(mozFlushType aType)
|
||||
}
|
||||
}
|
||||
|
||||
PRUint32 updateFlags = NS_VMREFRESH_NO_SYNC;
|
||||
if (aType >= Flush_Display) {
|
||||
// Flushing paints, so perform the invalidates and drawing
|
||||
// immediately
|
||||
updateFlags = NS_VMREFRESH_IMMEDIATE;
|
||||
}
|
||||
batch.EndUpdateViewBatch(updateFlags);
|
||||
batch.EndUpdateViewBatch();
|
||||
}
|
||||
}
|
||||
|
||||
@ -7377,7 +7371,7 @@ PresShell::DoVerifyReflow()
|
||||
// First synchronously render what we have so far so that we can
|
||||
// see it.
|
||||
nsIView* rootView = mViewManager->GetRootView();
|
||||
mViewManager->UpdateView(rootView, NS_VMREFRESH_IMMEDIATE);
|
||||
mViewManager->UpdateView(rootView);
|
||||
|
||||
FlushPendingNotifications(Flush_Layout);
|
||||
mInVerifyReflow = true;
|
||||
@ -7597,7 +7591,7 @@ PresShell::Observe(nsISupports* aSubject,
|
||||
--mChangeNestCount;
|
||||
}
|
||||
}
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ nsComboboxControlFrame::SetFocus(bool aOn, bool aRepaint)
|
||||
// XXX this is rather inefficient
|
||||
nsIViewManager* vm = PresContext()->GetPresShell()->GetViewManager();
|
||||
if (vm) {
|
||||
vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
|
||||
vm->UpdateAllViews();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4644,22 +4644,15 @@ nsIFrame::InvalidateRoot(const nsRect& aDamageRect, PRUint32 aFlags)
|
||||
}
|
||||
}
|
||||
|
||||
PRUint32 flags =
|
||||
(aFlags & INVALIDATE_IMMEDIATE) ? NS_VMREFRESH_IMMEDIATE : NS_VMREFRESH_NO_SYNC;
|
||||
|
||||
nsRect rect = aDamageRect;
|
||||
nsRegion* excludeRegion = static_cast<nsRegion*>
|
||||
(Properties().Get(DeferInvalidatesProperty()));
|
||||
if (excludeRegion) {
|
||||
flags = NS_VMREFRESH_DEFERRED;
|
||||
|
||||
if (aFlags & INVALIDATE_EXCLUDE_CURRENT_PAINT) {
|
||||
nsRegion r;
|
||||
r.Sub(rect, *excludeRegion);
|
||||
if (r.IsEmpty())
|
||||
return;
|
||||
rect = r.GetBounds();
|
||||
}
|
||||
if (excludeRegion && (aFlags & INVALIDATE_EXCLUDE_CURRENT_PAINT)) {
|
||||
nsRegion r;
|
||||
r.Sub(rect, *excludeRegion);
|
||||
if (r.IsEmpty())
|
||||
return;
|
||||
rect = r.GetBounds();
|
||||
}
|
||||
|
||||
if (!(aFlags & INVALIDATE_NO_UPDATE_LAYER_TREE)) {
|
||||
@ -4668,7 +4661,7 @@ nsIFrame::InvalidateRoot(const nsRect& aDamageRect, PRUint32 aFlags)
|
||||
|
||||
nsIView* view = GetView();
|
||||
NS_ASSERTION(view, "This can only be called on frames with views");
|
||||
view->GetViewManager()->UpdateViewNoSuppression(view, rect, flags);
|
||||
view->GetViewManager()->UpdateViewNoSuppression(view, rect);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1533,19 +1533,6 @@ nsHTMLFramesetFrame::MouseDrag(nsPresContext* aPresContext,
|
||||
ENSURE_TRUE(weakFrame.IsAlive());
|
||||
if (change != 0) {
|
||||
mDrag.Reset(mDragger->mVertical, mDragger->mPrevNeighbor, change, this);
|
||||
nsIFrame* parentFrame = GetParent();
|
||||
if (!parentFrame) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the view immediately (make drag appear snappier)
|
||||
nsIViewManager* vm = aPresContext->GetPresShell()->GetViewManager();
|
||||
if (vm) {
|
||||
nsIView* root = vm->GetRootView();
|
||||
if (root) {
|
||||
vm->UpdateView(root, NS_VMREFRESH_IMMEDIATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -562,7 +562,7 @@ void nsLayoutDebuggingTools::ForceRefresh()
|
||||
return;
|
||||
nsIView* root = vm->GetRootView();
|
||||
if (root) {
|
||||
vm->UpdateView(root, NS_VMREFRESH_IMMEDIATE);
|
||||
vm->UpdateView(root);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -120,9 +120,8 @@ public:
|
||||
* Called to inform the view manager that the entire area of a view
|
||||
* is dirty and needs to be redrawn.
|
||||
* @param aView view to paint. should be root view
|
||||
* @param aUpdateFlags see bottom of nsIViewManager.h for description
|
||||
*/
|
||||
NS_IMETHOD UpdateView(nsIView *aView, PRUint32 aUpdateFlags) = 0;
|
||||
NS_IMETHOD UpdateView(nsIView *aView) = 0;
|
||||
|
||||
/**
|
||||
* Called to inform the view manager that some portion of a view is dirty and
|
||||
@ -130,17 +129,14 @@ public:
|
||||
* space. Does not check for paint suppression.
|
||||
* @param aView view to paint. should be root view
|
||||
* @param rect rect to mark as damaged
|
||||
* @param aUpdateFlags see bottom of nsIViewManager.h for description
|
||||
*/
|
||||
NS_IMETHOD UpdateViewNoSuppression(nsIView *aView, const nsRect &aRect,
|
||||
PRUint32 aUpdateFlags) = 0;
|
||||
NS_IMETHOD UpdateViewNoSuppression(nsIView *aView, const nsRect &aRect) = 0;
|
||||
|
||||
/**
|
||||
* Called to inform the view manager that it should redraw all views.
|
||||
* @param aView view to paint. should be root view
|
||||
* @param aUpdateFlags see bottom of nsIViewManager.h for description
|
||||
*/
|
||||
NS_IMETHOD UpdateAllViews(PRUint32 aUpdateFlags) = 0;
|
||||
NS_IMETHOD UpdateAllViews() = 0;
|
||||
|
||||
/**
|
||||
* Called to dispatch an event to the appropriate view. Often called
|
||||
@ -294,30 +290,19 @@ public:
|
||||
|
||||
/**
|
||||
* allow the view manager to refresh any damaged areas accumulated
|
||||
* after the BeginUpdateViewBatch() call. this may cause a
|
||||
* synchronous paint to occur inside the call if aUpdateFlags
|
||||
* NS_VMREFRESH_IMMEDIATE is set.
|
||||
* after the BeginUpdateViewBatch() call.
|
||||
*
|
||||
* If this is not the outermost view batch command, then this does
|
||||
* nothing except that the specified flags are remembered. When the
|
||||
* outermost batch finally ends, we merge together all the flags for the
|
||||
* inner batches in the following way:
|
||||
* -- If any batch specified NS_VMREFRESH_IMMEDIATE, then we use that flag
|
||||
* (i.e. there is a synchronous paint under the last EndUpdateViewBatch)
|
||||
* -- Otherwise if any batch specified NS_VMREFERSH_DEFERRED, then we use
|
||||
* that flag (i.e. invalidation is deferred until the processing of an
|
||||
* Invalidate PLEvent)
|
||||
* -- Otherwise all batches specified NS_VMREFRESH_NO_SYNC and we honor
|
||||
* that; all widgets are invalidated normally and will be painted the next
|
||||
* time the toolkit chooses to update them.
|
||||
* nothing. When the
|
||||
* outermost batch finally ends, all widgets are invalidated normally
|
||||
* and will be painted the next time the toolkit chooses to update them.
|
||||
*
|
||||
* @param aUpdateFlags see bottom of nsIViewManager.h for
|
||||
* description @return error status
|
||||
*/
|
||||
void EndUpdateViewBatch(PRUint32 aUpdateFlags) {
|
||||
void EndUpdateViewBatch() {
|
||||
if (!mRootVM)
|
||||
return;
|
||||
mRootVM->EndUpdateViewBatch(aUpdateFlags);
|
||||
mRootVM->EndUpdateViewBatch();
|
||||
mRootVM = nsnull;
|
||||
}
|
||||
|
||||
@ -332,7 +317,7 @@ private:
|
||||
friend class UpdateViewBatch;
|
||||
|
||||
virtual nsIViewManager* BeginUpdateViewBatch(void) = 0;
|
||||
NS_IMETHOD EndUpdateViewBatch(PRUint32 aUpdateFlags) = 0;
|
||||
NS_IMETHOD EndUpdateViewBatch() = 0;
|
||||
|
||||
public:
|
||||
/**
|
||||
@ -367,21 +352,4 @@ public:
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIViewManager, NS_IVIEWMANAGER_IID)
|
||||
|
||||
// Paint timing mode flags
|
||||
|
||||
// intermediate: do no special timing processing; repaint when the
|
||||
// toolkit issues an expose event (which will happen *before* PLEvent
|
||||
// processing). This is essentially the default.
|
||||
#define NS_VMREFRESH_NO_SYNC 0
|
||||
|
||||
// least immediate: we suppress invalidation, storing dirty areas in
|
||||
// views, and post an Invalidate PLEvent. The Invalidate event gets
|
||||
// processed after toolkit events such as window resize events!
|
||||
// This is only usable with EndUpdateViewBatch and EnableRefresh.
|
||||
#define NS_VMREFRESH_DEFERRED 0x0001
|
||||
|
||||
// most immediate: force a call to nsViewManager::Composite, which
|
||||
// synchronously updates the window(s) right away before returning
|
||||
#define NS_VMREFRESH_IMMEDIATE 0x0002
|
||||
|
||||
#endif // nsIViewManager_h___
|
||||
|
@ -106,7 +106,6 @@ nsViewManager::nsViewManager()
|
||||
// assumed to be cleared here.
|
||||
mHasPendingUpdates = false;
|
||||
mRecursiveRefreshPending = false;
|
||||
mUpdateBatchFlags = 0;
|
||||
}
|
||||
|
||||
nsViewManager::~nsViewManager()
|
||||
@ -377,10 +376,8 @@ void nsViewManager::Refresh(nsView *aView, nsIWidget *aWidget,
|
||||
}
|
||||
|
||||
if (RootViewManager()->mRecursiveRefreshPending) {
|
||||
// Unset this flag first, since if aUpdateFlags includes NS_VMREFRESH_IMMEDIATE
|
||||
// we'll reenter this code from the UpdateAllViews call.
|
||||
RootViewManager()->mRecursiveRefreshPending = false;
|
||||
UpdateAllViews(0);
|
||||
UpdateAllViews();
|
||||
}
|
||||
}
|
||||
|
||||
@ -442,10 +439,10 @@ void nsViewManager::ProcessPendingUpdates(nsView* aView, bool aDoInvalidate)
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsViewManager::UpdateView(nsIView *aView, PRUint32 aUpdateFlags)
|
||||
NS_IMETHODIMP nsViewManager::UpdateView(nsIView *aView)
|
||||
{
|
||||
// Mark the entire view as damaged
|
||||
return UpdateView(aView, aView->GetDimensions(), aUpdateFlags);
|
||||
return UpdateView(aView, aView->GetDimensions());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -585,8 +582,7 @@ ShouldIgnoreInvalidation(nsViewManager* aVM)
|
||||
return false;
|
||||
}
|
||||
|
||||
nsresult nsViewManager::UpdateView(nsIView *aView, const nsRect &aRect,
|
||||
PRUint32 aUpdateFlags)
|
||||
nsresult nsViewManager::UpdateView(nsIView *aView, const nsRect &aRect)
|
||||
{
|
||||
// If painting is suppressed in the presshell or an ancestor drop all
|
||||
// invalidates, it will invalidate everything when it unsuppresses.
|
||||
@ -594,12 +590,11 @@ nsresult nsViewManager::UpdateView(nsIView *aView, const nsRect &aRect,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return UpdateViewNoSuppression(aView, aRect, aUpdateFlags);
|
||||
return UpdateViewNoSuppression(aView, aRect);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsViewManager::UpdateViewNoSuppression(nsIView *aView,
|
||||
const nsRect &aRect,
|
||||
PRUint32 aUpdateFlags)
|
||||
const nsRect &aRect)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aView, "null view");
|
||||
|
||||
@ -630,25 +625,25 @@ NS_IMETHODIMP nsViewManager::UpdateViewNoSuppression(nsIView *aView,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsViewManager::UpdateAllViews(PRUint32 aUpdateFlags)
|
||||
NS_IMETHODIMP nsViewManager::UpdateAllViews()
|
||||
{
|
||||
if (RootViewManager() != this) {
|
||||
return RootViewManager()->UpdateAllViews(aUpdateFlags);
|
||||
return RootViewManager()->UpdateAllViews();
|
||||
}
|
||||
|
||||
UpdateViews(mRootView, aUpdateFlags);
|
||||
UpdateViews(mRootView);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager::UpdateViews(nsView *aView, PRUint32 aUpdateFlags)
|
||||
void nsViewManager::UpdateViews(nsView *aView)
|
||||
{
|
||||
// update this view.
|
||||
UpdateView(aView, aUpdateFlags);
|
||||
UpdateView(aView);
|
||||
|
||||
// update all children as well.
|
||||
nsView* childView = aView->GetFirstChild();
|
||||
while (nsnull != childView) {
|
||||
childView->GetViewManager()->UpdateViews(childView, aUpdateFlags);
|
||||
childView->GetViewManager()->UpdateViews(childView);
|
||||
childView = childView->GetNextSibling();
|
||||
}
|
||||
}
|
||||
@ -797,7 +792,7 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
||||
vm->FlushDelayedResize(true);
|
||||
|
||||
// Paint later.
|
||||
vm->UpdateView(vm->mRootView, NS_VMREFRESH_NO_SYNC);
|
||||
vm->UpdateView(vm->mRootView);
|
||||
didResize = true;
|
||||
|
||||
// not sure if it's valid for us to claim that we
|
||||
@ -822,20 +817,10 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
||||
nsView* view = static_cast<nsView*>(aView);
|
||||
if (!transparentWindow) {
|
||||
if (mPresShell) {
|
||||
// Do an update view batch. Make sure not to do it DEFERRED,
|
||||
// since that would effectively delay any invalidates that are
|
||||
// triggered by the WillPaint notification (they'd happen when
|
||||
// the invalid event fires, which is later than the reflow
|
||||
// event would fire and could end up being after some timer
|
||||
// events, leading to frame dropping in DHTML). Note that the
|
||||
// observer may try to reenter this code from inside
|
||||
// WillPaint() by trying to do a synchronous paint, but since
|
||||
// refresh will be disabled it won't be able to do the paint.
|
||||
// We should really sort out the rules on our synch painting
|
||||
// api....
|
||||
// Do an update view batch.
|
||||
UpdateViewBatch batch(this);
|
||||
rootVM->CallWillPaintOnObservers(event->willSendDidPaint);
|
||||
batch.EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
|
||||
batch.EndUpdateViewBatch();
|
||||
|
||||
// Get the view pointer again since the code above might have
|
||||
// destroyed it (bug 378273).
|
||||
@ -884,7 +869,7 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
||||
// ScrollingView's viewable area. (See bug 97674 for this
|
||||
// alternate patch.)
|
||||
|
||||
UpdateView(aView, rgn.GetBounds(), NS_VMREFRESH_NO_SYNC);
|
||||
UpdateView(aView, rgn.GetBounds());
|
||||
}
|
||||
|
||||
break;
|
||||
@ -1137,7 +1122,7 @@ NS_IMETHODIMP nsViewManager::InsertChild(nsIView *aParent, nsIView *aChild, nsIV
|
||||
//and mark this area as dirty if the view is visible...
|
||||
|
||||
if (nsViewVisibility_kHide != child->GetVisibility())
|
||||
child->GetViewManager()->UpdateView(child, NS_VMREFRESH_NO_SYNC);
|
||||
child->GetViewManager()->UpdateView(child);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1160,7 +1145,7 @@ NS_IMETHODIMP nsViewManager::RemoveChild(nsIView *aChild)
|
||||
if (nsnull != parent) {
|
||||
NS_ASSERTION(child->GetViewManager() == this ||
|
||||
parent->GetViewManager() == this, "wrong view manager");
|
||||
child->GetViewManager()->UpdateView(child, NS_VMREFRESH_NO_SYNC);
|
||||
child->GetViewManager()->UpdateView(child);
|
||||
parent->RemoveChild(child);
|
||||
}
|
||||
|
||||
@ -1182,9 +1167,8 @@ NS_IMETHODIMP nsViewManager::MoveViewTo(nsIView *aView, nscoord aX, nscoord aY)
|
||||
nsView* parentView = view->GetParent();
|
||||
if (parentView) {
|
||||
nsViewManager* parentVM = parentView->GetViewManager();
|
||||
parentVM->UpdateView(parentView, oldBounds, NS_VMREFRESH_NO_SYNC);
|
||||
parentVM->UpdateView(parentView, view->GetBoundsInParentUnits(),
|
||||
NS_VMREFRESH_NO_SYNC);
|
||||
parentVM->UpdateView(parentView, oldBounds);
|
||||
parentVM->UpdateView(parentView, view->GetBoundsInParentUnits());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1192,34 +1176,33 @@ NS_IMETHODIMP nsViewManager::MoveViewTo(nsIView *aView, nscoord aX, nscoord aY)
|
||||
}
|
||||
|
||||
void nsViewManager::InvalidateHorizontalBandDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut,
|
||||
PRUint32 aUpdateFlags, nscoord aY1, nscoord aY2, bool aInCutOut) {
|
||||
nscoord aY1, nscoord aY2, bool aInCutOut) {
|
||||
nscoord height = aY2 - aY1;
|
||||
if (aRect.x < aCutOut.x) {
|
||||
nsRect r(aRect.x, aY1, aCutOut.x - aRect.x, height);
|
||||
UpdateView(aView, r, aUpdateFlags);
|
||||
UpdateView(aView, r);
|
||||
}
|
||||
if (!aInCutOut && aCutOut.x < aCutOut.XMost()) {
|
||||
nsRect r(aCutOut.x, aY1, aCutOut.width, height);
|
||||
UpdateView(aView, r, aUpdateFlags);
|
||||
UpdateView(aView, r);
|
||||
}
|
||||
if (aCutOut.XMost() < aRect.XMost()) {
|
||||
nsRect r(aCutOut.XMost(), aY1, aRect.XMost() - aCutOut.XMost(), height);
|
||||
UpdateView(aView, r, aUpdateFlags);
|
||||
UpdateView(aView, r);
|
||||
}
|
||||
}
|
||||
|
||||
void nsViewManager::InvalidateRectDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut,
|
||||
PRUint32 aUpdateFlags) {
|
||||
void nsViewManager::InvalidateRectDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut) {
|
||||
NS_ASSERTION(aView->GetViewManager() == this,
|
||||
"InvalidateRectDifference called on view we don't own");
|
||||
if (aRect.y < aCutOut.y) {
|
||||
InvalidateHorizontalBandDifference(aView, aRect, aCutOut, aUpdateFlags, aRect.y, aCutOut.y, false);
|
||||
InvalidateHorizontalBandDifference(aView, aRect, aCutOut, aRect.y, aCutOut.y, false);
|
||||
}
|
||||
if (aCutOut.y < aCutOut.YMost()) {
|
||||
InvalidateHorizontalBandDifference(aView, aRect, aCutOut, aUpdateFlags, aCutOut.y, aCutOut.YMost(), true);
|
||||
InvalidateHorizontalBandDifference(aView, aRect, aCutOut, aCutOut.y, aCutOut.YMost(), true);
|
||||
}
|
||||
if (aCutOut.YMost() < aRect.YMost()) {
|
||||
InvalidateHorizontalBandDifference(aView, aRect, aCutOut, aUpdateFlags, aCutOut.YMost(), aRect.YMost(), false);
|
||||
InvalidateHorizontalBandDifference(aView, aRect, aCutOut, aCutOut.YMost(), aRect.YMost(), false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1244,13 +1227,12 @@ NS_IMETHODIMP nsViewManager::ResizeView(nsIView *aView, const nsRect &aRect, boo
|
||||
nsViewManager* parentVM = parentView->GetViewManager();
|
||||
if (!aRepaintExposedAreaOnly) {
|
||||
//Invalidate the union of the old and new size
|
||||
UpdateView(view, aRect, NS_VMREFRESH_NO_SYNC);
|
||||
parentVM->UpdateView(parentView, oldBounds, NS_VMREFRESH_NO_SYNC);
|
||||
UpdateView(view, aRect);
|
||||
parentVM->UpdateView(parentView, oldBounds);
|
||||
} else {
|
||||
InvalidateRectDifference(view, aRect, oldDimensions, NS_VMREFRESH_NO_SYNC);
|
||||
InvalidateRectDifference(view, aRect, oldDimensions);
|
||||
nsRect newBounds = view->GetBoundsInParentUnits();
|
||||
parentVM->InvalidateRectDifference(parentView, oldBounds, newBounds,
|
||||
NS_VMREFRESH_NO_SYNC);
|
||||
parentVM->InvalidateRectDifference(parentView, oldBounds, newBounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1289,12 +1271,11 @@ NS_IMETHODIMP nsViewManager::SetViewVisibility(nsIView *aView, nsViewVisibility
|
||||
nsView* parentView = view->GetParent();
|
||||
if (parentView) {
|
||||
parentView->GetViewManager()->
|
||||
UpdateView(parentView, view->GetBoundsInParentUnits(),
|
||||
NS_VMREFRESH_NO_SYNC);
|
||||
UpdateView(parentView, view->GetBoundsInParentUnits());
|
||||
}
|
||||
}
|
||||
else {
|
||||
UpdateView(view, NS_VMREFRESH_NO_SYNC);
|
||||
UpdateView(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1345,7 +1326,7 @@ NS_IMETHODIMP nsViewManager::SetViewZIndex(nsIView *aView, bool aAutoZIndex, PRI
|
||||
|
||||
if (oldidx != aZIndex || oldTopMost != aTopMost ||
|
||||
oldIsAuto != aAutoZIndex) {
|
||||
UpdateView(view, NS_VMREFRESH_NO_SYNC);
|
||||
UpdateView(view);
|
||||
}
|
||||
|
||||
return rv;
|
||||
@ -1358,10 +1339,10 @@ NS_IMETHODIMP nsViewManager::GetDeviceContext(nsDeviceContext *&aContext)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsViewManager::TriggerRefresh(PRUint32 aUpdateFlags)
|
||||
void nsViewManager::TriggerRefresh()
|
||||
{
|
||||
if (!IsRootVM()) {
|
||||
RootViewManager()->TriggerRefresh(aUpdateFlags);
|
||||
RootViewManager()->TriggerRefresh();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1379,16 +1360,12 @@ nsIViewManager* nsViewManager::BeginUpdateViewBatch(void)
|
||||
return RootViewManager()->BeginUpdateViewBatch();
|
||||
}
|
||||
|
||||
if (mUpdateBatchCnt == 0) {
|
||||
mUpdateBatchFlags = 0;
|
||||
}
|
||||
|
||||
++mUpdateBatchCnt;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsViewManager::EndUpdateViewBatch(PRUint32 aUpdateFlags)
|
||||
NS_IMETHODIMP nsViewManager::EndUpdateViewBatch()
|
||||
{
|
||||
NS_ASSERTION(IsRootVM(), "Should only be called on root");
|
||||
|
||||
@ -1402,9 +1379,8 @@ NS_IMETHODIMP nsViewManager::EndUpdateViewBatch(PRUint32 aUpdateFlags)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mUpdateBatchFlags |= aUpdateFlags;
|
||||
if (mUpdateBatchCnt == 0) {
|
||||
TriggerRefresh(mUpdateBatchFlags);
|
||||
TriggerRefresh();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -102,10 +102,9 @@ public:
|
||||
NS_IMETHOD SetWindowDimensions(nscoord width, nscoord height);
|
||||
NS_IMETHOD FlushDelayedResize(bool aDoReflow);
|
||||
|
||||
NS_IMETHOD UpdateView(nsIView *aView, PRUint32 aUpdateFlags);
|
||||
NS_IMETHOD UpdateViewNoSuppression(nsIView *aView, const nsRect &aRect,
|
||||
PRUint32 aUpdateFlags);
|
||||
NS_IMETHOD UpdateAllViews(PRUint32 aUpdateFlags);
|
||||
NS_IMETHOD UpdateView(nsIView *aView);
|
||||
NS_IMETHOD UpdateViewNoSuppression(nsIView *aView, const nsRect &aRect);
|
||||
NS_IMETHOD UpdateAllViews();
|
||||
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent *aEvent,
|
||||
nsIView* aTargetView, nsEventStatus* aStatus);
|
||||
@ -134,7 +133,7 @@ public:
|
||||
NS_IMETHOD GetDeviceContext(nsDeviceContext *&aContext);
|
||||
|
||||
virtual nsIViewManager* BeginUpdateViewBatch(void);
|
||||
NS_IMETHOD EndUpdateViewBatch(PRUint32 aUpdateFlags);
|
||||
NS_IMETHOD EndUpdateViewBatch();
|
||||
|
||||
NS_IMETHOD GetRootWidget(nsIWidget **aWidget);
|
||||
|
||||
@ -163,9 +162,9 @@ private:
|
||||
const nsRegion &aDamagedRegion,
|
||||
nsView* aIgnoreWidgetView);
|
||||
|
||||
void UpdateViews(nsView *aView, PRUint32 aUpdateFlags);
|
||||
void UpdateViews(nsView *aView);
|
||||
|
||||
void TriggerRefresh(PRUint32 aUpdateFlags);
|
||||
void TriggerRefresh();
|
||||
|
||||
// aView is the view for aWidget and aRegion is relative to aWidget.
|
||||
void Refresh(nsView *aView, nsIWidget *aWidget, const nsIntRegion& aRegion);
|
||||
@ -175,9 +174,9 @@ private:
|
||||
const nsRegion& aRegion, const nsIntRegion& aIntRegion,
|
||||
bool aPaintDefaultBackground, bool aWillSendDidPaint);
|
||||
|
||||
void InvalidateRectDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut, PRUint32 aUpdateFlags);
|
||||
void InvalidateRectDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut);
|
||||
void InvalidateHorizontalBandDifference(nsView *aView, const nsRect& aRect, const nsRect& aCutOut,
|
||||
PRUint32 aUpdateFlags, nscoord aY1, nscoord aY2, bool aInCutOut);
|
||||
nscoord aY1, nscoord aY2, bool aInCutOut);
|
||||
|
||||
// Utilities
|
||||
|
||||
@ -225,7 +224,7 @@ private:
|
||||
RootViewManager()->mPainting = aPainting;
|
||||
}
|
||||
|
||||
nsresult UpdateView(nsIView *aView, const nsRect &aRect, PRUint32 aUpdateFlags);
|
||||
nsresult UpdateView(nsIView *aView, const nsRect &aRect);
|
||||
|
||||
public: // NOT in nsIViewManager, so private to the view module
|
||||
nsView* GetRootViewImpl() const { return mRootView; }
|
||||
@ -264,7 +263,6 @@ private:
|
||||
// ClearUpdateCount() on the root viewmanager to access mUpdateCnt.
|
||||
PRInt32 mUpdateCnt;
|
||||
PRInt32 mUpdateBatchCnt;
|
||||
PRUint32 mUpdateBatchFlags;
|
||||
// Use IsPainting() and SetPainting() to access mPainting.
|
||||
bool mPainting;
|
||||
bool mRecursiveRefreshPending;
|
||||
|
@ -116,7 +116,7 @@ nsNativeThemeGTK::RefreshWidgetWindow(nsIFrame* aFrame)
|
||||
if (!vm)
|
||||
return;
|
||||
|
||||
vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
|
||||
vm->UpdateAllViews();
|
||||
}
|
||||
|
||||
static bool IsFrameContentNodeInNamespace(nsIFrame *aFrame, PRUint32 aNamespace)
|
||||
|
Loading…
Reference in New Issue
Block a user