aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger/SkDebugger.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-22 18:03:56 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-22 18:03:56 +0000
commit25bc2f86c2b94ee1f0921d90e6629d8cb22f69b7 (patch)
tree94e43bd37cdf0e6b319fe30dec2a8ed5b5f1b4b6 /debugger/SkDebugger.cpp
parent3f5ecd6cb417c7adf256e48ef3f336052d326b84 (diff)
Fix saving modified skp from debugger
Diffstat (limited to 'debugger/SkDebugger.cpp')
-rw-r--r--debugger/SkDebugger.cpp13
1 files changed, 7 insertions, 6 deletions
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;
}