зеркало из https://github.com/mozilla/pjs.git
Bug 9489. Remove cliprect push/pop to decrease paint time on titledbuttons. The cliprect was not doing anything useful, and was costing about 36% of titledbutton paint time. r=hyatt
This commit is contained in:
Родитель
73d674380c
Коммит
562bcab6b2
|
@ -464,16 +464,27 @@ nsTitledButtonFrame::Paint(nsIPresContext* aPresContext,
|
||||||
|
|
||||||
mRenderer->PaintButton(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer, rect);
|
mRenderer->PaintButton(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer, rect);
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// Removing this code because it seriously impacts performance of
|
||||||
|
// titled buttons without providing any visible benefit. Please
|
||||||
|
// talk to hyatt or waterson if you think this code should be put
|
||||||
|
// back in. Ideally, we could pessimistically create a clip rect
|
||||||
|
// only if LayoutTitleAndImage() determines that the drawing would
|
||||||
|
// spill outside of the available rect.
|
||||||
aRenderingContext.PushState();
|
aRenderingContext.PushState();
|
||||||
PRBool clipState;
|
PRBool clipState;
|
||||||
aRenderingContext.SetClipRect(rect, nsClipCombine_kIntersect, clipState);
|
aRenderingContext.SetClipRect(rect, nsClipCombine_kIntersect, clipState);
|
||||||
|
#endif
|
||||||
|
|
||||||
LayoutTitleAndImage(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
LayoutTitleAndImage(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
|
|
||||||
PaintTitle(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
PaintTitle(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
PaintImage(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
PaintImage(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||||
|
|
||||||
|
#if 0
|
||||||
aRenderingContext.PopState(clipState);
|
aRenderingContext.PopState(clipState);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
aRenderingContext.SetColor(NS_RGB(0,128,0));
|
aRenderingContext.SetColor(NS_RGB(0,128,0));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче