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

Unified Diff: debugger/QT/SkDrawCommandGeometryWidget.cpp

Issue 835903002: debugger: Update inspector view data consistently while paused (Closed) Base URL: https://skia.googlesource.com/skia.git@debugger-small-things-02-debuggergui-redundant-variables
Patch Set: address review commits 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/SkDrawCommandGeometryWidget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debugger/QT/SkDrawCommandGeometryWidget.cpp
diff --git a/debugger/QT/SkDrawCommandGeometryWidget.cpp b/debugger/QT/SkDrawCommandGeometryWidget.cpp
index 1172e7952d5f3acffca4fa5ac18299e210c3f77a..03572cfdd1ad3f833153ace92b526b19e5b748d8 100644
--- a/debugger/QT/SkDrawCommandGeometryWidget.cpp
+++ b/debugger/QT/SkDrawCommandGeometryWidget.cpp
@@ -13,7 +13,8 @@
SkDrawCommandGeometryWidget::SkDrawCommandGeometryWidget(SkDebugger *debugger)
: QFrame()
- , fDebugger(debugger) {
+ , fDebugger(debugger)
+ , fCommandIndex(-1) {
this->setStyleSheet("QFrame {background-color: black; border: 1px solid #cccccc;}");
}
@@ -65,6 +66,11 @@ void SkDrawCommandGeometryWidget::paintEvent(QPaintEvent* event) {
}
}
+void SkDrawCommandGeometryWidget::setDrawCommandIndex(int commandIndex) {
+ fCommandIndex = commandIndex;
+ this->updateImage();
+}
+
void SkDrawCommandGeometryWidget::updateImage() {
if (!fSurface) {
return;
@@ -72,8 +78,9 @@ void SkDrawCommandGeometryWidget::updateImage() {
bool didRender = false;
const SkTDArray<SkDrawCommand*>& commands = fDebugger->getDrawCommands();
- if (0 != commands.count()) {
- SkDrawCommand* command = commands[fDebugger->index()];
+ if (0 != commands.count() && fCommandIndex >= 0) {
+ SkASSERT(commands.count() > fCommandIndex);
+ SkDrawCommand* command = commands[fCommandIndex];
didRender = command->render(fSurface->getCanvas());
}
@@ -82,5 +89,5 @@ void SkDrawCommandGeometryWidget::updateImage() {
}
fSurface->getCanvas()->flush();
- update();
+ this->update();
}
« no previous file with comments | « debugger/QT/SkDrawCommandGeometryWidget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698