88685 r+sr=roc+moz for the rendering-context-related changes

r=walk84 sr=roc+moz for the removal of the USE_IMG2 ifdefs

Remove traces of old imagelib as well as ifdefs for USE_IMG2


git-svn-id: svn://10.0.0.236/trunk@135548 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de 2002-12-21 16:40:04 +00:00
parent c5c45348f7
commit c1dc329eac
33 changed files with 1 additions and 1075 deletions

View File

@ -47,7 +47,6 @@
class nsIWidget;
class nsIFontMetrics;
class nsIImage;
class nsTransform2D;
class nsString;
class nsIDeviceContext;
@ -64,10 +63,8 @@ struct nsBoundingMetrics;
#endif
#ifdef USE_IMG2
/* gfx2 */
class imgIContainer;
#endif
//cliprect/region combination methods
@ -696,37 +693,6 @@ public:
NS_IMETHOD DrawString(const nsString& aString, nscoord aX, nscoord aY,
PRInt32 aFontID = -1,
const nscoord* aSpacing = nsnull) = 0;
/**
* Copy an image to the RenderingContext
* @param aX Horzontal left destination coordinate
* @param aY Vertical top of destinatio coordinate
*/
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY) = 0;
/**
* Copy an image to the RenderingContext, scaling can occur if width/hieght does not match source
* @param aX Horzontal left destination coordinate
* @param aY Vertical top of destinatio coordinate
* @param aWidth Width of destination,
* @param aHeight Height of destination
*/
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight) = 0;
/**
* Copy an image to the RenderingContext, scaling can occur if source/dest rects differ
* @param aRect Destination rectangle to copy the image to
*/
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect) = 0;
/**
* Copy an image to the RenderingContext, scaling/clipping can occur if source/dest rects differ
* @param aSRect Source rectangle to copy from
* @param aDRect Destination rectangle to copy the image to
*/
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect)=0;
/**
* Draw a path.. given a point array. The Path currently supported is a Quadratic
* Bezier curve
@ -838,7 +804,6 @@ public:
#endif // IBMBIDI
#ifdef USE_IMG2
/* [noscript] void drawImage (in imgIContainer aImage, [const] in nsRect aSrcRect, [const] in nsPoint aDestPoint); */
NS_IMETHOD DrawImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsPoint * aDestPoint) = 0;
@ -848,7 +813,6 @@ public:
/* [noscript] void drawTile (in imgIContainer aImage, in nscoord aXOffset, in nscoord aYOffset, [const] in nsRect aTargetRect); */
NS_IMETHOD DrawTile(imgIContainer *aImage, nscoord aXOffset, nscoord aYOffset, const nsRect * aTargetRect) = 0;
#endif
};
//modifiers for text rendering

View File

@ -134,45 +134,14 @@ public:
NS_IMETHOD SetRightToLeftText(PRBool aIsRTL);
#endif // IBMBIDI
#ifdef USE_IMG2
NS_IMETHOD DrawImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsPoint * aDestPoint);
NS_IMETHOD DrawScaledImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsRect * aDestRect);
NS_IMETHOD DrawTile(imgIContainer *aImage, nscoord aXOffset, nscoord aYOffset, const nsRect * aTargetRect);
// Redeclare the other |DrawImage| methods from nsIRenderingContext,
// still as pure virtual, to avoid method-hiding warnings.
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY) = 0;
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight) = 0;
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect) = 0;
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect,
const nsRect& aDRect)=0;
#endif
protected:
virtual ~nsRenderingContextImpl();
/** ---------------------------------------------------
* Check to see if the given size of tile can be imaged by the RenderingContext
* @update 03/29/00 dwc
* @param aWidth The width of the tile
* @param aHeight The height of the tile
* @return PR_TRUE the RenderingContext can handle this tile
*/
virtual PRBool CanTile(nscoord aWidth,nscoord aHeight) { return PR_FALSE; }
/** ---------------------------------------------------
* A bit blitter to tile images to the background recursively
* @update 3/29/00 dwc
* @param aDS -- Target drawing surface for the rendering context
* @param aSrcRect -- Rectangle we are build with the image
* @param aHeight -- height of the tile
* @param aWidth -- width of the tile
*/
void TileImage(nsDrawingSurface aDS,nsRect &aSrcRect,PRInt16 aWidth,PRInt16 aHeight);
void cdelete(int i);
void cinsert(int i,int y,const nsPoint aPointArray[],PRInt32 aNumPts);

View File

@ -502,7 +502,6 @@ NS_IMETHODIMP nsImageBeOS::SetDecodedRect(PRInt32 x1, PRInt32 y1, PRInt32 x2, PR
// Since this function does not touch either the source or destination BBitmap,
// there is no need to call CreateImage(). The platform independent bits will get
// copied to the BBitmap if and when it gets blit.
#ifdef USE_IMG2
NS_IMETHODIMP nsImageBeOS::DrawToImage(nsIImage *aDstImage, nscoord aDX, nscoord aDY,
nscoord aDWidth, nscoord aDHeight) {
@ -614,4 +613,3 @@ NS_IMETHODIMP nsImageBeOS::DrawToImage(nsIImage *aDstImage, nscoord aDX, nscoord
dest->mImageCurrent = PR_FALSE;
return NS_OK;
}
#endif

View File

@ -80,10 +80,8 @@ public:
PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight);
#ifdef USE_IMG2
NS_IMETHOD DrawToImage(nsIImage *aDstImage, nscoord aDX, nscoord aDY,
nscoord aDWidth, nscoord aDHeight);
#endif
NS_IMETHOD DrawTile(nsIRenderingContext &aContext, nsDrawingSurface aSurface,
nsRect &aSrcRect, nsRect &aTileRect);

View File

@ -969,80 +969,6 @@ NS_IMETHODIMP nsRenderingContextBeOS::DrawString(const PRUnichar *aString, PRUin
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextBeOS::DrawImage(nsIImage *aImage, nscoord aX, nscoord aY) {
// We have to do this here because we are doing a transform below
nscoord width = NSToCoordRound(mP2T * aImage->GetWidth());
nscoord height = NSToCoordRound(mP2T * aImage->GetHeight());
return DrawImage(aImage, aX, aY, width, height);
}
NS_IMETHODIMP nsRenderingContextBeOS::DrawImage(nsIImage *aImage, const nsRect &aRect) {
return DrawImage(aImage, aRect.x, aRect.y, aRect.width, aRect.height);
}
NS_IMETHODIMP nsRenderingContextBeOS::DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight) {
nscoord x = aX, y = aY, w = aWidth, h = aHeight;
mTranMatrix->TransformCoord(&x, &y, &w, &h);
UpdateView();
NS_IMETHODIMP result = aImage->Draw(*this, mSurface, x, y, w, h);
if (mView) mView->UnlockLooper();
return result;
}
NS_IMETHODIMP nsRenderingContextBeOS::DrawImage(nsIImage *aImage, const nsRect &aSRect,
const nsRect &aDRect) {
nsRect sr = aSRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y, &sr.width, &sr.height);
sr.x = aSRect.x;
sr.y = aSRect.y;
mTranMatrix->TransformNoXLateCoord(&sr.x, &sr.y);
nsRect dr = aDRect;
mTranMatrix->TransformCoord(&dr.x, &dr.y, &dr.width, &dr.height);
UpdateView();
NS_IMETHODIMP result = aImage->Draw(*this, mSurface, sr.x, sr.y, sr.width, sr.height,
dr.x, dr.y, dr.width, dr.height);
if (mView) mView->UnlockLooper();
return result;
}
#ifdef USE_NATIVE_TILING
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 3/16/00 dwc
*/
NS_IMETHODIMP nsRenderingContextBeOS::DrawTile(nsIImage *aImage, nscoord aX0, nscoord aY0,
nscoord aX1, nscoord aY1, nscoord aWidth, nscoord aHeight) {
mTranMatrix->TransformCoord(&aX0, &aY0, &aWidth, &aHeight);
mTranMatrix->TransformCoord(&aX1, &aY1);
nsRect srcRect(0, 0, aWidth, aHeight);
nsRect tileRect(aX0, aY0, aX1 - aX0, aY1 - aY0);
((nsImageBeOS *) aImage)->DrawTile(*this, mSurface, srcRect, tileRect);
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextBeOS::DrawTile(nsIImage *aImage, nscoord aSrcXOffset,
nscoord aSrcYOffset, const nsRect &aTileRect) {
nsImageBeOS *image = (nsImageBeOS *)aImage;
nsRect tileRect(aTileRect);
nsRect srcRect(0, 0, aSrcXOffset, aSrcYOffset);
mTranMatrix->TransformCoord(&srcRect.x, &srcRect.y, &srcRect.width, &srcRect.height);
mTranMatrix->TransformCoord(&tileRect.x, &tileRect.y, &tileRect.width, &tileRect.height);
if ((tileRect.width > 0) && (tileRect.height > 0)) {
image->DrawTile(*this, mSurface, srcRect.width, srcRect.height, tileRect);
}
return NS_OK;
}
#endif
NS_IMETHODIMP nsRenderingContextBeOS::CopyOffScreenBits(nsDrawingSurface aSrcSurf,
PRInt32 aSrcX, PRInt32 aSrcY, const nsRect &aDestBounds, PRUint32 aCopyFlags) {

View File

@ -49,15 +49,12 @@
#include "nsTransform2D.h"
#include "nsIWidget.h"
#include "nsRect.h"
#include "nsIImage.h"
#include "nsIDeviceContext.h"
#include "nsVoidArray.h"
#include "nsGfxCIID.h"
#include "nsDrawingSurfaceBeOS.h"
#include "nsRegionBeOS.h"
#define USE_NATIVE_TILING 1
class nsRenderingContextBeOS : public nsRenderingContextImpl
{
public:
@ -158,19 +155,6 @@ public:
NS_IMETHOD DrawString(const nsString &aString, nscoord aX, nscoord aY, PRInt32 aFontID,
const nscoord *aSpacing);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY, nscoord aWidth,
nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect &aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect &aSRect, const nsRect &aDRect);
#ifdef USE_NATIVE_TILING
NS_IMETHOD DrawTile(nsIImage *aImage, nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1,
nscoord aWidth, nscoord aHeight);
NS_IMETHOD DrawTile(nsIImage *aImage, nscoord aSrcXOffset, nscoord aSrcYOffset,
const nsRect &aTileRect);
#endif
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags);
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 *ngd);

View File

@ -1914,7 +1914,6 @@ nsImageGTK::SetDecodedRect(PRInt32 x1, PRInt32 y1, PRInt32 x2, PRInt32 y2 )
return NS_OK;
}
#ifdef USE_IMG2
NS_IMETHODIMP nsImageGTK::DrawToImage(nsIImage* aDstImage,
nscoord aDX, nscoord aDY,
nscoord aDWidth, nscoord aDHeight)
@ -2022,4 +2021,3 @@ NS_IMETHODIMP nsImageGTK::DrawToImage(nsIImage* aDstImage,
return NS_OK;
}
#endif

View File

@ -91,10 +91,8 @@ public:
PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight);
#ifdef USE_IMG2
NS_IMETHOD DrawToImage(nsIImage* aDstImage, nscoord aDX, nscoord aDY,
nscoord aDWidth, nscoord aDHeight);
#endif
NS_IMETHOD DrawTile(nsIRenderingContext &aContext,
nsDrawingSurface aSurface,

View File

@ -1336,96 +1336,6 @@ nsRenderingContextGTK::DrawString(const nsString& aString,
aX, aY, aFontID, aSpacing);
}
NS_IMETHODIMP nsRenderingContextGTK::DrawImage(nsIImage *aImage,
nscoord aX, nscoord aY)
{
nscoord width, height;
// we have to do this here because we are doing a transform below
width = NSToCoordRound(mP2T * aImage->GetWidth());
height = NSToCoordRound(mP2T * aImage->GetHeight());
return DrawImage(aImage, aX, aY, width, height);
}
NS_IMETHODIMP nsRenderingContextGTK::DrawImage(nsIImage *aImage, const nsRect& aRect)
{
return DrawImage(aImage,
aRect.x,
aRect.y,
aRect.width,
aRect.height);
}
NS_IMETHODIMP nsRenderingContextGTK::DrawImage(nsIImage *aImage,
nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight)
{
nscoord x, y, w, h;
x = aX;
y = aY;
w = aWidth;
h = aHeight;
mTranMatrix->TransformCoord(&x, &y, &w, &h);
#if 0
// gdk_window_clear_area(mSurface->GetDrawable(), x, y, w, h);
PRInt32 xx, yy, ww, hh;
mClipRegion->GetBoundingBox(&xx,&yy,&ww,&hh);
printf("clip bounds: x = %i, y = %i, w = %i, h = %i\n", xx, yy, ww, hh);
nscolor color = mCurrentColor;
SetColor(NS_RGB(255, 0, 0));
FillRect(xx, yy, ww, hh);
SetColor(color);
#endif
UpdateGC();
return aImage->Draw(*this, mSurface,
x, y, w, h);
}
NS_IMETHODIMP nsRenderingContextGTK::DrawImage(nsIImage *aImage,
const nsRect& aSRect,
const nsRect& aDRect)
{
nsRect sr,dr;
sr = aSRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y,
&sr.width, &sr.height);
sr.x -= mTranMatrix->GetXTranslationCoord();
sr.y -= mTranMatrix->GetYTranslationCoord();
dr = aDRect;
mTranMatrix->TransformCoord(&dr.x, &dr.y,
&dr.width, &dr.height);
#if 0
PRInt32 x, y, w, h;
mClipRegion->GetBoundingBox(&x,&y,&w,&h);
printf("clip bounds: x = %i, y = %i, w = %i, h = %i\n", x, y, w, h);
// gdk_window_clear_area(mSurface->GetDrawable(), sr.x, sr.y, sr.width, sr.height);
nscolor color = mCurrentColor;
SetColor(NS_RGB(255, 0, 0));
FillRect(x, y, w, h);
SetColor(color);
#endif
UpdateGC();
return aImage->Draw(*this, mSurface,
sr.x, sr.y,
sr.width, sr.height,
dr.x, dr.y,
dr.width, dr.height);
}
NS_IMETHODIMP
nsRenderingContextGTK::CopyOffScreenBits(nsDrawingSurface aSrcSurf,
PRInt32 aSrcX, PRInt32 aSrcY,

View File

@ -48,7 +48,6 @@
#include "nsTransform2D.h"
#include "nsIWidget.h"
#include "nsRect.h"
#include "nsIImage.h"
#include "nsIDeviceContext.h"
#include "nsVoidArray.h"
#include "nsGfxCIID.h"
@ -191,11 +190,6 @@ public:
nsTextDimensions& aLastWordDimensions,
PRInt32* aFontID);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags);
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd);

View File

@ -389,7 +389,6 @@ NS_IMETHODIMP nsImageMac :: Draw(nsIRenderingContext &aContext,
return Draw(aContext,aSurface,0,0,mWidth,mHeight,aX,aY,aWidth,aHeight);
}
#ifdef USE_IMG2
/** ---------------------------------------------------
* See documentation in nsImageMac.h
* @update
@ -437,8 +436,7 @@ NS_IMETHODIMP nsImageMac :: DrawToImage(nsIImage* aDstImage, PRInt32 aDX, PRInt3
return NS_OK;
}
#endif // USE_IMG2
/** ---------------------------------------------------
* See documentation in nsImageMac.h

View File

@ -98,7 +98,6 @@ public:
nsDrawingSurface aSurface,
PRInt32 aSXOffset, PRInt32 aSYOffset,
const nsRect &aTileRect);
#ifdef USE_IMG2
/**
@ -110,7 +109,6 @@ public:
NS_IMETHOD DrawToImage(nsIImage* aDstImage, nscoord aDX, nscoord aDY,
nscoord aDWidth, nscoord aDHeight);
#endif
virtual void SetAlphaLevel(PRInt32 aAlphaLevel);
virtual PRInt32 GetAlphaLevel();
virtual void* GetBitInfo() { return nsnull; }

View File

@ -41,7 +41,6 @@
#include "nsRenderingContextMac.h"
#include "nsDeviceContextMac.h"
#include "nsFontMetricsMac.h"
#include "nsIImage.h"
#include "nsIRegion.h"
#include "nsIEnumerator.h"
#include "nsRegionMac.h"
@ -1404,75 +1403,6 @@ NS_IMETHODIMP nsRenderingContextMac::DrawString(const nsString& aString,
#pragma mark -
//------------------------------------------------------------------------
NS_IMETHODIMP nsRenderingContextMac::DrawImage(nsIImage *aImage, nscoord aX, nscoord aY)
{
nscoord width,height;
width = NSToCoordRound(mP2T * aImage->GetWidth());
height = NSToCoordRound(mP2T * aImage->GetHeight());
return DrawImage(aImage,aX,aY,width,height);
}
//------------------------------------------------------------------------
NS_IMETHODIMP nsRenderingContextMac::DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight)
{
nsRect tr;
tr.x = aX;
tr.y = aY;
tr.width = aWidth;
tr.height = aHeight;
return DrawImage(aImage,tr);
}
//------------------------------------------------------------------------
NS_IMETHODIMP nsRenderingContextMac::DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect)
{
SetupPortState();
nsRect sr = aSRect;
nsRect dr = aDRect;
mGS->mTMatrix.TransformCoord(&sr.x,&sr.y,&sr.width,&sr.height);
sr.x -= mTranMatrix->GetXTranslationCoord();
sr.y -= mTranMatrix->GetYTranslationCoord();
mGS->mTMatrix.TransformCoord(&dr.x,&dr.y,&dr.width,&dr.height);
return aImage->Draw(*this, mCurrentSurface, sr.x, sr.y, sr.width, sr.height,
dr.x, dr.y, dr.width, dr.height);
}
//------------------------------------------------------------------------
NS_IMETHODIMP nsRenderingContextMac::DrawImage(nsIImage *aImage, const nsRect& aRect)
{
SetupPortState();
nsRect tr = aRect;
mGS->mTMatrix.TransformCoord(&tr.x,&tr.y,&tr.width,&tr.height);
return aImage->Draw(*this, mCurrentSurface, tr.x, tr.y, tr.width, tr.height);
}
#if 0
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 3/16/00 dwc
*/
NS_IMETHODIMP
nsRenderingContextMac::DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
nscoord aWidth,nscoord aHeight)
{
return NS_OK;
}
#endif
NS_IMETHODIMP nsRenderingContextMac::RetrieveCurrentNativeGraphicData(PRUint32 * ngd)
{
return NS_OK;

View File

@ -147,12 +147,6 @@ public:
NS_IMETHOD GetTextDimensions(const PRUnichar *aString, PRUint32 aLength,
nsTextDimensions& aDimensions, PRInt32 *aFontID);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
//NS_IMETHOD DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
//nscoord aWidth,nscoord aHeight);
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags);
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd);

View File

@ -2480,54 +2480,6 @@ nsRenderingContextOS2::GetBoundingMetrics(const PRUnichar* aString,
}
#endif // MOZ_MATHML
// Image drawing: just proxy on to the image object, so no worries yet.
NS_IMETHODIMP nsRenderingContextOS2::DrawImage( nsIImage *aImage, nscoord aX, nscoord aY)
{
nscoord width, height;
width = NSToCoordRound( mP2T * aImage->GetWidth());
height = NSToCoordRound( mP2T * aImage->GetHeight());
return this->DrawImage( aImage, aX, aY, width, height);
}
NS_IMETHODIMP nsRenderingContextOS2::DrawImage( nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight)
{
nsRect tr;
tr.x = aX;
tr.y = aY;
tr.width = aWidth;
tr.height = aHeight;
return this->DrawImage( aImage, tr);
}
NS_IMETHODIMP nsRenderingContextOS2::DrawImage( nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect)
{
nsRect sr,dr;
sr = aSRect;
mTranMatrix->TransformCoord( &sr.x, &sr.y, &sr.width, &sr.height);
sr.x = aSRect.x;
sr.y = aSRect.y;
mTranMatrix->TransformNoXLateCoord(&sr.x, &sr.y);
dr = aDRect;
mTranMatrix->TransformCoord( &dr.x, &dr.y, &dr.width, &dr.height);
return aImage->Draw( *this, mSurface, sr.x, sr.y, sr.width, sr.height, dr.x, dr.y, dr.width, dr.height);
}
NS_IMETHODIMP nsRenderingContextOS2::DrawImage( nsIImage *aImage, const nsRect& aRect)
{
nsRect tr( aRect);
mTranMatrix->TransformCoord( &tr.x, &tr.y, &tr.width, &tr.height);
return aImage->Draw( *this, mSurface, tr.x, tr.y, tr.width, tr.height);
}
NS_IMETHODIMP nsRenderingContextOS2::CopyOffScreenBits(
nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags)

View File

@ -180,12 +180,6 @@ public:
PRInt32 aFontID,
const nscoord* aSpacing);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags);
//~~~
@ -231,14 +225,6 @@ protected:
~nsRenderingContextOS2();
#if 0 // OS2TODO
/** ---------------------------------------------------
* See documentation in nsIRenderingContextImpl.h
* @update 4/01/00 dwc
*/
virtual PRBool CanTile(nscoord aWidth,nscoord aHeight);
#endif
nsIDeviceContext *mContext; // device context
nsDrawingSurfaceOS2 *mSurface; // draw things here
nsDrawingSurfaceOS2 *mMainSurface; // if offscreen selected, this is original one that was set on init time

View File

@ -785,7 +785,6 @@ nsImagePh::SetDecodedRect(PRInt32 x1, PRInt32 y1, PRInt32 x2, PRInt32 y2 )
return NS_OK;
}
#ifdef USE_IMG2
/**
* BitBlit the entire (no cropping) nsIImage to another nsImage, the source and dest can be scaled
* @update - saari 03/08/01
@ -869,7 +868,6 @@ NS_IMETHODIMP nsImagePh::DrawToImage(nsIImage* aDstImage,
}
return NS_OK;
}
#endif

View File

@ -76,10 +76,8 @@ public:
NS_IMETHOD Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface, PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
NS_IMETHOD Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface, PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, \
PRInt32 aSHeight, PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight);
#ifdef USE_IMG2
NS_IMETHOD DrawToImage(nsIImage* aDstImage, nscoord aDX, nscoord aDY,
nscoord aDWidth, nscoord aDHeight);
#endif
NS_IMETHOD DrawTile(nsIRenderingContext &aContext, nsDrawingSurface aSurface,
nsRect &aSrcRect, nsRect &aTileRect);

View File

@ -1066,84 +1066,6 @@ NS_IMETHODIMP nsRenderingContextPh::DrawString(const PRUnichar* aString, PRUint3
return DrawString( p, strlen( p ), aX, aY, aSpacing );
}
NS_IMETHODIMP nsRenderingContextPh::DrawImage( nsIImage *aImage, nscoord aX, nscoord aY )
{
nscoord width, height;
// we have to do this here because we are doing a transform below
width = NSToCoordRound(mP2T * aImage->GetWidth());
height = NSToCoordRound(mP2T * aImage->GetHeight());
return DrawImage( aImage, aX, aY, width, height );
}
NS_IMETHODIMP nsRenderingContextPh::DrawImage( nsIImage *aImage, const nsRect& aRect )
{
return DrawImage( aImage, aRect.x, aRect.y, aRect.width, aRect.height );
}
NS_IMETHODIMP nsRenderingContextPh::DrawImage( nsIImage *aImage, nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight )
{
nscoord x, y, w, h;
x = aX;
y = aY;
w = aWidth;
h = aHeight;
mTranMatrix->TransformCoord(&x, &y, &w, &h);
return (aImage->Draw(*this, mSurface, x, y, w, h));
}
NS_IMETHODIMP nsRenderingContextPh::DrawImage( nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect )
{
nsRect sr,dr;
sr = aSRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y, &sr.width, &sr.height);
sr.x -= mTranMatrix->GetXTranslationCoord();
sr.y -= mTranMatrix->GetYTranslationCoord();
dr = aDRect;
mTranMatrix->TransformCoord(&dr.x, &dr.y, &dr.width, &dr.height);
return aImage->Draw(*this, mSurface,
sr.x, sr.y,
sr.width, sr.height,
dr.x, dr.y,
dr.width, dr.height);
}
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 3/16/00 dwc
*/
NS_IMETHODIMP nsRenderingContextPh::DrawTile( nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1, nscoord aWidth,nscoord aHeight )
{
mTranMatrix->TransformCoord(&aX0,&aY0,&aWidth,&aHeight);
mTranMatrix->TransformCoord(&aX1,&aY1);
nsRect srcRect (0, 0, aWidth, aHeight);
nsRect tileRect(aX0, aY0, aX1-aX0, aY1-aY0);
((nsImagePh*)aImage)->DrawTile(*this, mSurface, srcRect, tileRect);
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextPh::DrawTile( nsIImage *aImage, nscoord aSrcXOffset, nscoord aSrcYOffset, const nsRect &aTileRect )
{
nsRect tileRect( aTileRect );
nsRect srcRect(0, 0, aSrcXOffset, aSrcYOffset);
mTranMatrix->TransformCoord(&srcRect.x, &srcRect.y, &srcRect.width, &srcRect.height);
mTranMatrix->TransformCoord(&tileRect.x, &tileRect.y, &tileRect.width, &tileRect.height);
if( tileRect.width > 0 && tileRect.height > 0 )
((nsImagePh*)aImage)->DrawTile(*this, mSurface, srcRect.width, srcRect.height, tileRect);
else
NS_ASSERTION(aTileRect.width > 0 && aTileRect.height > 0,
"You can't draw an image with a 0 width or height!");
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextPh :: CopyOffScreenBits( nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY, const nsRect &aDestBounds, PRUint32 aCopyFlags )
{
PhArea_t darea, sarea;

View File

@ -167,16 +167,6 @@ public:
NS_IMETHOD GetTextDimensions(const PRUnichar *aString, PRUint32 aLength,
nsTextDimensions& aDimensions, PRInt32 *aFontID);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
NS_IMETHOD DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
nscoord aWidth,nscoord aHeight);
NS_IMETHOD DrawTile(nsIImage *aImage, nscoord aSrcXOffset, nscoord aSrcYOffset,
const nsRect &aTileRect);
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags);
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd);

View File

@ -1192,100 +1192,6 @@ nsRenderingContextPS :: DrawString(const nsString& aString,nscoord aX, nscoord a
return DrawString(aString.get(), aString.Length(), aX, aY, aFontID, aSpacing);
}
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 12/21/98 dwc
*/
NS_IMETHODIMP
nsRenderingContextPS :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY)
{
nscoord width, height;
width = NSToCoordRound(mP2T * aImage->GetWidth());
height = NSToCoordRound(mP2T * aImage->GetHeight());
return DrawImage(aImage, aX, aY, width, height);
}
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 12/21/98 dwc
*/
NS_IMETHODIMP
nsRenderingContextPS :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight)
{
nsRect tr;
tr.x = aX;
tr.y = aY;
tr.width = aWidth;
tr.height = aHeight;
return DrawImage(aImage, tr);
}
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 12/21/98 dwc
*/
NS_IMETHODIMP
nsRenderingContextPS :: DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect)
{
nsRect sr,dr;
sr = aSRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y, &sr.width, &sr.height);
sr.x = aSRect.x;
sr.y = aSRect.y;
mTranMatrix->TransformNoXLateCoord(&sr.x, &sr.y);
dr = aDRect;
mTranMatrix->TransformCoord(&dr.x, &dr.y, &dr.width, &dr.height);
mPSObj->colorimage(aImage,NS_PIXELS_TO_POINTS(sr.x),
NS_PIXELS_TO_POINTS(sr.y),
NS_PIXELS_TO_POINTS(dr.width),
NS_PIXELS_TO_POINTS(dr.height));
//return aImage->Draw(*this, mSurface, 0, 0, sr.width, sr.height, dr.x, dr.y, dr.width, dr.height);
return NS_OK;
}
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 12/21/98 dwc
*/
NS_IMETHODIMP
nsRenderingContextPS :: DrawImage(nsIImage *aImage, const nsRect& aRect)
{
nsRect tr;
tr = aRect;
mTranMatrix->TransformCoord(&tr.x, &tr.y, &tr.width, &tr.height);
//return aImage->Draw(*this, mSurface, tr.x, tr.y, tr.width, tr.height);
mPSObj->colorimage(aImage,
NS_PIXELS_TO_POINTS(tr.x),
NS_PIXELS_TO_POINTS(tr.y),
NS_PIXELS_TO_POINTS(tr.width),
NS_PIXELS_TO_POINTS(tr.height));
return NS_OK;
}
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 3/16/00 dwc
*/
NS_IMETHODIMP
nsRenderingContextPS::DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
nscoord aWidth,nscoord aHeight)
{
return NS_OK;
}
/* [noscript] void drawImage (in imgIContainer aImage, [const] in nsRect aSrcRect, [const] in nsPoint aDestPoint); */
NS_IMETHODIMP nsRenderingContextPS::DrawImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsPoint * aDestPoint)
{

View File

@ -189,14 +189,6 @@ public:
nsTextDimensions& aLastWordDimensions,
PRInt32* aFontID = nsnull);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
NS_IMETHOD DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
nscoord aWidth,nscoord aHeight);
NS_IMETHOD DrawImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsPoint * aDestPoint);
NS_IMETHOD DrawScaledImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsRect * aDestRect);

View File

@ -1403,105 +1403,6 @@ void nsRenderingContextQT::MyDrawString(QPainter *aGC,
aGC->drawText(aX,aY,aText);
}
NS_IMETHODIMP nsRenderingContextQT::DrawImage(nsIImage *aImage,nscoord aX,
nscoord aY)
{
nscoord width = NSToCoordRound(mP2T * aImage->GetWidth());
nscoord height = NSToCoordRound(mP2T * aImage->GetHeight());
return DrawImage(aImage,aX,aY,width,height);
}
NS_IMETHODIMP nsRenderingContextQT::DrawImage(nsIImage *aImage,
nscoord aX,nscoord aY,
nscoord aWidth,nscoord aHeight)
{
nsRect tr;
tr.x = aX;
tr.y = aY;
tr.width = aWidth;
tr.height = aHeight;
return DrawImage(aImage,tr);
}
NS_IMETHODIMP nsRenderingContextQT::DrawImage(nsIImage *aImage,
const nsRect &aRect)
{
nsRect tr;
tr = aRect;
mTranMatrix->TransformCoord(&tr.x,&tr.y,&tr.width,&tr.height);
UpdateGC();
return aImage->Draw(*this,mSurface,tr.x,tr.y,tr.width,tr.height);
}
NS_IMETHODIMP nsRenderingContextQT::DrawImage(nsIImage *aImage,
const nsRect &aSRect,
const nsRect &aDRect)
{
nsRect sr,dr;
sr = aSRect;
mTranMatrix ->TransformCoord(&sr.x,&sr.y,&sr.width,&sr.height);
sr.x = aSRect.x;
sr.y = aSRect.y;
mTranMatrix->TransformNoXLateCoord(&sr.x, &sr.y);
dr = aDRect;
mTranMatrix->TransformCoord(&dr.x,&dr.y,&dr.width,&dr.height);
UpdateGC();
return aImage->Draw(*this,mSurface,sr.x,sr.y,sr.width,sr.height,
dr.x,dr.y,dr.width,dr.height);
}
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 3/16/00 dwc
*/
NS_IMETHODIMP
nsRenderingContextQT::DrawTile(nsIImage *aImage,
nscoord aX0,nscoord aY0,
nscoord aX1,nscoord aY1,
nscoord aWidth,nscoord aHeight)
{
nsImageQT* image = (nsImageQT*)aImage;
mTranMatrix->TransformCoord(&aX0,&aY0,&aWidth,&aHeight);
mTranMatrix->TransformCoord(&aX1,&aY1);
nsRect srcRect(0,0,aWidth,aHeight);
nsRect tileRect(aX0,aY0,aX1 - aX0,aY1 - aY0);
if (tileRect.width > 0 && tileRect.height > 0)
image->DrawTile(*this,mSurface,srcRect,tileRect);
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextQT::DrawTile(nsIImage *aImage,
nscoord aSrcXOffset,
nscoord aSrcYOffset,
const nsRect &aTileRect)
{
nsImageQT* image = (nsImageQT*)aImage;
nsRect tileRect(aTileRect);
nsRect srcRect(0,0,aSrcXOffset,aSrcYOffset);
mTranMatrix->TransformCoord(&srcRect.x,&srcRect.y,
&srcRect.width,&srcRect.height);
mTranMatrix->TransformCoord(&tileRect.x,&tileRect.y,
&tileRect.width,&tileRect.height);
if (tileRect.width > 0 && tileRect.height > 0)
image->DrawTile(*this,mSurface,srcRect.width,srcRect.height,
tileRect);
return NS_OK;
}
NS_IMETHODIMP
nsRenderingContextQT::CopyOffScreenBits(nsDrawingSurface aSrcSurf,
PRInt32 aSrcX,

View File

@ -50,7 +50,6 @@
#include "nsTransform2D.h"
#include "nsIWidget.h"
#include "nsRect.h"
#include "nsIImage.h"
#include "nsIDeviceContext.h"
#include "nsVoidArray.h"
#include "nsCOMPtr.h"
@ -206,17 +205,6 @@ public:
NS_IMETHOD DrawString(const nsString& aString,nscoord aX,nscoord aY,
PRInt32 aFontID,const nscoord* aSpacing);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage,nscoord aX,nscoord aY,
nscoord aWidth,nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect,
const nsRect& aDRect);
NS_IMETHOD DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,
nscoord aX1,nscoord aY1,
nscoord aWidth,nscoord aHeight);
NS_IMETHOD DrawTile(nsIImage *aImage, nscoord aSrcXOffset,
nscoord aSrcYOffset, const nsRect &aTileRect);
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf,
PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds,

View File

@ -78,117 +78,6 @@ nsRenderingContextImpl :: ~nsRenderingContextImpl()
}
#if 0
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 3/29/00 dwc
*/
NS_IMETHODIMP
nsRenderingContextImpl::DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
nscoord aWidth,nscoord aHeight)
{
PRBool hasMask,clip;
nscoord x,y;
nsRect srcRect,destRect,vrect,tvrect;
PRInt32 flag = NS_COPYBITS_TO_BACK_BUFFER | NS_COPYBITS_XFORM_DEST_VALUES;
PRUint32 dsFlag = 0;
nsIDrawingSurface *theSurface,*ts=nsnull;
float t2p,app2dev;
nsIDeviceContext *theDevCon;
nsTransform2D *theTransform;
// we have to do things ourselves
hasMask = aImage->GetHasAlphaMask();
tvrect.SetRect(0,0,aX1-aX0,aY1-aY0);
if(!hasMask && ((aWidth<(tvrect.width/16)) || (aHeight<(tvrect.height/16)))) {
// create a larger tile to use
GetDeviceContext(theDevCon);
theDevCon->GetTwipsToDevUnits(t2p);
this->GetDrawingSurface((void**)&theSurface);
tvrect.width = ((tvrect.width)/aWidth);
tvrect.width *=aWidth;
tvrect.height = ((tvrect.height)/aHeight);
tvrect.height *=aHeight;
// create a new drawing surface... using pixels as the size
vrect.height = (nscoord)(tvrect.height * t2p);
vrect.width = (nscoord)(tvrect.width * t2p);
this->CreateDrawingSurface(vrect,dsFlag,(nsDrawingSurface&)ts);
if (nsnull != ts) {
this->SelectOffScreenDrawingSurface(ts);
// create a bigger tile in our new drawingsurface
// XXX pushing state to fix clipping problem, need to look into why the clip is set here
this->PushState();
this->GetCurrentTransform(theTransform);
theDevCon->GetAppUnitsToDevUnits(app2dev);
theTransform->SetToIdentity();
theTransform->AddScale(app2dev, app2dev);
#if defined(XP_UNIX) && !defined(XP_MACOSX)
srcRect.SetRect(0,0,tvrect.width,tvrect.height);
SetClipRect(srcRect, nsClipCombine_kReplace, clip);
#endif
// copy the initial image to our buffer, this takes twips and converts to pixels..
// which is what the image is in
NS_STATIC_CAST(nsIRenderingContext*, this)->DrawImage(aImage,0,0,aWidth,aHeight);
// duplicate the image in the upperleft corner to fill up the nsDrawingSurface
srcRect.SetRect(0,0,aWidth,aHeight);
TileImage(ts,srcRect,tvrect.width,tvrect.height);
// setting back the clip from the background clip push
this->PopState(clip);
// set back to the old drawingsurface
this->SelectOffScreenDrawingSurface((void**)theSurface);
// now duplicate our tile into the background
destRect = srcRect;
for(y=aY0;y<aY1;y+=tvrect.height){
for(x=aX0;x<aX1;x+=tvrect.width){
destRect.x = x;
destRect.y = y;
this->CopyOffScreenBits(ts,0,0,destRect,flag);
}
}
this->DestroyDrawingSurface(ts);
}
NS_RELEASE(theDevCon);
} else {
// slow blitting, one tile at a time.... ( will create a mask and fall into code below -next task-)
for(y=aY0;y<aY1;y+=aHeight){
for(x=aX0;x<aX1;x+=aWidth){
NS_STATIC_CAST(nsIRenderingContext*, this)->DrawImage(aImage,x,y,aWidth,aHeight);
}
}
}
return NS_OK;
}
NS_IMETHODIMP
nsRenderingContextImpl::DrawTile(nsIImage *aImage, nscoord aSrcXOffset,
nscoord aSrcYOffset,
const nsRect &aDirtyRect)
{
return NS_OK;
}
#endif
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 3/29/00 dwc
@ -429,35 +318,6 @@ const nsPoint *p, *q;
mAct++;
}
/** ---------------------------------------------------
* See documentation in nsRenderingContextImpl.h
* @update 3/29/00 dwc
*/
void
nsRenderingContextImpl::TileImage(nsDrawingSurface aDS,nsRect &aSrcRect,PRInt16 aWidth,PRInt16 aHeight)
{
nsRect destRect;
PRInt32 flag = NS_COPYBITS_TO_BACK_BUFFER | NS_COPYBITS_XFORM_DEST_VALUES;
if( aSrcRect.width < aWidth) {
// width is less than double so double our source bitmap width
destRect = aSrcRect;
destRect.x += aSrcRect.width;
this->CopyOffScreenBits(aDS,aSrcRect.x,aSrcRect.y,destRect,flag);
aSrcRect.width*=2;
TileImage(aDS,aSrcRect,aWidth,aHeight);
} else if (aSrcRect.height < aHeight) {
// height is less than double so double our source bitmap height
destRect = aSrcRect;
destRect.y += aSrcRect.height;
this->CopyOffScreenBits(aDS,aSrcRect.x,aSrcRect.y,destRect,flag);
aSrcRect.height*=2;
TileImage(aDS,aSrcRect,aWidth,aHeight);
}
}
NS_IMETHODIMP nsRenderingContextImpl::GetBackbuffer(const nsRect &aRequestedSize, const nsRect &aMaxSize, nsDrawingSurface &aBackbuffer)
{
// Default implementation assumes the backbuffer will be cached.
@ -882,8 +742,6 @@ float avx,avy,av1x,av1y;
}
#ifdef USE_IMG2
#include "imgIContainer.h"
#include "gfxIImageFrame.h"
#include "nsIInterfaceRequestor.h"
@ -1049,8 +907,6 @@ NS_IMETHODIMP nsRenderingContextImpl::DrawTile(imgIContainer *aImage, nscoord aX
return img->DrawTile(*this, surface, so.width, so.height, dr);
}
#endif
NS_IMETHODIMP
nsRenderingContextImpl::FlushRect(const nsRect& aRect)
{

View File

@ -1509,7 +1509,6 @@ nsImageWin::GetBits()
} // GetBits
#ifdef USE_IMG2
/** ---------------------------------------------------
* This blends together GIF's for the animation... called by gfxImageFrame
* currently does not support and 8bit blend. Assumed for animated GIF's only
@ -1718,7 +1717,6 @@ NS_IMETHODIMP nsImageWin::DrawToImage(nsIImage* aDstImage, nscoord aDX, nscoord
}
#endif

View File

@ -105,10 +105,8 @@ public:
NS_IMETHOD Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface, PRInt32 aSX, PRInt32 aSY,
PRInt32 aSWidth, PRInt32 aSHeight,
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight);
#ifdef USE_IMG2
NS_IMETHOD DrawToImage(nsIImage* aDstImage, nscoord aDX, nscoord aDY,
nscoord aDWidth, nscoord aDHeight);
#endif
virtual nsColorMap* GetColorMap() {return mColorMap;}
virtual void ImageUpdated(nsIDeviceContext *aContext, PRUint8 aFlags, nsRect *aUpdateRect);
virtual nsresult Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth, nsMaskRequirements aMaskRequirements);

View File

@ -2516,90 +2516,6 @@ nsRenderingContextWin::GetBoundingMetrics(const PRUnichar* aString,
}
#endif // MOZ_MATHML
NS_IMETHODIMP nsRenderingContextWin :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY)
{
NS_PRECONDITION(PR_TRUE == mInitialized, "!initialized");
nscoord width, height;
width = NSToCoordRound(mP2T * aImage->GetWidth());
height = NSToCoordRound(mP2T * aImage->GetHeight());
return DrawImage(aImage, aX, aY, width, height);
}
NS_IMETHODIMP nsRenderingContextWin :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight)
{
nsRect tr;
tr.x = aX;
tr.y = aY;
tr.width = aWidth;
tr.height = aHeight;
return DrawImage(aImage, tr);
}
NS_IMETHODIMP nsRenderingContextWin :: DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect)
{
nsRect sr,dr;
sr = aSRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y, &sr.width, &sr.height);
sr.x = aSRect.x;
sr.y = aSRect.y;
mTranMatrix->TransformNoXLateCoord(&sr.x, &sr.y);
dr = aDRect;
mTranMatrix->TransformCoord(&dr.x, &dr.y, &dr.width, &dr.height);
return aImage->Draw(*this, mSurface, sr.x, sr.y, sr.width, sr.height, dr.x, dr.y, dr.width, dr.height);
}
NS_IMETHODIMP nsRenderingContextWin :: DrawImage(nsIImage *aImage, const nsRect& aRect)
{
nsRect tr;
tr = aRect;
mTranMatrix->TransformCoord(&tr.x, &tr.y, &tr.width, &tr.height);
return aImage->Draw(*this, mSurface, tr.x, tr.y, tr.width, tr.height);
}
/** ---------------------------------------------------
* See documentation in nsIRenderingContext.h
* @update 3/16/00 dwc
*/
PRBool
nsRenderingContextWin::CanTile(nscoord aWidth,nscoord aHeight)
{
PRInt32 canRaster;
// find out if the surface is a printer.
((nsDrawingSurfaceWin *)mSurface)->GetTECHNOLOGY(&canRaster);
if(canRaster != DT_RASPRINTER){
// XXX This may need tweaking for win98
if (PR_TRUE == gIsWIN95) {
// windows 98
if((aWidth<8)&&(aHeight<8)){
return PR_FALSE; // this does not seem to work on win 98
}else{
return PR_FALSE;
}
}
else {
// windows NT
return PR_FALSE;
}
} else {
return PR_FALSE;
}
}
NS_IMETHODIMP nsRenderingContextWin :: CopyOffScreenBits(nsDrawingSurface aSrcSurf,
PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds,

View File

@ -178,12 +178,6 @@ public:
PRInt32 aFontID,
const nscoord* aSpacing);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags);
//~~~
@ -218,14 +212,6 @@ protected:
~nsRenderingContextWin();
/** ---------------------------------------------------
* See documentation in nsIRenderingContextImpl.h
* @update 4/01/00 dwc
*/
virtual PRBool CanTile(nscoord aWidth,nscoord aHeight);
private:
// ConditionRect is used to fix a coordinate overflow problem under WIN95.
void ConditionRect(nsRect& aSrcRect, RECT& aDestRect);

View File

@ -2290,82 +2290,6 @@ nsRenderingContextXlib::DrawString(const nsString& aString,
aX, aY, aFontID, aSpacing);
}
NS_IMETHODIMP
nsRenderingContextXlib::DrawImage(nsIImage *aImage,
nscoord aX, nscoord aY)
{
PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::DrawImage(aImage, aX, aY)\n"));
nscoord width, height;
// we have to do this here because we are doing a transform below
width = NSToCoordRound(mP2T * aImage->GetWidth());
height = NSToCoordRound(mP2T * aImage->GetHeight());
return DrawImage(aImage, aX, aY, width, height);
}
NS_IMETHODIMP
nsRenderingContextXlib::DrawImage(nsIImage *aImage, const nsRect& aRect)
{
PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::DrawImage(aImage, aRect)\n"));
return DrawImage(aImage,
aRect.x,
aRect.y,
aRect.width,
aRect.height);
}
NS_IMETHODIMP
nsRenderingContextXlib::DrawImage(nsIImage *aImage,
nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight)
{
PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::DrawImage()\n"));
nscoord x, y, w, h;
x = aX;
y = aY;
w = aWidth;
h = aHeight;
mTranMatrix->TransformCoord(&x, &y, &w, &h);
UpdateGC();
return aImage->Draw(*this, mSurface,
x, y, w, h);
}
NS_IMETHODIMP
nsRenderingContextXlib::DrawImage(nsIImage *aImage,
const nsRect& aSRect,
const nsRect& aDRect)
{
PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::DrawImage()\n"));
nsRect sr, dr;
sr = aSRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y,
&sr.width, &sr.height);
sr.x -= mTranMatrix->GetXTranslationCoord();
sr.y -= mTranMatrix->GetYTranslationCoord();
dr = aDRect;
mTranMatrix->TransformCoord(&dr.x, &dr.y,
&dr.width, &dr.height);
UpdateGC();
return aImage->Draw(*this, mSurface,
sr.x, sr.y,
sr.width, sr.height,
dr.x, dr.y,
dr.width, dr.height);
}
NS_IMETHODIMP
nsRenderingContextXlib::CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags)

View File

@ -42,7 +42,6 @@
#ifndef nsRenderingContextXlib_h___
#define nsRenderingContextXlib_h___
#include "nsIImage.h"
#include "nsIDeviceContext.h"
#include "nsIWidget.h"
#include "nsRenderingContextImpl.h"
@ -192,11 +191,6 @@ public:
nsTextDimensions& aLastWordDimensions,
PRInt32* aFontID = nsnull);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY);
NS_IMETHOD DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds, PRUint32 aCopyFlags);
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd);

View File

@ -153,42 +153,6 @@ nsRenderingContextXp::CreateDrawingSurface(const nsRect& aBounds, PRUint32 aSurf
return NS_OK;
}
NS_IMETHODIMP
nsRenderingContextXp::DrawImage(nsIImage *aImage, const nsRect& aRect)
{
PR_LOG(RenderingContextXpLM, PR_LOG_DEBUG, ("nsRenderingContextXp::DrawImage()\n"));
nsRect tr;
tr = aRect;
mTranMatrix->TransformCoord(&tr.x, &tr.y, &tr.width, &tr.height);
UpdateGC();
return mPrintContext->DrawImage(mGC, aImage, tr.x, tr.y, tr.width, tr.height);
}
NS_IMETHODIMP
nsRenderingContextXp::DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect)
{
PR_LOG(RenderingContextXpLM, PR_LOG_DEBUG, ("nsRenderingContextXp::DrawImage()\n"));
nsRect sr,dr;
sr = aSRect;
mTranMatrix->TransformCoord(&sr.x, &sr.y,
&sr.width, &sr.height);
sr.x = aSRect.x;
sr.y = aSRect.y;
mTranMatrix->TransformNoXLateCoord(&sr.x, &sr.y);
dr = aDRect;
mTranMatrix->TransformCoord(&dr.x, &dr.y,
&dr.width, &dr.height);
UpdateGC();
return mPrintContext->DrawImage(mGC, aImage,
sr.x, sr.y,
sr.width, sr.height,
dr.x, dr.y,
dr.width, dr.height);
}
/* [noscript] void drawImage (in imgIContainer aImage, [const] in nsRect aSrcRect, [const] in nsPoint aDestPoint); */
NS_IMETHODIMP nsRenderingContextXp::DrawImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsPoint * aDestPoint)
{

View File

@ -69,8 +69,6 @@ class nsRenderingContextXp : public nsRenderingContextXlib
NS_IMETHOD CreateDrawingSurface(const nsRect& aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aRect);
NS_IMETHOD DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
NS_IMETHOD DrawImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsPoint * aDestPoint);
NS_IMETHOD DrawScaledImage(imgIContainer *aImage, const nsRect * aSrcRect, const nsRect * aDestRect);