Bug 1302758 Part 2 - Replace NOISY_FLOATMANAGER with nsBlockFrame::gNoisyFloatManager. r=dholbert

To see the flag in action, export GECKO_BLOCK_DEBUG_FLAGS="float-manager" and
open a page containing float elements. For example:

$ GECKO_BLOCK_DEBUG_FLAGS="float-manager" ./mach run layout/reftests/floats/orthogonal-floats-1a.html

MozReview-Commit-ID: 7Rb45ophewf

--HG--
extra : rebase_source : f40703a2ec448bf39a4a49e98fcd50f5550bbdd3
This commit is contained in:
Ting-Yu Lin 2016-09-15 14:32:12 +08:00
Родитель 926abf8d9a
Коммит b66ea190f5
3 изменённых файлов: 27 добавлений и 22 удалений

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

@ -1002,17 +1002,17 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
MOZ_ASSERT(!aFloat->GetNextInFlow());
}
#ifdef NOISY_FLOATMANAGER
nscoord tI, tB;
mFloatManager->GetTranslation(tI, tB);
nsIFrame::ListTag(stdout, mBlock);
printf(": FlowAndPlaceFloat: AddFloat: tIB=%d,%d (%d,%d) {%d,%d,%d,%d}\n",
tI, tB, mFloatManagerI, mFloatManagerB,
region.IStart(wm), region.BStart(wm),
region.ISize(wm), region.BSize(wm));
#endif
#ifdef DEBUG
if (nsBlockFrame::gNoisyFloatManager) {
nscoord tI, tB;
mFloatManager->GetTranslation(tI, tB);
nsIFrame::ListTag(stdout, mBlock);
printf(": FlowAndPlaceFloat: AddFloat: tIB=%d,%d (%d,%d) {%d,%d,%d,%d}\n",
tI, tB, mFloatManagerI, mFloatManagerB,
region.IStart(wm), region.BStart(wm),
region.ISize(wm), region.BSize(wm));
}
if (nsBlockFrame::gNoisyReflow) {
nsRect r = aFloat->GetRect();
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);

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

@ -15,7 +15,6 @@
#undef NOISY_BLOCK_DIR_MARGINS
#undef NOISY_REFLOW_REASON // gives a little info about why each reflow was requested
#undef REFLOW_STATUS_COVERAGE // I think this is most useful for printing, to see which frames return "incomplete"
#undef NOISY_FLOATMANAGER // enables debug output for float manager use, useful for analysing reflow of floats
#undef NOISY_BLOCK_INVALIDATE // enables debug output for all calls to invalidate
#undef REALLY_NOISY_REFLOW // some extra debug info

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

@ -10,7 +10,7 @@
#include <algorithm>
#include "mozilla/ReflowInput.h"
#include "nsBlockDebugFlags.h"
#include "nsBlockFrame.h"
#include "nsError.h"
#include "nsIPresShell.h"
#include "nsMemory.h"
@ -559,17 +559,21 @@ nsAutoFloatManager::~nsAutoFloatManager()
{
// Restore the old float manager in the reflow input if necessary.
if (mNew) {
#ifdef NOISY_FLOATMANAGER
printf("restoring old float manager %p\n", mOld);
#ifdef DEBUG
if (nsBlockFrame::gNoisyFloatManager) {
printf("restoring old float manager %p\n", mOld);
}
#endif
mReflowInput.mFloatManager = mOld;
#ifdef NOISY_FLOATMANAGER
if (mOld) {
mReflowInput.mFrame->ListTag(stdout);
printf(": float manager %p after reflow\n", mOld);
mOld->List(stdout);
#ifdef DEBUG
if (nsBlockFrame::gNoisyFloatManager) {
if (mOld) {
mReflowInput.mFrame->ListTag(stdout);
printf(": float manager %p after reflow\n", mOld);
mOld->List(stdout);
}
}
#endif
@ -588,9 +592,11 @@ nsAutoFloatManager::CreateFloatManager(nsPresContext *aPresContext)
if (! mNew)
return NS_ERROR_OUT_OF_MEMORY;
#ifdef NOISY_FLOATMANAGER
printf("constructed new float manager %p (replacing %p)\n",
mNew, mReflowInput.mFloatManager);
#ifdef DEBUG
if (nsBlockFrame::gNoisyFloatManager) {
printf("constructed new float manager %p (replacing %p)\n",
mNew, mReflowInput.mFloatManager);
}
#endif
// Set the float manager in the existing reflow input.