Always read .skp files and other serialized pictures into SkRecord.
authormtklein <mtklein@chromium.org>
Wed, 20 Aug 2014 22:50:45 +0000 (15:50 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 20 Aug 2014 22:50:46 +0000 (15:50 -0700)
This should switch all our internal tools that aren't clever about it over to SkRecord pictures.  (The clever tools know what they're doing.)

Also, deletes the old SkPicture::clone() path.  return this or die.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/7b705bb17e09508e3761b54f59833b1ceb4ce9a6

R=robertphillips@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/481743003

src/core/SkPicture.cpp

index 469a2083a7d1cb92882d8a3abf0b3ee287a5af8b..70c1f67e19254209ef681dd6568f540bfbb20399 100644 (file)
@@ -431,7 +431,8 @@ SkPicture* SkPicture::CreateFromStream(SkStream* stream, InstallPixelRefProc pro
         if (NULL == data) {
             return NULL;
         }
-        return Forwardport(SkPicture(data, info.fWidth, info.fHeight));
+        const SkPicture src(data, info.fWidth, info.fHeight);
+        return Forwardport(src);
     }
 
     return NULL;
@@ -451,7 +452,8 @@ SkPicture* SkPicture::CreateFromBuffer(SkReadBuffer& buffer) {
         if (NULL == data) {
             return NULL;
         }
-        return Forwardport(SkPicture(data, info.fWidth, info.fHeight));
+        const SkPicture src(data, info.fWidth, info.fHeight);
+        return Forwardport(src);
     }
 
     return NULL;