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()); |
} |