deferred creation of null pen until we actually need to use it.

This commit is contained in:
michaelp 1998-05-07 18:00:48 +00:00
Родитель 72f8a6f853
Коммит 4702d24f2a
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -286,8 +286,6 @@ nsresult nsRenderingContextWin :: CommonInit(void)
mBlackPen = ::CreatePen(PS_SOLID, 0, RGB(0, 0, 0));
mOrigSolidPen = ::SelectObject(mDC, mBlackPen);
mNullPen = ::CreatePen(PS_NULL, 0, 0);
return NS_OK;
}
@ -646,6 +644,10 @@ void nsRenderingContextWin::FillPolygon(nsPoint aPoints[], PRInt32 aNumPoints)
int pfm = ::GetPolyFillMode(mDC);
::SetPolyFillMode(mDC, WINDING);
SetupSolidBrush();
if (NULL == mNullPen)
mNullPen = ::CreatePen(PS_NULL, 0, 0);
HPEN oldPen = ::SelectObject(mDC, mNullPen);
::Polygon(mDC, pp0, int(aNumPoints));
::SelectObject(mDC, oldPen);