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

Unified Diff: dm/DMPDFRasterizeTask.cpp

Issue 502193002: SkData to SkStreamAsset to avoid unneeded copying (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Another Patch Set Created 6 years, 4 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 | « dm/DMPDFRasterizeTask.h ('k') | dm/DMPDFTask.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMPDFRasterizeTask.cpp
diff --git a/dm/DMPDFRasterizeTask.cpp b/dm/DMPDFRasterizeTask.cpp
index 43be6e5805b5a2ea08d56b68ed0abeccfa9f5881..40b9d8bfbca8788dcfea37b256a9968de66bd99e 100644
--- a/dm/DMPDFRasterizeTask.cpp
+++ b/dm/DMPDFRasterizeTask.cpp
@@ -16,18 +16,20 @@
namespace DM {
PDFRasterizeTask::PDFRasterizeTask(const Task& parent,
- SkData* pdf,
+ SkStreamAsset* pdf,
RasterizePdfProc proc)
: CpuTask(parent)
, fName(UnderJoin(parent.name().c_str(), "rasterize"))
- , fPdf(SkRef(pdf))
- , fRasterize(proc) {}
+ , fPdf(pdf)
+ , fRasterize(proc) {
+ SkASSERT(fPdf.get());
+ SkASSERT(fPdf->unique());
+}
void PDFRasterizeTask::draw() {
- SkMemoryStream pdfStream(fPdf.get());
SkBitmap bitmap;
- if (fRasterize(&pdfStream, &bitmap)) {
+ if (fRasterize(fPdf.get(), &bitmap)) {
this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap)));
} else {
this->fail();
« no previous file with comments | « dm/DMPDFRasterizeTask.h ('k') | dm/DMPDFTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698