removing more useless debugging code. also adding code for checking pixmaps.

This commit is contained in:
zack%kde.org 2004-12-12 03:50:21 +00:00
Родитель 351a576e96
Коммит 5708a68c74
13 изменённых файлов: 32 добавлений и 133 удалений

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

@ -1022,11 +1022,9 @@ nsresult GlobalPrinters::InitializeGlobalPrinters ()
//----------------------------------------------------------------------
void GlobalPrinters::FreeGlobalPrinters()
{
if (mGlobalPrinterList) {
delete mGlobalPrinterList;
mGlobalPrinterList = nsnull;
mGlobalNumPrinters = 0;
}
delete mGlobalPrinterList;
mGlobalPrinterList = nsnull;
mGlobalNumPrinters = 0;
}
void

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

@ -44,23 +44,10 @@
#include "qtlog.h"
#ifdef DEBUG
PRUint32 gDSCount = 0;
PRUint32 gDSID = 0;
#endif
NS_IMPL_ISUPPORTS1(nsDrawingSurfaceQt, nsIDrawingSurface)
nsDrawingSurfaceQt::nsDrawingSurfaceQt()
{
#ifdef DEBUG
gDSCount++;
mID = gDSID++;
PR_LOG(gQtLogModule, QT_BASIC,
("nsDrawingSurfaceQt CTOR (%p) ID: %d, Count: %d\n",
this, mID, gDSCount));
#endif
mPaintDevice = nsnull;
mGC = nsnull;
mDepth = -1;
@ -87,13 +74,6 @@ nsDrawingSurfaceQt::nsDrawingSurfaceQt()
nsDrawingSurfaceQt::~nsDrawingSurfaceQt()
{
#ifdef DEBUG
gDSCount--;
PR_LOG(gQtLogModule, QT_BASIC,
("nsDrawingSurfaceQt DTOR (%p) ID: %d, Count: %d\n",
this, mID, gDSCount));
#endif
if (mGC && mGC->isActive()) {
mGC->end();
}

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

@ -121,8 +121,6 @@ private:
PRUint32 mLockHeight;
PRUint32 mLockFlags;
PRBool mLocked;
PRUint32 mID;
};
#endif

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

@ -107,11 +107,6 @@ public:
PRUint16 mWeight;
void RealizeFont();
#ifdef DEBUG
private:
PRUint32 mID;
#endif
};
class nsFontMetricsQt : public nsIFontMetrics
@ -203,11 +198,6 @@ protected:
static QFontDatabase *mQFontDB;
#endif
#ifdef DEBUG
private:
PRUint32 mID;
#endif
};
class nsFontEnumeratorQt : public nsIFontEnumerator

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

@ -41,16 +41,37 @@
#include "nsImageQt.h"
#include "nsRenderingContextQt.h"
#include <qimage.h>
#include "nspr.h"
#include "qtlog.h"
#define IsFlagSet(a,b) ((a) & (b))
#ifdef DEBUG
PRUint32 gImageCount = 0;
PRUint32 gImageID = 0;
#ifdef CHECK_PIXMAPS
#include <qfileinfo.h>
static void savePixmap(const QPixmap &px)
{
static int i = 0;
QString baseFile( "saved_pixmap" );
const char *format = "PNG";
QString fileName = QString("%1%2.%2").arg(baseFile)
.arg(i).arg(format);
while (QFileInfo(fileName).exists()) {
++i;
fileName = QString("%1%2.%2").arg(baseFile)
.arg(i).arg(format);
}
px.save(fileName, format);
}
#endif
NS_IMPL_ISUPPORTS1(nsImageQt, nsIImage)
//------------------------------------------------------------
@ -66,22 +87,11 @@ nsImageQt::nsImageQt()
, mNumBytesPixel(0)
, pixmapDirty(PR_FALSE)
{
#ifdef DEBUG
gImageCount++;
mID = gImageID++;
PR_LOG(gQtLogModule, QT_BASIC,
("nsImageQt CTOR (%p) ID: %d, Count: %d\n", this, mID, gImageCount));
#endif
}
//------------------------------------------------------------
nsImageQt::~nsImageQt()
{
#ifdef DEBUG
gImageCount--;
PR_LOG(gQtLogModule, QT_BASIC,
("nsImageQt DTOR (%p) ID: %d, Count: %d\n", this, mID, gImageCount));
#endif
if (nsnull != mImageBits) {
delete[] mImageBits;
mImageBits = nsnull;
@ -97,6 +107,7 @@ nsresult nsImageQt::Init(PRInt32 aWidth,PRInt32 aHeight,
PRInt32 aDepth,
nsMaskRequirements aMaskRequirements)
{
qDebug("creating a pixmap with [%d,%d,%d]", aWidth, aHeight, aDepth);
// gfxImageFrame forces only one nsImageQt::Init
if (aWidth == 0 || aHeight == 0) {
return NS_ERROR_FAILURE;
@ -328,6 +339,10 @@ void nsImageQt::updatePixmap()
}
pixmap = QPixmap(qimage);
#ifdef CHECK_PIXMAPS
savePixmap(pixmap);
#endif
pixmapDirty = PR_FALSE;
}

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

@ -133,8 +133,6 @@ private:
QPixmap pixmap;
PRBool pixmapDirty;
PRUint32 mID;
};
#endif

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

@ -45,28 +45,12 @@
#include "qtlog.h"
#ifdef DEBUG
PRUint32 gRegionCount = 0;
PRUint32 gRegionID = 0;
#endif
nsRegionQt::nsRegionQt() : mRegion()
{
#ifdef DEBUG
gRegionCount++;
mID = gRegionID++;
PR_LOG(gQtLogModule, QT_BASIC,
("nsRegionQt CTOR (%p) ID: %d, Count: %d\n", this, mID, gRegionCount));
#endif
}
nsRegionQt::~nsRegionQt()
{
#ifdef DEBUG
gRegionCount--;
PR_LOG(gQtLogModule, QT_BASIC,
("nsRegionQt DTOR (%p) ID: %d, Count: %d\n", this, mID, gRegionCount));
#endif
}
NS_IMPL_ISUPPORTS1(nsRegionQt, nsIRegion)

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

@ -80,9 +80,6 @@ private:
private:
QRegion mRegion;
#ifdef DEBUG
PRUint32 mID;
#endif
};
#endif // nsRegionQt_h___

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

@ -53,14 +53,6 @@
#include "qtlog.h"
#ifdef DEBUG
PRUint32 gRCCount = 0;
PRUint32 gRCID = 0;
PRUint32 gGSCount = 0;
PRUint32 gGSID = 0;
#endif
class GraphicsState
{
public:
@ -73,19 +65,10 @@ public:
nscolor mColor;
nsLineStyle mLineStyle;
nsIFontMetrics *mFontMetrics;
private:
PRUint32 mID;
};
GraphicsState::GraphicsState()
{
#ifdef DEBUG
gGSCount++;
mID = gGSID++;
PR_LOG(gQtLogModule, QT_BASIC,
("GraphicsState CTOR (%p) ID: %d, Count: %d\n", this, mID, gGSCount));
#endif
mMatrix = nsnull;
mLocalClip.x = mLocalClip.y = mLocalClip.width = mLocalClip.height = 0;
mClipRegion = nsnull;
@ -96,11 +79,6 @@ GraphicsState::GraphicsState()
GraphicsState::~GraphicsState()
{
#ifdef DEBUG
gGSCount--;
PR_LOG(gQtLogModule, QT_BASIC,
("GraphicsState DTOR (%p) ID: %d, Count: %d\n", this, mID, gGSCount));
#endif
}
NS_IMPL_THREADSAFE_ISUPPORTS1(nsRenderingContextQt, nsIRenderingContext)
@ -109,13 +87,6 @@ static NS_DEFINE_CID(kRegionCID, NS_REGION_CID);
nsRenderingContextQt::nsRenderingContextQt()
{
#ifdef DEBUG
gRCCount++;
mID = gRCID++;
PR_LOG(gQtLogModule, QT_BASIC,
("nsRenderingContextQt CTOR (%p) ID: %d, Count: %d\n", this, mID, gRCCount));
#endif
mFontMetrics = nsnull;
mContext = nsnull;
mSurface = nsnull;
@ -135,11 +106,6 @@ nsRenderingContextQt::nsRenderingContextQt()
nsRenderingContextQt::~nsRenderingContextQt()
{
#ifdef DEBUG
gRCCount--;
PR_LOG(gQtLogModule, QT_BASIC,
("nsRenderingContextQt DTOR (%p) ID: %d, Count: %d\n", this, mID, gRCCount));
#endif
// Destroy the State Machine
PRInt32 cnt = mStateCache.Count();

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

@ -247,7 +247,6 @@ protected:
nsFontQt *mCurrentFont;
Qt::PenStyle mQLineStyle;
Qt::RasterOp mFunction;
PRUint32 mID;
};
#endif /* nsRenderingContextQt_h___ */

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

@ -64,11 +64,6 @@ private:
nsCOMPtr<nsIScreen> *screens;
QDesktopWidget *desktop;
int nScreens;
#ifdef DEBUG
PRUint32 mID;
#endif
};
#endif // nsScreenManagerQt_h___

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

@ -44,21 +44,9 @@
#include "qtlog.h"
#ifdef DEBUG
PRUint32 gScreenCount = 0;
PRUint32 gScreenID = 0;
#endif
nsScreenQt::nsScreenQt(int aScreen)
{
screen = aScreen;
#ifdef DEBUG
gScreenCount++;
mID = gScreenID++;
PR_LOG(gQtLogModule, QT_BASIC,
("nsScreenQt CTOR (%p) ID: %d, Count: %d\n", this, mID, gScreenCount));
#endif
// nothing else to do. I guess we could cache a bunch of information
// here, but we want to ask the device at runtime in case anything
// has changed.
@ -66,11 +54,6 @@ nsScreenQt::nsScreenQt(int aScreen)
nsScreenQt::~nsScreenQt()
{
#ifdef DEBUG
gScreenCount--;
PR_LOG(gQtLogModule, QT_BASIC,
("nsScreenQt DTOR (%p) ID: %d, Count: %d\n", this, mID, gScreenCount));
#endif
// nothing to see here.
}

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

@ -56,10 +56,6 @@ public:
private:
int screen;
#ifdef DEBUG
PRUint32 mID;
#endif
};
#endif // nsScreenQt_h___