From 904e20fdd0075de7e9ae55a446e73f6bff831aee Mon Sep 17 00:00:00 2001 From: Huw D M Davies Date: Sat, 7 Nov 1998 12:41:49 +0000 Subject: [PATCH] Optimize RoundRect32 to call Rectangle32 if either ellipse dimension is zero. --- graphics/painting.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/graphics/painting.c b/graphics/painting.c index 48c13124e0e..c6df9a3c66f 100644 --- a/graphics/painting.c +++ b/graphics/painting.c @@ -244,10 +244,16 @@ BOOL16 WINAPI RoundRect16( HDC16 hdc, INT16 left, INT16 top, INT16 right, BOOL32 WINAPI RoundRect32( HDC32 hdc, INT32 left, INT32 top, INT32 right, INT32 bottom, INT32 ell_width, INT32 ell_height ) { - DC * dc = DC_GetDCPtr( hdc ); - return dc && dc->funcs->pRoundRect && + if(ell_width == 0 || ell_height == 0) /* Just an optimization */ + return Rectangle32(hdc, left, top, right, bottom); + + else { + DC * dc = DC_GetDCPtr( hdc ); + + return dc && dc->funcs->pRoundRect && dc->funcs->pRoundRect(dc,left,top,right,bottom,ell_width,ell_height); + } } -- 2.11.4.GIT