(disabled) option to re-record a picture when loading
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 31 Aug 2012 13:32:47 +0000 (13:32 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 31 Aug 2012 13:32:47 +0000 (13:32 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@5366 2bbb7eff-a529-9590-31e7-b0007b416f81

samplecode/SamplePictFile.cpp

index 555732fdbba6294b6ec4762fb7debadb6c5a5a7b..3c1462e8f11fbe5cf628974723408fa6a5f0c5db 100644 (file)
@@ -47,6 +47,17 @@ class PictFileView : public SampleView {
             if (stream.isValid()) {
                 pic = SkNEW_ARGS(SkPicture, (&stream));
             }
+            
+            if (false) { // re-record
+                SkPicture p2;
+                pic->draw(p2.beginRecording(pic->width(), pic->height()));
+                p2.endRecording();
+                
+                SkString path2(path);
+                path2.append(".new.skp");
+                SkFILEWStream writer(path2.c_str());
+                p2.serialize(&writer);
+            }
         }
         return pic;
     }