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

Side by Side Diff: debugger/QT/SkDebuggerGUI.cpp

Issue 1811703002: return pictures as sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rely on RVO in picturerecorder Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « bench/nanobench.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698