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:
parent
1a1d36da73
commit
e94508f0df
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user