Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1405)

Unified Diff: debugger/QT/SkDebuggerGUI.cpp

Issue 839743003: debugger: SW rasterize the picture only when it changes (Closed) Base URL: https://skia.googlesource.com/skia.git@debugcanvas-stateless-draw-01-no-resize
Patch Set: address review comment Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « debugger/QT/SkDebuggerGUI.h ('k') | debugger/QT/SkDrawCommandGeometryWidget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debugger/QT/SkDebuggerGUI.cpp
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index dade56768d59049b862e8dc4f7f233cb55e5c33f..9e212981a786751393832bdd42b4f6ff8f54e94e 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -6,12 +6,12 @@
*/
#include "SkDebuggerGUI.h"
-#include "SkForceLinking.h"
-#include <QListWidgetItem>
#include "PictureRenderer.h"
+#include "SkPictureData.h"
#include "SkPicturePlayback.h"
#include "SkPictureRecord.h"
-#include "SkPictureData.h"
+#include <QListWidgetItem>
+#include <QtGui>
#if defined(SK_BUILD_FOR_WIN32)
#include "SysTimer_windows.h"
@@ -217,11 +217,7 @@ void SkDebuggerGUI::actionClearDeletes() {
fDebugger.setCommandVisible(row, true);
fSkipCommands[row] = false;
}
- if (this->isPaused()) {
- fCanvasWidget.drawTo(fPausedRow);
- } else {
- fCanvasWidget.drawTo(fListWidget.currentRow());
- }
+ this->updateImage();
}
void SkDebuggerGUI::actionClose() {
@@ -248,13 +244,7 @@ void SkDebuggerGUI::actionDelete() {
}
}
- int currentRow = fListWidget.currentRow();
-
- if (this->isPaused()) {
- fCanvasWidget.drawTo(fPausedRow);
- } else {
- fCanvasWidget.drawTo(currentRow);
- }
+ this->updateImage();
}
#if SK_SUPPORT_GPU
@@ -291,14 +281,14 @@ void SkDebuggerGUI::actionRasterSettingsChanged() {
fCanvasWidget.setWidgetVisibility(SkCanvasWidget::kRaster_8888_WidgetType,
!fSettingsWidget.isRasterEnabled());
fDebugger.setOverdrawViz(fSettingsWidget.isOverdrawVizEnabled());
- fCanvasWidget.update();
+ this->updateImage();
}
void SkDebuggerGUI::actionVisualizationsChanged() {
fDebugger.setMegaViz(fSettingsWidget.isMegaVizEnabled());
fDebugger.setPathOps(fSettingsWidget.isPathOpsEnabled());
fDebugger.highlightCurrentCommand(fSettingsWidget.isVisibilityFilterEnabled());
- fCanvasWidget.drawTo(fListWidget.currentRow());
+ this->updateImage();
}
void SkDebuggerGUI::actionTextureFilter() {
@@ -357,6 +347,10 @@ void SkDebuggerGUI::actionStepForward() {
}
void SkDebuggerGUI::drawComplete() {
+ SkString clipStack;
+ fDebugger.getClipStackText(&clipStack);
+ fInspectorWidget.setText(clipStack.c_str(), SkInspectorWidget::kClipStack_TabType);
+
fInspectorWidget.setMatrix(fDebugger.getCurrentMatrix());
fInspectorWidget.setClip(fDebugger.getCurrentClip());
}
@@ -398,9 +392,7 @@ void SkDebuggerGUI::openFile(const QString &filename) {
void SkDebuggerGUI::pauseDrawing(bool isPaused) {
fPausedRow = fListWidget.currentRow();
- if (!fLoading) {
- fCanvasWidget.drawTo(fPausedRow);
- }
+ this->updateDrawCommandInfo();
}
void SkDebuggerGUI::updateDrawCommandInfo() {
@@ -414,9 +406,8 @@ void SkDebuggerGUI::updateDrawCommandInfo() {
fCurrentCommandBox.setText("");
fDrawCommandGeometryWidget.setDrawCommandIndex(-1);
} else {
- if (!this->isPaused()) {
- fCanvasWidget.drawTo(currentRow);
- }
+ this->updateImage();
+
const SkTDArray<SkString*> *currInfo = fDebugger.getCommandInfo(currentRow);
/* TODO(chudy): Add command type before parameters. Rename v
@@ -431,10 +422,6 @@ void SkDebuggerGUI::updateDrawCommandInfo() {
fInspectorWidget.setText(info, SkInspectorWidget::kDetail_TabType);
}
- SkString clipStack;
- fDebugger.getClipStackText(&clipStack);
- fInspectorWidget.setText(clipStack.c_str(), SkInspectorWidget::kClipStack_TabType);
-
fCurrentCommandBox.setText(QString::number(currentRow));
fDrawCommandGeometryWidget.setDrawCommandIndex(currentRow);
@@ -862,6 +849,14 @@ void SkDebuggerGUI::setupComboBox() {
firstItem->setSelectable(false);
}
+void SkDebuggerGUI::updateImage() {
+ if (this->isPaused()) {
+ fCanvasWidget.drawTo(fPausedRow);
+ } else {
+ fCanvasWidget.drawTo(fListWidget.currentRow());
+ }
+}
+
void SkDebuggerGUI::updateHit(int newHit) {
fCommandHitBox.setText(QString::number(newHit));
}
« no previous file with comments | « debugger/QT/SkDebuggerGUI.h ('k') | debugger/QT/SkDrawCommandGeometryWidget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698