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

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: rename a function 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
« debugger/QT/SkDebuggerGUI.cpp ('K') | « 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..058e541c9fae367773abcf38e16283cc8722165a 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;
robertphillips 2015/01/05 19:14:09 this-> ?
Kimmo Kinnunen 2015/01/07 07:33:48 Done.
+ 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());
}
« debugger/QT/SkDebuggerGUI.cpp ('K') | « debugger/QT/SkDrawCommandGeometryWidget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698