The new "mega" viz mode both adds visualization and forces all drawing to the visible canvas (by replacing the active saveLayers with saves).

R=bsalomon@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/185293007

git-svn-id: http://skia.googlecode.com/svn/trunk@13640 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index 0311948..a30cde2 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -97,6 +97,7 @@
     connect(&fSettingsWidget, SIGNAL(texFilterSettingsChanged()), this, SLOT(actionTextureFilter()));
     connect(fSettingsWidget.getRasterCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionRasterWidget(bool)));
     connect(fSettingsWidget.getOverdrawVizCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionOverdrawVizWidget(bool)));
+    connect(fSettingsWidget.getMegaVizCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionMegaVizWidget(bool)));
     connect(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool)));
     connect(&fActionCreateBreakpoint, SIGNAL(activated()), this, SLOT(toggleBreakpoint()));
     connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes()));
@@ -521,6 +522,11 @@
     fCanvasWidget.update();
 }
 
+void SkDebuggerGUI::actionMegaVizWidget(bool isToggled) {
+    fDebugger.setMegaViz(isToggled);
+    fCanvasWidget.update();
+}
+
 void SkDebuggerGUI::actionTextureFilter() {
     SkPaint::FilterLevel level;
     bool enabled = fSettingsWidget.getFilterOverride(&level);
diff --git a/debugger/QT/SkDebuggerGUI.h b/debugger/QT/SkDebuggerGUI.h
index cdda861..50ebfc2 100644
--- a/debugger/QT/SkDebuggerGUI.h
+++ b/debugger/QT/SkDebuggerGUI.h
@@ -142,6 +142,11 @@
     void actionOverdrawVizWidget(bool isToggled);
 
     /**
+        Toggles the the mega visualization on and off
+     */
+    void actionMegaVizWidget(bool isToggled);
+
+    /**
         Applies the new texture filter override
      */
     void actionTextureFilter();
diff --git a/debugger/QT/SkSettingsWidget.cpp b/debugger/QT/SkSettingsWidget.cpp
index dc40b40..29026cf 100644
--- a/debugger/QT/SkSettingsWidget.cpp
+++ b/debugger/QT/SkSettingsWidget.cpp
@@ -62,6 +62,10 @@
     fOverdrawVizLabel.setMinimumWidth(178);
     fOverdrawVizLabel.setMaximumWidth(178);
 
+    fMegaVizLabel.setText("         Mega Viz: ");
+    fMegaVizLabel.setMinimumWidth(178);
+    fMegaVizLabel.setMaximumWidth(178);
+
 #if SK_SUPPORT_GPU
     fGLLabel.setText("OpenGL: ");
     fGLLabel.setMinimumWidth(178);
@@ -109,8 +113,10 @@
     fRasterLayout.addWidget(&fRasterLabel);
     fRasterLayout.addWidget(&fRasterCheckBox);
 
-    fOverdrawVizLayout.addWidget(&fOverdrawVizLabel);
-    fOverdrawVizLayout.addWidget(&fOverdrawVizCheckBox);
+    fVizLayout.addWidget(&fOverdrawVizLabel);
+    fVizLayout.addWidget(&fOverdrawVizCheckBox);
+    fVizLayout.addWidget(&fMegaVizLabel);
+    fVizLayout.addWidget(&fMegaVizCheckBox);
 
 #if SK_SUPPORT_GPU
     fGLLayout.addWidget(&fGLLabel);
@@ -120,7 +126,7 @@
     fCanvasLayout.setSpacing(6);
     fCanvasLayout.setContentsMargins(11,11,11,11);
     fCanvasLayout.addLayout(&fRasterLayout);
-    fCanvasLayout.addLayout(&fOverdrawVizLayout);
+    fCanvasLayout.addLayout(&fVizLayout);
 #if SK_SUPPORT_GPU
     fCanvasLayout.addLayout(&fGLLayout);
     fCanvasLayout.addWidget(&fGLMSAAButtonGroup);
diff --git a/debugger/QT/SkSettingsWidget.h b/debugger/QT/SkSettingsWidget.h
index 2310011..660da77 100644
--- a/debugger/QT/SkSettingsWidget.h
+++ b/debugger/QT/SkSettingsWidget.h
@@ -70,6 +70,10 @@
         return &fOverdrawVizCheckBox;
     }
 
+    QCheckBox* getMegaVizCheckBox() {
+        return &fMegaVizCheckBox;
+    }
+
 private slots:
     void updateCommand(int newCommand);
     void updateHit(int newHit);
@@ -113,9 +117,11 @@
     QLabel fRasterLabel;
     QCheckBox fRasterCheckBox;
 
-    QHBoxLayout fOverdrawVizLayout;
+    QHBoxLayout fVizLayout;
     QLabel fOverdrawVizLabel;
     QCheckBox fOverdrawVizCheckBox;
+    QLabel fMegaVizLabel;
+    QCheckBox fMegaVizCheckBox;
 
 #if SK_SUPPORT_GPU
     QHBoxLayout fGLLayout;
diff --git a/debugger/SkDebugger.h b/debugger/SkDebugger.h
index 182f226..20c4a78 100644
--- a/debugger/SkDebugger.h
+++ b/debugger/SkDebugger.h
@@ -107,6 +107,12 @@
         }
     }
 
+    void setMegaViz(bool megaViz) {
+        if (NULL != fDebugCanvas) {
+            fDebugCanvas->setMegaVizMode(megaViz);
+        }
+    }
+
     void setTexFilterOverride(bool texFilterOverride, SkPaint::FilterLevel level) {
         if (NULL != fDebugCanvas) {
             fDebugCanvas->overrideTexFiltering(texFilterOverride, level);