Fixed merge error. Added rods performance code back in.

git-svn-id: svn://10.0.0.236/trunk@67262 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
evaughan%netscape.com
2000-04-26 21:01:57 +00:00
parent cd8643349b
commit 0fc64ebc07
4 changed files with 146 additions and 26 deletions

View File

@@ -136,6 +136,76 @@ static NS_DEFINE_CID(kCXIFConverterCID, NS_XIFFORMATCONVERTER_CID);
#undef NOISY
//========================================================================
#ifdef MOZ_REFLOW_PERF
class ReflowCountMgr;
static const char * kGrandTotalsStr = "Grand Totals";
#define NUM_REFLOW_TYPES 5
// Counting Class
class ReflowCounter {
public:
ReflowCounter(ReflowCountMgr * aMgr);
~ReflowCounter();
void ClearTotals();
void DisplayTotals(const char * aStr);
void DisplayHTMLTotals(const char * aStr);
void Add(nsReflowReason aType) { mTotals[aType]++; mTotal++; }
void Add(nsReflowReason aType, PRUint32 aTotal) { mTotals[aType] += aTotal; mTotal += aTotal; }
protected:
void DisplayTotals(PRUint32 * aArray, const char * aTitle);
void DisplayHTMLTotals(PRUint32 * aArray, const char * aTitle);
PRUint32 mTotals[NUM_REFLOW_TYPES];
PRUint32 mTotal;
ReflowCountMgr * mMgr;
};
// Manager Class
class ReflowCountMgr {
public:
ReflowCountMgr();
//static ReflowCountMgr * GetInstance() { return &gReflowCountMgr; }
~ReflowCountMgr();
void ClearTotals();
void DisplayTotals(const char * aStr);
void DisplayHTMLTotals(const char * aStr);
void Add(const char * aName, nsReflowReason aType);
ReflowCounter * LookUp(const char * aName);
FILE * GetOutFile() { return mFD; }
protected:
void DisplayTotals(PRUint32 * aArray, PRUint32 * aDupArray, char * aTitle);
void DisplayHTMLTotals(PRUint32 * aArray, PRUint32 * aDupArray, char * aTitle);
static PRIntn RemoveItems(PLHashEntry *he, PRIntn i, void *arg);
void CleanUp();
// stdout Output Methods
static PRIntn DoSingleTotal(PLHashEntry *he, PRIntn i, void *arg);
void DoGrandTotals();
// HTML Output Methods
static PRIntn DoSingleHTMLTotal(PLHashEntry *he, PRIntn i, void *arg);
void DoGrandHTMLTotals();
PLHashTable * mCounts;
FILE * mFD;
// ReflowCountMgr gReflowCountMgr;
};
#endif
//========================================================================
// comment out to hide caret
#define SHOW_CARET
@@ -260,6 +330,7 @@ StackArena::Push()
StackMark* oldMarks = mMarks;
PRUint32 oldLength = mMarkLength;
mMarkLength += MARK_INCREMENT;
void* marks = 0;
mMarks = new StackMark[mMarkLength];
nsCRT::memcpy(mMarks, oldMarks, sizeof(StackMark)*oldLength);
@@ -2056,12 +2127,6 @@ PresShell::AlreadyInQueue(nsIReflowCommand* aReflowCommand)
return inQueue;
}
/*
#ifdef DEBUG_evaughan
static PRInt32 gPosted = 0;
#endif
*/
NS_IMETHODIMP
PresShell::AppendReflowCommand(nsIReflowCommand* aReflowCommand)
{
@@ -2087,11 +2152,6 @@ PresShell::AppendReflowCommand(nsIReflowCommand* aReflowCommand)
if (!AlreadyInQueue(aReflowCommand)) {
NS_ADDREF(aReflowCommand);
rv = (mReflowCommands.AppendElement(aReflowCommand) ? NS_OK : NS_ERROR_OUT_OF_MEMORY);
/*
#ifdef DEBUG_evaughan
printf("ReflowCommandsPosted=%d\n", ++gPosted);
#endif
*/
}
// Kick off a reflow event if we aren't batching reflows

View File

@@ -925,8 +925,8 @@ nsGfxScrollFrameInner::Layout(nsBoxLayoutState& aState)
// there is a chance that by adding the horizonal scrollbar we will
// suddenly need a vertical scrollbar. Is a special case but its
// important.
if (!mHasVerticalScrollbar && scrolledContentSize.height > scrollAreaRect.height - sbSize.height)
printf("****Gfx Scrollbar Special case hit!!*****\n");
//if (!mHasVerticalScrollbar && scrolledContentSize.height > scrollAreaRect.height - sbSize.height)
// printf("****Gfx Scrollbar Special case hit!!*****\n");
}
} else {

View File

@@ -925,8 +925,8 @@ nsGfxScrollFrameInner::Layout(nsBoxLayoutState& aState)
// there is a chance that by adding the horizonal scrollbar we will
// suddenly need a vertical scrollbar. Is a special case but its
// important.
if (!mHasVerticalScrollbar && scrolledContentSize.height > scrollAreaRect.height - sbSize.height)
printf("****Gfx Scrollbar Special case hit!!*****\n");
//if (!mHasVerticalScrollbar && scrolledContentSize.height > scrollAreaRect.height - sbSize.height)
// printf("****Gfx Scrollbar Special case hit!!*****\n");
}
} else {

View File

@@ -136,6 +136,76 @@ static NS_DEFINE_CID(kCXIFConverterCID, NS_XIFFORMATCONVERTER_CID);
#undef NOISY
//========================================================================
#ifdef MOZ_REFLOW_PERF
class ReflowCountMgr;
static const char * kGrandTotalsStr = "Grand Totals";
#define NUM_REFLOW_TYPES 5
// Counting Class
class ReflowCounter {
public:
ReflowCounter(ReflowCountMgr * aMgr);
~ReflowCounter();
void ClearTotals();
void DisplayTotals(const char * aStr);
void DisplayHTMLTotals(const char * aStr);
void Add(nsReflowReason aType) { mTotals[aType]++; mTotal++; }
void Add(nsReflowReason aType, PRUint32 aTotal) { mTotals[aType] += aTotal; mTotal += aTotal; }
protected:
void DisplayTotals(PRUint32 * aArray, const char * aTitle);
void DisplayHTMLTotals(PRUint32 * aArray, const char * aTitle);
PRUint32 mTotals[NUM_REFLOW_TYPES];
PRUint32 mTotal;
ReflowCountMgr * mMgr;
};
// Manager Class
class ReflowCountMgr {
public:
ReflowCountMgr();
//static ReflowCountMgr * GetInstance() { return &gReflowCountMgr; }
~ReflowCountMgr();
void ClearTotals();
void DisplayTotals(const char * aStr);
void DisplayHTMLTotals(const char * aStr);
void Add(const char * aName, nsReflowReason aType);
ReflowCounter * LookUp(const char * aName);
FILE * GetOutFile() { return mFD; }
protected:
void DisplayTotals(PRUint32 * aArray, PRUint32 * aDupArray, char * aTitle);
void DisplayHTMLTotals(PRUint32 * aArray, PRUint32 * aDupArray, char * aTitle);
static PRIntn RemoveItems(PLHashEntry *he, PRIntn i, void *arg);
void CleanUp();
// stdout Output Methods
static PRIntn DoSingleTotal(PLHashEntry *he, PRIntn i, void *arg);
void DoGrandTotals();
// HTML Output Methods
static PRIntn DoSingleHTMLTotal(PLHashEntry *he, PRIntn i, void *arg);
void DoGrandHTMLTotals();
PLHashTable * mCounts;
FILE * mFD;
// ReflowCountMgr gReflowCountMgr;
};
#endif
//========================================================================
// comment out to hide caret
#define SHOW_CARET
@@ -260,6 +330,7 @@ StackArena::Push()
StackMark* oldMarks = mMarks;
PRUint32 oldLength = mMarkLength;
mMarkLength += MARK_INCREMENT;
void* marks = 0;
mMarks = new StackMark[mMarkLength];
nsCRT::memcpy(mMarks, oldMarks, sizeof(StackMark)*oldLength);
@@ -2056,12 +2127,6 @@ PresShell::AlreadyInQueue(nsIReflowCommand* aReflowCommand)
return inQueue;
}
/*
#ifdef DEBUG_evaughan
static PRInt32 gPosted = 0;
#endif
*/
NS_IMETHODIMP
PresShell::AppendReflowCommand(nsIReflowCommand* aReflowCommand)
{
@@ -2087,11 +2152,6 @@ PresShell::AppendReflowCommand(nsIReflowCommand* aReflowCommand)
if (!AlreadyInQueue(aReflowCommand)) {
NS_ADDREF(aReflowCommand);
rv = (mReflowCommands.AppendElement(aReflowCommand) ? NS_OK : NS_ERROR_OUT_OF_MEMORY);
/*
#ifdef DEBUG_evaughan
printf("ReflowCommandsPosted=%d\n", ++gPosted);
#endif
*/
}
// Kick off a reflow event if we aren't batching reflows