Bug 1208661 - Show display list and layer textures in-line in the HTML paint dump. r=BenWa

This commit is contained in:
Botond Ballo 2015-09-28 15:22:05 -04:00
parent b275777f5e
commit 13a2ca6935
3 changed files with 23 additions and 1 deletions

View File

@ -1705,6 +1705,11 @@ Layer::Dump(std::stringstream& aStream, const char* aPrefix, bool aDumpHtml)
if (aDumpHtml) {
aStream << "</a>";
#ifdef MOZ_DUMP_PAINTING
if (dumpClientTexture) {
aStream << nsPrintfCString("<br><img id=\"%s\">\n", layerId.BeginReading()).get();
}
#endif
}
if (Layer* mask = GetMaskLayer()) {

View File

@ -234,6 +234,14 @@ PrintDisplayItemTo(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem,
}
#endif
aStream << "\n";
#ifdef MOZ_DUMP_PAINTING
if (aDumpHtml && aItem->Painted()) {
nsCString string(aItem->Name());
string.Append('-');
string.AppendInt((uint64_t)aItem);
aStream << nsPrintfCString("<br><img id=\"%s\">\n", string.BeginReading());
}
#endif
if (aDumpSublist && list) {
PrintDisplayListTo(aBuilder, *list, aStream, aIndent+1, aDumpHtml);

View File

@ -3312,7 +3312,16 @@ nsLayoutUtils::PaintFrame(nsRenderingContext* aRenderingContext, nsIFrame* aFram
gfxUtils::sDumpPaintFile = stderr;
}
if (gfxUtils::sDumpPaintingToFile) {
*ss << "<html><head><script>var array = {}; function ViewImage(index) { window.location = array[index]; }</script></head><body>";
*ss << "<html><head><script>\n"
"var array = {};\n"
"function ViewImage(index) { \n"
" var image = document.getElementById(index);\n"
" if (image.src) {\n"
" image.removeAttribute('src');\n"
" } else {\n"
" image.src = array[index];\n"
" }\n"
"}</script></head><body>";
}
#endif
*ss << nsPrintfCString("Painting --- before optimization (dirty %d,%d,%d,%d):\n",