Fix performance problem pointed out by Jim Nance that there is excessive creation and destruction of clip regions during painting. The fix stops using PushState() and PopState() to undo a translation, since that causes the creation and destruction of a clip region.

r=troy


git-svn-id: svn://10.0.0.236/trunk@57969 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu 2000-01-16 15:13:46 +00:00
parent 1a1d36da73
commit e94508f0df
2 changed files with 4 additions and 6 deletions

View File

@ -212,13 +212,12 @@ nsContainerFrame::PaintChild(nsIPresContext* aPresContext,
// coordinate system.
damageArea.x -= kidRect.x;
damageArea.y -= kidRect.y;
aRenderingContext.PushState();
aRenderingContext.Translate(kidRect.x, kidRect.y);
// Paint the kid
aFrame->Paint(aPresContext, aRenderingContext, damageArea, aWhichLayer);
PRBool clipState;
aRenderingContext.PopState(clipState);
// don't use PushState and PopState, because they're slow
aRenderingContext.Translate(-kidRect.x, -kidRect.y);
#ifdef NS_DEBUG
// Draw a border around the child

View File

@ -212,13 +212,12 @@ nsContainerFrame::PaintChild(nsIPresContext* aPresContext,
// coordinate system.
damageArea.x -= kidRect.x;
damageArea.y -= kidRect.y;
aRenderingContext.PushState();
aRenderingContext.Translate(kidRect.x, kidRect.y);
// Paint the kid
aFrame->Paint(aPresContext, aRenderingContext, damageArea, aWhichLayer);
PRBool clipState;
aRenderingContext.PopState(clipState);
// don't use PushState and PopState, because they're slow
aRenderingContext.Translate(-kidRect.x, -kidRect.y);
#ifdef NS_DEBUG
// Draw a border around the child