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

Unified Diff: src/doc/SkDocument_PDF.cpp

Issue 1505763003: SkDocument::setDCTEncoder() for old versions of webkit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-12-09 (Wednesday) 13:41:21 EST Created 5 years 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 | « include/core/SkDocument.h ('k') | src/pdf/SkPDFBitmap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/doc/SkDocument_PDF.cpp
diff --git a/src/doc/SkDocument_PDF.cpp b/src/doc/SkDocument_PDF.cpp
index ff7a038b6bf268c9a9b85ba2dbd1da38eb1b5035..fb560ea1e36c8347364747058e0697269b3eaa0c 100644
--- a/src/doc/SkDocument_PDF.cpp
+++ b/src/doc/SkDocument_PDF.cpp
@@ -322,9 +322,12 @@ class SkDocument_PDF : public SkDocument {
public:
SkDocument_PDF(SkWStream* stream,
void (*doneProc)(SkWStream*, bool),
- SkScalar rasterDpi)
+ SkScalar rasterDpi,
+ SkPixelSerializer* jpegEncoder)
: SkDocument(stream, doneProc)
- , fRasterDpi(rasterDpi) {}
+ , fRasterDpi(rasterDpi) {
+ fCanon.fPixelSerializer.reset(SkSafeRef(jpegEncoder));
+ }
virtual ~SkDocument_PDF() {
// subclasses must call close() in their destructors
@@ -386,7 +389,15 @@ private:
///////////////////////////////////////////////////////////////////////////////
SkDocument* SkDocument::CreatePDF(SkWStream* stream, SkScalar dpi) {
- return stream ? new SkDocument_PDF(stream, nullptr, dpi) : nullptr;
+ return stream ? new SkDocument_PDF(stream, nullptr, dpi, nullptr) : nullptr;
+}
+
+SkDocument* SkDocument::CreatePDF(SkWStream* stream,
+ SkScalar dpi,
+ SkPixelSerializer* jpegEncoder) {
+ return stream
+ ? new SkDocument_PDF(stream, nullptr, dpi, jpegEncoder)
+ : nullptr;
}
SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) {
@@ -396,5 +407,5 @@ SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) {
return nullptr;
}
auto delete_wstream = [](SkWStream* stream, bool) { delete stream; };
- return new SkDocument_PDF(stream, delete_wstream, dpi);
+ return new SkDocument_PDF(stream, delete_wstream, dpi, nullptr);
}
« no previous file with comments | « include/core/SkDocument.h ('k') | src/pdf/SkPDFBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698