Fix debugger crash when SK_PICTURE_PROFILING_STUBS isn't defined
authorrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Nov 2012 16:33:31 +0000 (16:33 +0000)
committerrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Nov 2012 16:33:31 +0000 (16:33 +0000)
https://codereview.appspot.com/6850060/

git-svn-id: http://skia.googlecode.com/svn/trunk@6433 2bbb7eff-a529-9590-31e7-b0007b416f81

debugger/QT/SkDebuggerGUI.cpp

index 6ad4805..994bb3f 100644 (file)
@@ -840,7 +840,12 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) {
     // Will this automatically clear out due to nature of refcnt?
     SkTDArray<SkString*>* commands = fDebugger.getDrawCommands();
 
-    SkASSERT(commands->count() == fOffsets.count());
+    // If SkPicturePlayback is compiled w/o SK_PICTURE_PROFILING_STUBS
+    // the offset count will always be zero
+    SkASSERT(0 == fOffsets.count() || commands->count() == fOffsets.count());
+    if (0 == fOffsets.count()) {
+        fActionProfile.setDisabled(true);
+    }
 
     /* fDebugCanvas is reinitialized every load picture. Need it to retain value
      * of the visibility filter.