From b5bbc1919bb73c19facead9122162ed28c876c1f Mon Sep 17 00:00:00 2001 From: "pavlov%netscape.com" Date: Tue, 28 Sep 1999 01:28:03 +0000 Subject: [PATCH] work to get drawing done based on regions and not rects a=shaver r=beard git-svn-id: svn://10.0.0.236/trunk@49179 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsScrollingView.cpp | 2 +- mozilla/view/src/nsViewManager.cpp | 26 +++++++++++++++++++++++++- mozilla/view/src/nsViewManager.h | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/mozilla/view/src/nsScrollingView.cpp b/mozilla/view/src/nsScrollingView.cpp index 0894adccf65..b370a28b954 100644 --- a/mozilla/view/src/nsScrollingView.cpp +++ b/mozilla/view/src/nsScrollingView.cpp @@ -835,7 +835,7 @@ NS_IMETHODIMP nsScrollingView::CreateScrollControls(nsNativeWidget aNative) nsIView *scrolledView; GetScrolledView(scrolledView); -#if 1 // MOUSE WHEEL TRACKER CODE +#ifdef LOSER // MOUSE WHEEL TRACKER CODE // XXX This code is to be reviewed by michealp // It gets the Window for the view and the gets the widget diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index e7dffd51300..1b76d8b866e 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -978,7 +978,7 @@ void nsViewManager :: RenderViews(nsIView *aRootView, nsIRenderingContext& aRC, // permanently remove any painted opaque views. mOffScreenCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate); mRedCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate); - mRedCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate); + mBlueCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate); } else { aRC.PopState(clipstate); @@ -2229,6 +2229,30 @@ nsIRenderingContext * nsViewManager :: CreateRenderingContext(nsIView &aView) return cx; } +void nsViewManager::AddRegionToDirtyRegion(nsIView* aView, const nsIRegion *aRegion) const +{ + // Get the dirty region associated with the view + nsIRegion *dirtyRegion; + + aView->GetDirtyRegion(dirtyRegion); + + if (nsnull == dirtyRegion) { + // The view doesn't have a dirty region so create one + nsresult rv = nsComponentManager::CreateInstance(kRegionCID, + nsnull, + NS_GET_IID(nsIRegion), + (void **)&dirtyRegion); + + if (NS_FAILED(rv)) return; + dirtyRegion->Init(); + aView->SetDirtyRegion(dirtyRegion); + } + + // since this is only used to buffer update requests, keep them in app units. + dirtyRegion->Union(*aRegion); + NS_RELEASE(dirtyRegion); +} + void nsViewManager::AddRectToDirtyRegion(nsIView* aView, const nsRect &aRect) const { // Get the dirty region associated with the view diff --git a/mozilla/view/src/nsViewManager.h b/mozilla/view/src/nsViewManager.h index 85437ff90c8..9efc148a126 100644 --- a/mozilla/view/src/nsViewManager.h +++ b/mozilla/view/src/nsViewManager.h @@ -127,6 +127,7 @@ protected: private: nsIRenderingContext *CreateRenderingContext(nsIView &aView); + void AddRegionToDirtyRegion(nsIView* aView, const nsIRegion *aRegion) const; void AddRectToDirtyRegion(nsIView* aView, const nsRect &aRect) const; void UpdateDirtyViews(nsIView *aView, nsRect *aParentRect) const; void UpdateTransCnt(nsIView *oldview, nsIView *newview);