This commit is contained in:
roc+%cs.cmu.edu 2002-12-21 04:39:02 +00:00
Родитель 1328e2d561
Коммит 04946827e5
3 изменённых файлов: 19 добавлений и 2 удалений

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

@ -568,6 +568,16 @@ NS_IMETHODIMP nsDeviceContextWin :: GetSystemFont(nsSystemFontID anID, nsFont *a
return status;
}
NS_IMETHODIMP nsDeviceContextWin :: GetDrawingSurface(nsIRenderingContext &aContext, nsDrawingSurface &aSurface)
{
if (NULL == mSurface) {
aContext.CreateDrawingSurface(nsnull, 0, mSurface);
}
aSurface = mSurface;
return NS_OK;
}
int CALLBACK fontcallback(ENUMLOGFONT FAR *lpelf, NEWTEXTMETRIC FAR *lpntm,
int FontType, LPARAM lParam)
{

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

@ -63,6 +63,12 @@ public:
NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const;
NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const;
//get a low level drawing surface for rendering. the rendering context
//that is passed in is used to create the drawing surface if there isn't
//already one in the device context. the drawing surface is then cached
//in the device context for re-use.
NS_IMETHOD GetDrawingSurface(nsIRenderingContext &aContext, nsDrawingSurface &aSurface);
NS_IMETHOD CheckFontExistence(const nsString& aFontName);
NS_IMETHOD GetDepth(PRUint32& aDepth);

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

@ -40,7 +40,7 @@
#include "nsImageWin.h"
#include "nsRenderingContextWin.h"
#include "nsDeviceContextWin.h"
static nsresult BuildDIB(LPBITMAPINFOHEADER *aBHead,PRInt32 aWidth,PRInt32 aHeight,PRInt32 aDepth,PRInt8 *aNumBitPix);
@ -554,7 +554,8 @@ nsImageWin :: Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface,
nsIDeviceContext *dx;
aContext.GetDeviceContext(dx);
nsDrawingSurface ds;
dx->GetDrawingSurface(aContext, ds);
NS_STATIC_CAST(nsDeviceContextWin*, dx)->GetDrawingSurface(aContext, ds);
nsDrawingSurfaceWin *srcDS = (nsDrawingSurfaceWin *)ds;
HDC srcDC;