work to get drawing done based on regions and not rects a=shaver r=beard

This commit is contained in:
pavlov%netscape.com 1999-09-28 01:28:03 +00:00
parent 9f0d86a5b3
commit 9018ba8840
3 changed files with 27 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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);