Bug 739604 - Split out dumping of paint buffers from paint lists. r=mattwoodrow
authorChris Lord <chrislord.net@gmail.com>
Wed, 28 Mar 2012 19:10:28 +0100
changeset 90523 2fbd3599386cccd457c5b9cee0a578e50000400d
parent 90522 f4ab0eddbe90b4c588b29ea1f1b39d6b14a47e09
child 90524 baf59f769aed7a02b4cae352147bd3b68487575b
push id7704
push userchrislord.net@gmail.com
push dateWed, 28 Mar 2012 18:10:58 +0000
treeherdermozilla-inbound@2fbd3599386c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs739604
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 739604 - Split out dumping of paint buffers from paint lists. r=mattwoodrow Split dumping of paint buffers into a separate environment variable, vs. dumping of paint buffers to allow for dumping only of paint lists.
gfx/thebes/gfxUtils.cpp
gfx/thebes/gfxUtils.h
layout/base/nsLayoutUtils.cpp
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -733,12 +733,13 @@ gfxUtils::CopyAsDataURL(DrawTarget* aDT)
   nsRefPtr<gfxASurface> surf = gfxPlatform::GetPlatform()->GetThebesSurfaceForDrawTarget(aDT);
   if (surf) {
     surf->CopyAsDataURL();
   } else {
     NS_WARNING("Failed to get Thebes surface!");
   }
 }
 
-bool gfxUtils::sDumpPainting = getenv("MOZ_DUMP_PAINT_LIST") != 0;
+bool gfxUtils::sDumpPaintList = getenv("MOZ_DUMP_PAINT_LIST") != 0;
+bool gfxUtils::sDumpPainting = getenv("MOZ_DUMP_PAINT") != 0;
 bool gfxUtils::sDumpPaintingToFile = getenv("MOZ_DUMP_PAINT_TO_FILE") != 0;
 FILE *gfxUtils::sDumpPaintFile = NULL;
 #endif
--- a/gfx/thebes/gfxUtils.h
+++ b/gfx/thebes/gfxUtils.h
@@ -166,16 +166,17 @@ public:
      */
     static void DumpAsDataURL(mozilla::gfx::DrawTarget* aDT);
 
     /**
      * Copy a PNG encoded Data URL to the clipboard.
      */
     static void CopyAsDataURL(mozilla::gfx::DrawTarget* aDT);
 
+    static bool sDumpPaintList;
     static bool sDumpPainting;
     static bool sDumpPaintingToFile;
     static FILE* sDumpPaintFile;
 #endif
 };
 
 namespace mozilla {
 namespace gfx {
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1735,17 +1735,17 @@ nsLayoutUtils::PaintFrame(nsRenderingCon
   builder.LeavePresShell(aFrame, dirtyRect);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (builder.GetHadToIgnorePaintSuppression()) {
     willFlushRetainedLayers = true;
   }
 
 #ifdef MOZ_DUMP_PAINTING
-  if (gfxUtils::sDumpPainting) {
+  if (gfxUtils::sDumpPaintList || gfxUtils::sDumpPainting) {
     if (gfxUtils::sDumpPaintingToFile) {
       nsCString string("dump-");
       string.AppendInt(gPaintCount);
       string.Append(".html");
       gfxUtils::sDumpPaintFile = fopen(string.BeginReading(), "w");
     } else {
       gfxUtils::sDumpPaintFile = stdout;
     }
@@ -1799,17 +1799,17 @@ nsLayoutUtils::PaintFrame(nsRenderingCon
       nsRegion excludedRegion = builder.GetExcludedGlassRegion();
       excludedRegion.Sub(excludedRegion, visibleRegion);
       nsIntRegion windowRegion(excludedRegion.ToNearestPixels(presContext->AppUnitsPerDevPixel()));
       widget->UpdateOpaqueRegion(windowRegion);
     }
   }
 
 #ifdef MOZ_DUMP_PAINTING
-  if (gfxUtils::sDumpPainting) {
+  if (gfxUtils::sDumpPaintList || gfxUtils::sDumpPainting) {
     fprintf(gfxUtils::sDumpPaintFile, "</script>Painting --- after optimization:\n");
     nsFrame::PrintDisplayList(&builder, list, gfxUtils::sDumpPaintFile);
 
     fprintf(gfxUtils::sDumpPaintFile, "Painting --- retained layer tree:\n");
     builder.LayerBuilder()->DumpRetainedLayerTree(gfxUtils::sDumpPaintFile);
     fprintf(gfxUtils::sDumpPaintFile, "</body></html>");
     
     if (gfxUtils::sDumpPaintingToFile) {