зеркало из https://github.com/mozilla/gecko-dev.git
Bug 244895 - remove dead gfx methods. r+sr=roc
This commit is contained in:
Родитель
8546494c14
Коммит
f31bb184d7
|
@ -95,7 +95,7 @@ typedef enum
|
||||||
|
|
||||||
// IID for the nsIRenderingContext interface
|
// IID for the nsIRenderingContext interface
|
||||||
#define NS_IRENDERING_CONTEXT_IID \
|
#define NS_IRENDERING_CONTEXT_IID \
|
||||||
{ 0x79be0166, 0x4491, 0x48e8,{0xb9, 0xe2, 0xce, 0xfb, 0xa1, 0xb1, 0x71, 0x99}}
|
{ 0x0974d74c, 0x9000, 0x47ca,{0x86, 0xdb, 0x35, 0xb9, 0x05, 0xde, 0xa3, 0x5d}}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -349,16 +349,6 @@ public:
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) = 0;
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) = 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Draw a line without being transformed
|
|
||||||
* @param aXO starting horiztonal coord in twips
|
|
||||||
* @param aY0 starting vertical coord in twips
|
|
||||||
* @param aX1 end horiztonal coord in twips
|
|
||||||
* @param aY1 end vertical coord in twips
|
|
||||||
*/
|
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw a polyline
|
* Draw a polyline
|
||||||
* @param aPoints array of endpoints
|
* @param aPoints array of endpoints
|
||||||
|
@ -436,13 +426,6 @@ public:
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) = 0;
|
NS_IMETHOD FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Fill a poly in the current foreground color, without transformation taking place
|
|
||||||
* @param aPoints points to use for the drawing, last must equal first
|
|
||||||
* @param aNumPonts number of points in the polygon
|
|
||||||
*/
|
|
||||||
NS_IMETHOD FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draw an ellipse in the current foreground color
|
* Draw an ellipse in the current foreground color
|
||||||
* @param aRect The rectangle define bounds of ellipse to draw
|
* @param aRect The rectangle define bounds of ellipse to draw
|
||||||
|
|
|
@ -512,27 +512,6 @@ NS_IMETHODIMP nsRenderingContextBeOS::DrawLine(nscoord aX0, nscoord aY0, nscoord
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextBeOS::DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) {
|
|
||||||
if (mTranMatrix == nsnull) return NS_ERROR_FAILURE;
|
|
||||||
if (mSurface == nsnull) return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
nscoord diffX = aX1 - aX0;
|
|
||||||
nscoord diffY = aY1 - aY0;
|
|
||||||
|
|
||||||
if (0 != diffX) {
|
|
||||||
diffX = (diffX > 0) ? 1 : -1;
|
|
||||||
}
|
|
||||||
if (0 != diffY) {
|
|
||||||
diffY = (diffY > 0) ? 1 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LockAndUpdateView()) {
|
|
||||||
mView->StrokeLine(BPoint(aX0, aY0), BPoint(aX1 - diffX, aY1 - diffY));
|
|
||||||
mView->UnlockLooper();
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextBeOS::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) {
|
NS_IMETHODIMP nsRenderingContextBeOS::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) {
|
||||||
if (mTranMatrix == nsnull) return NS_ERROR_FAILURE;
|
if (mTranMatrix == nsnull) return NS_ERROR_FAILURE;
|
||||||
if (mSurface == nsnull) return NS_ERROR_FAILURE;
|
if (mSurface == nsnull) return NS_ERROR_FAILURE;
|
||||||
|
|
|
@ -108,7 +108,6 @@ public:
|
||||||
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
||||||
|
|
||||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
|
||||||
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
|
|
||||||
NS_IMETHOD DrawRect(const nsRect &aRect);
|
NS_IMETHOD DrawRect(const nsRect &aRect);
|
||||||
|
|
|
@ -863,31 +863,6 @@ NS_IMETHODIMP nsRenderingContextGTK::DrawLine(nscoord aX0, nscoord aY0, nscoord
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextGTK::DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1)
|
|
||||||
{
|
|
||||||
nscoord diffX,diffY;
|
|
||||||
|
|
||||||
g_return_val_if_fail(mTranMatrix != NULL, NS_ERROR_FAILURE);
|
|
||||||
g_return_val_if_fail(mSurface != NULL, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
diffX = aX1 - aX0;
|
|
||||||
diffY = aY1 - aY0;
|
|
||||||
|
|
||||||
if (0!=diffX) {
|
|
||||||
diffX = (diffX>0?1:-1);
|
|
||||||
}
|
|
||||||
if (0!=diffY) {
|
|
||||||
diffY = (diffY>0?1:-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateGC();
|
|
||||||
|
|
||||||
::gdk_draw_line(mSurface->GetDrawable(),mGC,aX0, aY0, aX1-diffX, aY1-diffY);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextGTK::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
NS_IMETHODIMP nsRenderingContextGTK::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
||||||
{
|
{
|
||||||
PRInt32 i;
|
PRInt32 i;
|
||||||
|
|
|
@ -116,7 +116,6 @@ public:
|
||||||
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
||||||
|
|
||||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
|
||||||
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
|
|
||||||
NS_IMETHOD DrawRect(const nsRect& aRect);
|
NS_IMETHOD DrawRect(const nsRect& aRect);
|
||||||
|
|
|
@ -870,29 +870,6 @@ NS_IMETHODIMP nsRenderingContextMac::DrawLine(nscoord aX0, nscoord aY0, nscoord
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextMac::DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1)
|
|
||||||
{
|
|
||||||
SetupPortState();
|
|
||||||
|
|
||||||
// make the line one pixel shorter to match other platforms
|
|
||||||
nscoord diffX = aX1 - aX0;
|
|
||||||
if (diffX)
|
|
||||||
diffX -= (diffX > 0 ? 1 : -1);
|
|
||||||
|
|
||||||
nscoord diffY = aY1 - aY0;
|
|
||||||
if (diffY)
|
|
||||||
diffY -= (diffY > 0 ? 1 : -1);
|
|
||||||
|
|
||||||
// draw line
|
|
||||||
::MoveTo(aX0, aY0);
|
|
||||||
::Line(diffX, diffY);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextMac::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
NS_IMETHODIMP nsRenderingContextMac::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
||||||
|
|
|
@ -102,7 +102,6 @@ public:
|
||||||
NS_IMETHOD CreateDrawingSurface(const nsRect& aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface);
|
NS_IMETHOD CreateDrawingSurface(const nsRect& aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface);
|
||||||
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
||||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
|
||||||
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
NS_IMETHOD DrawRect(const nsRect& aRect);
|
NS_IMETHOD DrawRect(const nsRect& aRect);
|
||||||
NS_IMETHOD DrawRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
NS_IMETHOD DrawRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||||
|
|
|
@ -90,18 +90,6 @@ public:
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD SetPenMode(nsPenMode aPenMode) { return NS_ERROR_FAILURE;};
|
NS_IMETHOD SetPenMode(nsPenMode aPenMode) { return NS_ERROR_FAILURE;};
|
||||||
|
|
||||||
/** ---------------------------------------------------
|
|
||||||
* See documentation in nsIRenderingContext.h
|
|
||||||
* @update 05/01/00 dwc
|
|
||||||
*/
|
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) { return NS_OK;}
|
|
||||||
|
|
||||||
/** ---------------------------------------------------
|
|
||||||
* See documentation in nsIRenderingContext.h
|
|
||||||
* @update 05/01/00 dwc
|
|
||||||
*/
|
|
||||||
NS_IMETHOD FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) { return NS_OK; }
|
|
||||||
|
|
||||||
NS_IMETHOD GetBackbuffer(const nsRect &aRequestedSize, const nsRect &aMaxSize, nsDrawingSurface &aBackbuffer);
|
NS_IMETHOD GetBackbuffer(const nsRect &aRequestedSize, const nsRect &aMaxSize, nsDrawingSurface &aBackbuffer);
|
||||||
NS_IMETHOD ReleaseBackbuffer(void);
|
NS_IMETHOD ReleaseBackbuffer(void);
|
||||||
NS_IMETHOD DestroyCachedBackbuffer(void);
|
NS_IMETHOD DestroyCachedBackbuffer(void);
|
||||||
|
|
|
@ -917,30 +917,6 @@ NS_IMETHODIMP nsRenderingContextOS2::DrawLine( nscoord aX0, nscoord aY0, nscoord
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextOS2::DrawStdLine( nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1)
|
|
||||||
{
|
|
||||||
POINTL ptls[] = { { (long) aX0, (long) aY0 },
|
|
||||||
{ (long) aX1, (long) aY1 } };
|
|
||||||
mSurface->NS2PM (ptls, 2);
|
|
||||||
|
|
||||||
if (ptls[0].x > ptls[1].x)
|
|
||||||
ptls[0].x--;
|
|
||||||
else if (ptls[1].x > ptls[0].x)
|
|
||||||
ptls[1].x--;
|
|
||||||
|
|
||||||
if (ptls[0].y < ptls[1].y)
|
|
||||||
ptls[0].y++;
|
|
||||||
else if (ptls[1].y < ptls[0].y)
|
|
||||||
ptls[1].y++;
|
|
||||||
|
|
||||||
SetupLineColorAndStyle ();
|
|
||||||
|
|
||||||
GFX (::GpiMove (mPS, ptls), FALSE);
|
|
||||||
GFX (::GpiLine (mPS, ptls + 1), GPI_ERROR);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextOS2::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
NS_IMETHODIMP nsRenderingContextOS2::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
||||||
{
|
{
|
||||||
PMDrawPoly( aPoints, aNumPoints, PR_FALSE);
|
PMDrawPoly( aPoints, aNumPoints, PR_FALSE);
|
||||||
|
@ -959,12 +935,6 @@ NS_IMETHODIMP nsRenderingContextOS2::FillPolygon( const nsPoint aPoints[], PRInt
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextOS2::FillStdPolygon( const nsPoint aPoints[], PRInt32 aNumPoints)
|
|
||||||
{
|
|
||||||
PMDrawPoly( aPoints, aNumPoints, PR_TRUE, PR_FALSE );
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
// bDoTransform defaults to PR_TRUE
|
// bDoTransform defaults to PR_TRUE
|
||||||
void nsRenderingContextOS2::PMDrawPoly( const nsPoint aPoints[], PRInt32 aNumPoints, PRBool bFilled, PRBool bDoTransform)
|
void nsRenderingContextOS2::PMDrawPoly( const nsPoint aPoints[], PRInt32 aNumPoints, PRBool bFilled, PRBool bDoTransform)
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,7 +125,6 @@ public:
|
||||||
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
||||||
|
|
||||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
|
||||||
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
|
|
||||||
NS_IMETHOD DrawRect(const nsRect& aRect);
|
NS_IMETHOD DrawRect(const nsRect& aRect);
|
||||||
|
@ -140,8 +139,6 @@ public:
|
||||||
NS_IMETHOD DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
NS_IMETHOD FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
|
|
||||||
NS_IMETHOD FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
|
||||||
|
|
||||||
NS_IMETHOD DrawEllipse(const nsRect& aRect);
|
NS_IMETHOD DrawEllipse(const nsRect& aRect);
|
||||||
NS_IMETHOD DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
NS_IMETHOD DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||||
NS_IMETHOD FillEllipse(const nsRect& aRect);
|
NS_IMETHOD FillEllipse(const nsRect& aRect);
|
||||||
|
|
|
@ -471,24 +471,6 @@ NS_IMETHODIMP nsRenderingContextPh :: DrawLine( nscoord aX0, nscoord aY0, nscoor
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextPh :: DrawStdLine( nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1 )
|
|
||||||
{
|
|
||||||
nscoord diffX, diffY;
|
|
||||||
|
|
||||||
diffX = aX1 - aX0;
|
|
||||||
diffY = aY1 - aY0;
|
|
||||||
|
|
||||||
if( diffX != 0 ) diffX = ( diffX > 0 ? 1 : -1 );
|
|
||||||
if( diffY != 0 ) diffY = ( diffY > 0 ? 1 : -1 );
|
|
||||||
|
|
||||||
UpdateGC();
|
|
||||||
PgSetStrokeColorCx( mGC, mCurrentColor );
|
|
||||||
PgSetStrokeDashCx( mGC, sLineStyle[mCurrentLineStyle], sLineStyleLen[mCurrentLineStyle], 0x10000 );
|
|
||||||
|
|
||||||
PgDrawILineCx( mSurfaceDC, aX0, aY0, aX1-diffX, aY1-diffY );
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextPh :: DrawRect( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight )
|
NS_IMETHODIMP nsRenderingContextPh :: DrawRect( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight )
|
||||||
{
|
{
|
||||||
nscoord x,y,w,h;
|
nscoord x,y,w,h;
|
||||||
|
|
|
@ -213,7 +213,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
|
||||||
|
|
||||||
inline
|
inline
|
||||||
NS_IMETHODIMP DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) { return DrawPolygon( aPoints, aNumPoints ); }
|
NS_IMETHODIMP DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) { return DrawPolygon( aPoints, aNumPoints ); }
|
||||||
|
|
|
@ -1074,39 +1074,6 @@ NS_IMETHODIMP nsRenderingContextWin :: DrawLine(nscoord aX0, nscoord aY0, nscoor
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ---------------------------------------------------
|
|
||||||
* See documentation in nsIRenderingContextImpl.h
|
|
||||||
* @update 5/01/00 dwc
|
|
||||||
*/
|
|
||||||
NS_IMETHODIMP nsRenderingContextWin :: DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (nsLineStyle_kNone == mCurrLineStyle)
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
SetupPen();
|
|
||||||
|
|
||||||
if (nsLineStyle_kDotted == mCurrLineStyle)
|
|
||||||
{
|
|
||||||
lineddastruct dda_struct;
|
|
||||||
|
|
||||||
dda_struct.nDottedPixel = 1;
|
|
||||||
dda_struct.dc = mDC;
|
|
||||||
dda_struct.crColor = mColor;
|
|
||||||
|
|
||||||
LineDDA((int)(aX0),(int)(aY0),(int)(aX1),(int)(aY1),(LINEDDAPROC) LineDDAFunc,(long)&dda_struct);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
::MoveToEx(mDC, (int)(aX0), (int)(aY0), NULL);
|
|
||||||
::LineTo(mDC, (int)(aX1), (int)(aY1));
|
|
||||||
}
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextWin :: DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
NS_IMETHODIMP nsRenderingContextWin :: DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
||||||
{
|
{
|
||||||
|
@ -1304,40 +1271,6 @@ NS_IMETHODIMP nsRenderingContextWin :: FillPolygon(const nsPoint aPoints[], PRIn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextWin :: FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints)
|
|
||||||
{
|
|
||||||
// First transform nsPoint's into POINT's;
|
|
||||||
POINT pts[20];
|
|
||||||
POINT* pp0 = pts;
|
|
||||||
|
|
||||||
if (aNumPoints > 20)
|
|
||||||
pp0 = new POINT[aNumPoints];
|
|
||||||
|
|
||||||
POINT* pp = pp0;
|
|
||||||
const nsPoint* np = &aPoints[0];
|
|
||||||
|
|
||||||
for (PRInt32 i = 0; i < aNumPoints; i++, pp++, np++){
|
|
||||||
pp->x = np->x;
|
|
||||||
pp->y = np->y;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill the polygon
|
|
||||||
SetupSolidBrush();
|
|
||||||
|
|
||||||
if (NULL == mNullPen)
|
|
||||||
mNullPen = ::CreatePen(PS_NULL, 0, 0);
|
|
||||||
|
|
||||||
HPEN oldPen = (HPEN)::SelectObject(mDC, mNullPen);
|
|
||||||
::Polygon(mDC, pp0, int(aNumPoints));
|
|
||||||
::SelectObject(mDC, oldPen);
|
|
||||||
|
|
||||||
// Release temporary storage if necessary
|
|
||||||
if (pp0 != pts)
|
|
||||||
delete [] pp0;
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsRenderingContextWin :: DrawEllipse(const nsRect& aRect)
|
NS_IMETHODIMP nsRenderingContextWin :: DrawEllipse(const nsRect& aRect)
|
||||||
{
|
{
|
||||||
return DrawEllipse(aRect.x, aRect.y, aRect.width, aRect.height);
|
return DrawEllipse(aRect.x, aRect.y, aRect.width, aRect.height);
|
||||||
|
|
|
@ -116,7 +116,6 @@ public:
|
||||||
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
||||||
|
|
||||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
|
||||||
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
|
|
||||||
NS_IMETHOD DrawRect(const nsRect& aRect);
|
NS_IMETHOD DrawRect(const nsRect& aRect);
|
||||||
|
@ -134,12 +133,6 @@ public:
|
||||||
NS_IMETHOD SetPenMode(nsPenMode aPenMode);
|
NS_IMETHOD SetPenMode(nsPenMode aPenMode);
|
||||||
NS_IMETHOD GetPenMode(nsPenMode &aPenMode);
|
NS_IMETHOD GetPenMode(nsPenMode &aPenMode);
|
||||||
|
|
||||||
/** ---------------------------------------------------
|
|
||||||
* See documentation in nsIRenderingContext.h
|
|
||||||
* @update 05/01/00 dwc
|
|
||||||
*/
|
|
||||||
NS_IMETHOD FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
|
||||||
|
|
||||||
NS_IMETHOD DrawEllipse(const nsRect& aRect);
|
NS_IMETHOD DrawEllipse(const nsRect& aRect);
|
||||||
NS_IMETHOD DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
NS_IMETHOD DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||||
NS_IMETHOD FillEllipse(const nsRect& aRect);
|
NS_IMETHOD FillEllipse(const nsRect& aRect);
|
||||||
|
|
|
@ -828,37 +828,6 @@ nsRenderingContextXlib::DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsRenderingContextXlib::DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1)
|
|
||||||
{
|
|
||||||
PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::DrawStdLine()\n"));
|
|
||||||
|
|
||||||
nscoord diffX, diffY;
|
|
||||||
|
|
||||||
NS_ENSURE_TRUE(mTranMatrix != nsnull, NS_ERROR_FAILURE);
|
|
||||||
NS_ENSURE_TRUE(mSurface != nsnull, NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
mTranMatrix->TransformCoord(&aX0,&aY0);
|
|
||||||
mTranMatrix->TransformCoord(&aX1,&aY1);
|
|
||||||
|
|
||||||
diffX = aX1-aX0;
|
|
||||||
diffY = aY1-aY0;
|
|
||||||
|
|
||||||
if (0!=diffX) {
|
|
||||||
diffX = (diffX>0?1:-1);
|
|
||||||
}
|
|
||||||
if (0!=diffY) {
|
|
||||||
diffY = (diffY>0?1:-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateGC();
|
|
||||||
Drawable drawable; mSurface->GetDrawable(drawable);
|
|
||||||
::XDrawLine(mDisplay, drawable,
|
|
||||||
*mGC, aX0, aY0, aX1 - diffX, aY1 - diffY);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsRenderingContextXlib::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
nsRenderingContextXlib::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,7 +116,6 @@ public:
|
||||||
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
||||||
|
|
||||||
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||||
NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
|
||||||
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
|
|
||||||
NS_IMETHOD DrawRect(const nsRect& aRect);
|
NS_IMETHOD DrawRect(const nsRect& aRect);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче