From 562bcab6b2200e3e5f502d589752b11c95b261a5 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Thu, 2 Dec 1999 02:50:29 +0000 Subject: [PATCH] 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 --- layout/xul/base/src/nsTitledButtonFrame.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/layout/xul/base/src/nsTitledButtonFrame.cpp b/layout/xul/base/src/nsTitledButtonFrame.cpp index 4e69bb88766..f7724b100d5 100644 --- a/layout/xul/base/src/nsTitledButtonFrame.cpp +++ b/layout/xul/base/src/nsTitledButtonFrame.cpp @@ -464,16 +464,27 @@ nsTitledButtonFrame::Paint(nsIPresContext* aPresContext, 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(); PRBool clipState; aRenderingContext.SetClipRect(rect, nsClipCombine_kIntersect, clipState); +#endif LayoutTitleAndImage(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); PaintTitle(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); PaintImage(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); +#if 0 aRenderingContext.PopState(clipState); +#endif /* aRenderingContext.SetColor(NS_RGB(0,128,0));