Enabling the Display of leaf frame reflow counts

Bug 71514 r=kmcclusk sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@89418 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rods%netscape.com 2001-03-13 01:53:45 +00:00
parent 793e57b78c
commit be719273bd
5 changed files with 42 additions and 3 deletions

View File

@ -3181,6 +3181,24 @@ nsBrowserWindow::DumpReflowStats(FILE* out)
}
}
void
nsBrowserWindow::DisplayReflowStats(PRBool aIsOn)
{
nsIPresShell* shell = GetPresShell();
if (nsnull != shell) {
#ifdef MOZ_REFLOW_PERF
shell->SetPaintFrameCount(aIsOn);
SetBoolPref("layout.reflow.showframecounts",aIsOn);
ForceRefresh();
#else
fprintf(out,"***********************************\n");
fprintf(out, "Sorry, you have built with MOZ_REFLOW_PERF=1\n");
fprintf(out,"***********************************\n");
#endif
NS_RELEASE(shell);
}
}
void
nsBrowserWindow::ToggleFrameBorders()
{
@ -3516,6 +3534,16 @@ nsBrowserWindow::DispatchDebugMenu(PRInt32 aID)
result = nsEventStatus_eConsumeNoDefault;
break;
case VIEWER_DSP_REFLOW_CNTS_ON:
DisplayReflowStats(PR_TRUE);
result = nsEventStatus_eConsumeNoDefault;
break;
case VIEWER_DSP_REFLOW_CNTS_OFF:
DisplayReflowStats(PR_FALSE);
result = nsEventStatus_eConsumeNoDefault;
break;
case VIEWER_SHOW_CONTENT_SIZE:
ShowContentSize();
result = nsEventStatus_eConsumeNoDefault;

View File

@ -180,6 +180,7 @@ public:
void DumpStyleSheets(FILE *out = stdout);
void DumpStyleContexts(FILE *out = stdout);
void DumpReflowStats(FILE *out = stdout);
void DisplayReflowStats(PRBool aIsOn);
void ToggleFrameBorders();
void ToggleVisualEventDebugging();
void ToggleBoolPrefAndRefresh(const char * aPrefName);

View File

@ -89,6 +89,8 @@
#define VIEWER_USE_DTD_MODE 40079
#define VIEWER_STANDARD_MODE 40080
#define VIEWER_NAV_QUIRKS_MODE 40081
#define VIEWER_DSP_REFLOW_CNTS_ON 40084
#define VIEWER_DSP_REFLOW_CNTS_OFF 40085
#define VIEWER_DEBUG_DUMP_REFLOW_TOTS 40086
#define VIEWER_TOGGLE_PAINT_FLASHING 40200

View File

@ -98,7 +98,10 @@ GtkItemFactoryEntry menu_items[] =
{ "/Debug/Event Debugging/Toggle Motion Event Dumping", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_MOTION_EVENT_DUMPING,nsnull },
{ "/Debug/Event Debugging/Toggle Crossing Event Dumping", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_TOGGLE_CROSSING_EVENT_DUMPING,nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/_Reflow Test", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_REFLOW_TEST, nsnull },
{ "/Debug/Reflow Debugging/_Reflow Test", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_REFLOW_TEST, nsnull },
{ "/Debug/Reflow Debugging/Dump Reflow Stats", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DEBUG_DUMP_REFLOW_TOTS, nsnull },
{ "/Debug/Reflow Debugging/Reflow Counts On", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DSP_REFLOW_CNTS_ON, nsnull },
{ "/Debug/Reflow Debugging/Reflow Counts Off", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DSP_REFLOW_CNTS_OFF, nsnull },
{ "/Debug/sep1", nsnull, nsnull, 0, "<Separator>" },
{ "/Debug/Dump _Content", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_CONTENT, nsnull },
{ "/Debug/Dump _Frames", nsnull, (GIFC)gtk_ifactory_cb, VIEWER_DUMP_FRAMES, nsnull },

View File

@ -93,12 +93,17 @@ VIEWER MENU DISCARDABLE
MENUITEM "Toggle Crossing Event Dumping", VIEWER_TOGGLE_CROSSING_EVENT_DUMPING
}
MENUITEM SEPARATOR
MENUITEM "&Reflow Test", VIEWER_REFLOW_TEST
POPUP "Reflow Debugging"
{
MENUITEM "&Reflow Test", VIEWER_REFLOW_TEST
MENUITEM "Dump Reflow Stats", VIEWER_DEBUG_DUMP_REFLOW_TOTS
MENUITEM "Reflow Counts On", VIEWER_DSP_REFLOW_CNTS_ON
MENUITEM "Reflow Counts Off", VIEWER_DSP_REFLOW_CNTS_OFF
}
MENUITEM SEPARATOR
MENUITEM "Dump &Content", VIEWER_DUMP_CONTENT
MENUITEM "Dump &Frames", VIEWER_DUMP_FRAMES
MENUITEM "Dump &Views", VIEWER_DUMP_VIEWS
MENUITEM "Dump &Reflow Stats", VIEWER_DEBUG_DUMP_REFLOW_TOTS
MENUITEM SEPARATOR
MENUITEM "Dump &Style Sheets", VIEWER_DUMP_STYLE_SHEETS
MENUITEM "Dump &Style Contexts", VIEWER_DUMP_STYLE_CONTEXTS