OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkDebuggerGUI.h" | 8 #include "SkDebuggerGUI.h" |
9 #include "SkPicture.h" | 9 #include "SkPicture.h" |
10 #include <QListWidgetItem> | 10 #include <QListWidgetItem> |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 fDirectoryWidget.addItem(f); | 667 fDirectoryWidget.addItem(f); |
668 } | 668 } |
669 } | 669 } |
670 } | 670 } |
671 | 671 |
672 void SkDebuggerGUI::loadPicture(const SkString& fileName) { | 672 void SkDebuggerGUI::loadPicture(const SkString& fileName) { |
673 fFileName = fileName; | 673 fFileName = fileName; |
674 fLoading = true; | 674 fLoading = true; |
675 SkAutoTDelete<SkStream> stream(new SkFILEStream(fileName.c_str())); | 675 SkAutoTDelete<SkStream> stream(new SkFILEStream(fileName.c_str())); |
676 | 676 |
677 SkPicture* picture = SkPicture::CreateFromStream(stream); | 677 auto picture = SkPicture::MakeFromStream(stream); |
678 | 678 |
679 if (nullptr == picture) { | 679 if (nullptr == picture) { |
680 QMessageBox::critical(this, "Error loading file", "Couldn't read file, s
orry."); | 680 QMessageBox::critical(this, "Error loading file", "Couldn't read file, s
orry."); |
681 return; | 681 return; |
682 } | 682 } |
683 | 683 |
684 fCanvasWidget.resetWidgetTransform(); | 684 fCanvasWidget.resetWidgetTransform(); |
685 fDebugger.loadPicture(picture); | 685 fDebugger.loadPicture(picture.get()); |
686 | 686 |
687 fSkipCommands.setCount(fDebugger.getSize()); | 687 fSkipCommands.setCount(fDebugger.getSize()); |
688 for (int i = 0; i < fSkipCommands.count(); ++i) { | 688 for (int i = 0; i < fSkipCommands.count(); ++i) { |
689 fSkipCommands[i] = false; | 689 fSkipCommands[i] = false; |
690 } | 690 } |
691 | 691 |
692 SkSafeUnref(picture); | 692 picture.reset(); |
693 | 693 |
694 /* fDebugCanvas is reinitialized every load picture. Need it to retain value | 694 /* fDebugCanvas is reinitialized every load picture. Need it to retain value |
695 * of the visibility filter. | 695 * of the visibility filter. |
696 * TODO(chudy): This should be deprecated since fDebugger is not | 696 * TODO(chudy): This should be deprecated since fDebugger is not |
697 * recreated. | 697 * recreated. |
698 * */ | 698 * */ |
699 fDebugger.highlightCurrentCommand(fSettingsWidget.isVisibilityFilterEnabled(
)); | 699 fDebugger.highlightCurrentCommand(fSettingsWidget.isVisibilityFilterEnabled(
)); |
700 | 700 |
701 this->setupListWidget(); | 701 this->setupListWidget(); |
702 this->setupComboBox(); | 702 this->setupComboBox(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 fCanvasWidget.drawTo(fPausedRow); | 795 fCanvasWidget.drawTo(fPausedRow); |
796 } else { | 796 } else { |
797 fCanvasWidget.drawTo(fListWidget.currentRow()); | 797 fCanvasWidget.drawTo(fListWidget.currentRow()); |
798 } | 798 } |
799 } | 799 } |
800 | 800 |
801 void SkDebuggerGUI::updateHit(int newHit) { | 801 void SkDebuggerGUI::updateHit(int newHit) { |
802 fCommandHitBox.setText(QString::number(newHit)); | 802 fCommandHitBox.setText(QString::number(newHit)); |
803 } | 803 } |
804 | 804 |
OLD | NEW |