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

Unified Diff: dm/DMSrcSink.cpp

Issue 947103005: Revert of DM: lazy decoding on SKP playback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMSrcSink.cpp
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index fe01748fe298990efd2079653891f8c127978331..b44f1d78180e94e9d9f5505789024e5db42c4007 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1,9 +1,7 @@
#include "DMSrcSink.h"
#include "SamplePipeControllers.h"
#include "SkCommonFlags.h"
-#include "SkData.h"
#include "SkDocument.h"
-#include "SkImageGenerator.h"
#include "SkMultiPictureDraw.h"
#include "SkNullCanvas.h"
#include "SkOSFile.h"
@@ -12,11 +10,6 @@
#include "SkSVGCanvas.h"
#include "SkStream.h"
#include "SkXMLWriter.h"
-
-static bool lazy_decode_bitmap(const void* src, size_t size, SkBitmap* dst) {
- SkAutoTUnref<SkData> encoded(SkData::NewWithCopy(src, size));
- return encoded && SkInstallDiscardablePixelRef(encoded, dst);
-}
namespace DM {
@@ -121,7 +114,7 @@
if (!stream) {
return SkStringPrintf("Couldn't read %s.", fPath.c_str());
}
- SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream, &lazy_decode_bitmap));
+ SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream));
if (!pic) {
return SkStringPrintf("Couldn't decode %s as a picture.", fPath.c_str());
}
@@ -386,7 +379,7 @@
SkDynamicMemoryWStream wStream;
pic->serialize(&wStream);
SkAutoTDelete<SkStream> rStream(wStream.detachAsStream());
- SkAutoTUnref<SkPicture> deserialized(SkPicture::CreateFromStream(rStream, &lazy_decode_bitmap));
+ SkAutoTUnref<SkPicture> deserialized(SkPicture::CreateFromStream(rStream));
// Turn that deserialized picture into a Src, draw it into our Sink to fill bitmap or stream.
struct ProxySrc : public Src {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698