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
This commit is contained in:
parent
091b0a01d1
commit
b5bbc1919b
@ -835,7 +835,7 @@ NS_IMETHODIMP nsScrollingView::CreateScrollControls(nsNativeWidget aNative)
|
|||||||
nsIView *scrolledView;
|
nsIView *scrolledView;
|
||||||
GetScrolledView(scrolledView);
|
GetScrolledView(scrolledView);
|
||||||
|
|
||||||
#if 1 // MOUSE WHEEL TRACKER CODE
|
#ifdef LOSER // MOUSE WHEEL TRACKER CODE
|
||||||
|
|
||||||
// XXX This code is to be reviewed by michealp
|
// XXX This code is to be reviewed by michealp
|
||||||
// It gets the Window for the view and the gets the widget
|
// It gets the Window for the view and the gets the widget
|
||||||
|
|||||||
@ -978,7 +978,7 @@ void nsViewManager :: RenderViews(nsIView *aRootView, nsIRenderingContext& aRC,
|
|||||||
// permanently remove any painted opaque views.
|
// permanently remove any painted opaque views.
|
||||||
mOffScreenCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate);
|
mOffScreenCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate);
|
||||||
mRedCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate);
|
mRedCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate);
|
||||||
mRedCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate);
|
mBlueCX->SetClipRegion(*paintedRgn, nsClipCombine_kSubtract, clipstate);
|
||||||
} else {
|
} else {
|
||||||
aRC.PopState(clipstate);
|
aRC.PopState(clipstate);
|
||||||
|
|
||||||
@ -2229,6 +2229,30 @@ nsIRenderingContext * nsViewManager :: CreateRenderingContext(nsIView &aView)
|
|||||||
return cx;
|
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
|
void nsViewManager::AddRectToDirtyRegion(nsIView* aView, const nsRect &aRect) const
|
||||||
{
|
{
|
||||||
// Get the dirty region associated with the view
|
// Get the dirty region associated with the view
|
||||||
|
|||||||
@ -127,6 +127,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
nsIRenderingContext *CreateRenderingContext(nsIView &aView);
|
nsIRenderingContext *CreateRenderingContext(nsIView &aView);
|
||||||
|
void AddRegionToDirtyRegion(nsIView* aView, const nsIRegion *aRegion) const;
|
||||||
void AddRectToDirtyRegion(nsIView* aView, const nsRect &aRect) const;
|
void AddRectToDirtyRegion(nsIView* aView, const nsRect &aRect) const;
|
||||||
void UpdateDirtyViews(nsIView *aView, nsRect *aParentRect) const;
|
void UpdateDirtyViews(nsIView *aView, nsRect *aParentRect) const;
|
||||||
void UpdateTransCnt(nsIView *oldview, nsIView *newview);
|
void UpdateTransCnt(nsIView *oldview, nsIView *newview);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user