fix implementation of the creation of DrawingSurfaces

This commit is contained in:
blizzard%redhat.com 1999-06-02 01:18:05 +00:00
Родитель e7e05cc9fa
Коммит 88a9c86123
2 изменённых файлов: 14 добавлений и 12 удалений

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

@ -42,16 +42,16 @@ nsDeviceContextXlib::nsDeviceContextXlib()
mPaletteInfo.numReserved = 0;
mPaletteInfo.palette = NULL;
mNumCells = 0;
mSurface = nsnull;
}
nsDeviceContextXlib::~nsDeviceContextXlib()
{
nsDrawingSurfaceXlib *surf = (nsDrawingSurfaceXlib *)mSurface;
NS_IF_RELEASE(surf);
mSurface = nsnull;
}
NS_IMPL_QUERY_INTERFACE(nsDeviceContextXlib, kDeviceContextIID)
NS_IMPL_ADDREF(nsDeviceContextXlib)
NS_IMPL_RELEASE(nsDeviceContextXlib)
NS_IMETHODIMP nsDeviceContextXlib::Init(nsNativeWidget aNativeWidget)
{
printf("nsDeviceContextXlib::Init()\n");
@ -154,8 +154,11 @@ NS_IMETHODIMP nsDeviceContextXlib::GetSystemAttribute(nsSystemAttrID anID, Syste
NS_IMETHODIMP nsDeviceContextXlib::GetDrawingSurface(nsIRenderingContext &aContext, nsDrawingSurface &aSurface)
{
printf("nsDeviceContextXlib::GetDrawingSurface()\n");
aContext.CreateDrawingSurface(nsnull, 0, aSurface);
return nsnull == aSurface ? NS_ERROR_OUT_OF_MEMORY : NS_OK;
if (NULL == mSurface) {
aContext.CreateDrawingSurface(nsnull, 0, mSurface);
}
aSurface = mSurface;
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextXlib::ConvertPixel(nscolor aColor, PRUint32 & aPixel)

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

@ -25,9 +25,6 @@ class nsDeviceContextXlib : public DeviceContextImpl
{
public:
nsDeviceContextXlib();
~nsDeviceContextXlib();
NS_DECL_ISUPPORTS
NS_IMETHOD Init(nsNativeWidget aNativeWidget);
@ -54,9 +51,11 @@ public:
NS_IMETHOD EndPage(void);
private:
nsPaletteInfo mPaletteInfo;
PRBool mWriteable;
PRUint32 mNumCells;
virtual ~nsDeviceContextXlib();
nsPaletteInfo mPaletteInfo;
PRBool mWriteable;
PRUint32 mNumCells;
nsDrawingSurface mSurface;
};
#endif