Bug 620610. When dumping display lists, include which layer each item ended up in. r=tnikkel,a=debug-only

This commit is contained in:
Robert O'Callahan 2011-01-04 16:56:57 +13:00
Родитель 18f5e2858b
Коммит 9a5403442c
2 изменённых файлов: 15 добавлений и 8 удалений

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

@ -43,9 +43,12 @@
#include "nsILayoutDebugger.h"
#include "nsFrame.h"
#include "nsDisplayList.h"
#include "FrameLayerBuilder.h"
#include <stdio.h>
using namespace mozilla::layers;
#ifdef NS_DEBUG
class nsLayoutDebugger : public nsILayoutDebugger {
public:
@ -182,12 +185,20 @@ PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
if (!list || list->DidComputeVisibility()) {
opaque = i->GetOpaqueRegion(aBuilder);
}
fprintf(aOutput, "%s %p(%s) (%d,%d,%d,%d)(%d,%d,%d,%d)%s%s\n",
fprintf(aOutput, "%s %p(%s) (%d,%d,%d,%d)(%d,%d,%d,%d)%s%s",
i->Name(), (void*)f, NS_ConvertUTF16toUTF8(fName).get(),
rect.x, rect.y, rect.width, rect.height,
vis.x, vis.y, vis.width, vis.height,
opaque.IsEmpty() ? "" : " opaque",
i->IsUniform(aBuilder, &color) ? " uniform" : "");
if (f) {
PRUint32 key = i->GetPerFrameKey();
Layer* layer = aBuilder->LayerBuilder()->GetOldLayerFor(f, key);
if (layer) {
fprintf(aOutput, " layer=%p", layer);
}
}
fputc('\n', aOutput);
if (list) {
PrintDisplayListTo(aBuilder, *list, aIndent + 4, aOutput);
}

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

@ -1428,13 +1428,6 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
list.ComputeVisibilityForRoot(&builder, &visibleRegion);
#ifdef DEBUG
if (gDumpPaintList) {
fprintf(stderr, "Painting --- after optimization:\n");
nsFrame::PrintDisplayList(&builder, list);
}
#endif
PRUint32 flags = nsDisplayList::PAINT_DEFAULT;
if (aFlags & PAINT_WIDGET_LAYERS) {
flags |= nsDisplayList::PAINT_USE_WIDGET_LAYERS;
@ -1464,6 +1457,9 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
#ifdef DEBUG
if (gDumpPaintList) {
fprintf(stderr, "Painting --- after optimization:\n");
nsFrame::PrintDisplayList(&builder, list);
fprintf(stderr, "Painting --- retained layer tree:\n");
builder.LayerBuilder()->DumpRetainedLayerTree();
}