From a3a4da0885fcb6d7fd6a92829cc13c356e63f423 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Fri, 17 Jul 1998 17:32:53 +0000 Subject: [PATCH] Changed array of points to be a const for DrawPolygon() and FillPolygon() --- gfx/src/mac/nsRenderingContextMac.cpp | 4 ++-- gfx/src/mac/nsRenderingContextMac.h | 4 ++-- gfx/src/motif/nsRenderingContextUnix.cpp | 4 ++-- gfx/src/motif/nsRenderingContextUnix.h | 4 ++-- gfx/src/nsIRenderingContext.h | 4 ++-- gfx/src/windows/nsRenderingContextWin.cpp | 4 ++-- gfx/src/windows/nsRenderingContextWin.h | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gfx/src/mac/nsRenderingContextMac.cpp b/gfx/src/mac/nsRenderingContextMac.cpp index bdd34565483e..9e6625997f6b 100644 --- a/gfx/src/mac/nsRenderingContextMac.cpp +++ b/gfx/src/mac/nsRenderingContextMac.cpp @@ -638,7 +638,7 @@ void nsRenderingContextMac :: FillRect(nscoord aX, nscoord aY, nscoord aWidth, n } -void nsRenderingContextMac::DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints) +void nsRenderingContextMac::DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) { PRUint32 i ; XPoint * xpoints; @@ -661,7 +661,7 @@ void nsRenderingContextMac::DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints) PR_Free((void *)xpoints); } -void nsRenderingContextMac::FillPolygon(nsPoint aPoints[], PRInt32 aNumPoints) +void nsRenderingContextMac::FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) { PRUint32 i ; XPoint * xpoints; diff --git a/gfx/src/mac/nsRenderingContextMac.h b/gfx/src/mac/nsRenderingContextMac.h index 84be396df812..db3dacc26a09 100644 --- a/gfx/src/mac/nsRenderingContextMac.h +++ b/gfx/src/mac/nsRenderingContextMac.h @@ -97,8 +97,8 @@ public: virtual void FillRect(const nsRect& aRect); virtual void FillRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); - virtual void DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints); - virtual void FillPolygon(nsPoint aPoints[], PRInt32 aNumPoints); + virtual void DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); + virtual void FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); virtual void DrawEllipse(const nsRect& aRect); virtual void DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); diff --git a/gfx/src/motif/nsRenderingContextUnix.cpp b/gfx/src/motif/nsRenderingContextUnix.cpp index cbe8d11db1da..752deaaf0f21 100644 --- a/gfx/src/motif/nsRenderingContextUnix.cpp +++ b/gfx/src/motif/nsRenderingContextUnix.cpp @@ -784,7 +784,7 @@ void nsRenderingContextUnix :: FillRect(nscoord aX, nscoord aY, nscoord aWidth, } -void nsRenderingContextUnix::DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints) +void nsRenderingContextUnix::DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) { PRUint32 i ; XPoint * xpoints; @@ -807,7 +807,7 @@ void nsRenderingContextUnix::DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints) PR_Free((void *)xpoints); } -void nsRenderingContextUnix::FillPolygon(nsPoint aPoints[], PRInt32 aNumPoints) +void nsRenderingContextUnix::FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) { PRUint32 i ; XPoint * xpoints; diff --git a/gfx/src/motif/nsRenderingContextUnix.h b/gfx/src/motif/nsRenderingContextUnix.h index 4c7df087518d..14c433deb5f4 100644 --- a/gfx/src/motif/nsRenderingContextUnix.h +++ b/gfx/src/motif/nsRenderingContextUnix.h @@ -106,8 +106,8 @@ public: virtual void FillRect(const nsRect& aRect); virtual void FillRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); - virtual void DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints); - virtual void FillPolygon(nsPoint aPoints[], PRInt32 aNumPoints); + virtual void DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); + virtual void FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); virtual void DrawEllipse(const nsRect& aRect); virtual void DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); diff --git a/gfx/src/nsIRenderingContext.h b/gfx/src/nsIRenderingContext.h index f2f684876825..cee2e2220a59 100644 --- a/gfx/src/nsIRenderingContext.h +++ b/gfx/src/nsIRenderingContext.h @@ -267,14 +267,14 @@ public: * @param aPoints points to use for the drawing, last must equal first * @param aNumPonts number of points in the polygon */ - virtual void DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints) = 0; + virtual void DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) = 0; /** * Fill a poly in the current foreground color * @param aPoints points to use for the drawing, last must equal first * @param aNumPonts number of points in the polygon */ - virtual void FillPolygon(nsPoint aPoints[], PRInt32 aNumPoints) = 0; + virtual void FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) = 0; /** * Draw an ellipse in the current foreground color diff --git a/gfx/src/windows/nsRenderingContextWin.cpp b/gfx/src/windows/nsRenderingContextWin.cpp index db1aaae645ab..04f4baae2d84 100644 --- a/gfx/src/windows/nsRenderingContextWin.cpp +++ b/gfx/src/windows/nsRenderingContextWin.cpp @@ -719,7 +719,7 @@ void nsRenderingContextWin :: FillRect(nscoord aX, nscoord aY, nscoord aWidth, n ::FillRect(mDC, &nr, SetupSolidBrush()); } -void nsRenderingContextWin::DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints) +void nsRenderingContextWin::DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) { // First transform nsPoint's into POINT's; perform coordinate space // transformation at the same time @@ -756,7 +756,7 @@ void nsRenderingContextWin::DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints) delete pp0; } -void nsRenderingContextWin::FillPolygon(nsPoint aPoints[], PRInt32 aNumPoints) +void nsRenderingContextWin::FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) { // First transform nsPoint's into POINT's; perform coordinate space // transformation at the same time diff --git a/gfx/src/windows/nsRenderingContextWin.h b/gfx/src/windows/nsRenderingContextWin.h index bd10dd4ee994..9cfef6191fbf 100644 --- a/gfx/src/windows/nsRenderingContextWin.h +++ b/gfx/src/windows/nsRenderingContextWin.h @@ -93,8 +93,8 @@ public: virtual void FillRect(const nsRect& aRect); virtual void FillRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); - virtual void DrawPolygon(nsPoint aPoints[], PRInt32 aNumPoints); - virtual void FillPolygon(nsPoint aPoints[], PRInt32 aNumPoints); + virtual void DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); + virtual void FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); virtual void DrawEllipse(const nsRect& aRect); virtual void DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);