aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'debugger')
-rw-r--r--debugger/QT/SkDebuggerGUI.cpp4
-rw-r--r--debugger/SkDebugger.cpp13
-rw-r--r--debugger/SkDebugger.h2
3 files changed, 11 insertions, 8 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index 058cb5c10c..812ce0300e 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -555,7 +555,9 @@ void SkDebuggerGUI::drawComplete() {
void SkDebuggerGUI::saveToFile(const SkString& filename) {
SkFILEWStream file(filename.c_str());
- fDebugger.makePicture()->serialize(&file);
+ SkAutoTUnref<SkPicture> copy(fDebugger.copyPicture());
+
+ copy->serialize(&file);
}
void SkDebuggerGUI::loadFile(QListWidgetItem *item) {
diff --git a/debugger/SkDebugger.cpp b/debugger/SkDebugger.cpp
index 7934c736c0..caa361e2d8 100644
--- a/debugger/SkDebugger.cpp
+++ b/debugger/SkDebugger.cpp
@@ -34,11 +34,12 @@ void SkDebugger::loadPicture(SkPicture* picture) {
SkRefCnt_SafeAssign(fPicture, picture);
}
-SkPicture* SkDebugger::makePicture() {
- SkSafeUnref(fPicture);
- fPicture = new SkPicture();
- SkCanvas* canvas = fPicture->beginRecording(fPictureWidth, fPictureHeight);
+SkPicture* SkDebugger::copyPicture() {
+ // We can't just call clone here since we want to removed the "deleted"
+ // commands. Playing back will strip those out.
+ SkPicture* newPicture = new SkPicture;
+ SkCanvas* canvas = newPicture->beginRecording(fPictureWidth, fPictureHeight);
fDebugCanvas->draw(canvas);
- fPicture->endRecording();
- return fPicture;
+ newPicture->endRecording();
+ return newPicture;
}
diff --git a/debugger/SkDebugger.h b/debugger/SkDebugger.h
index 0e3906e036..6b85de35b3 100644
--- a/debugger/SkDebugger.h
+++ b/debugger/SkDebugger.h
@@ -60,7 +60,7 @@ public:
void loadPicture(SkPicture* picture);
- SkPicture* makePicture();
+ SkPicture* copyPicture();
int getSize() {
return fDebugCanvas->getSize();