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

Unified Diff: include/core/SkDocument.h

Issue 1505763003: SkDocument::setDCTEncoder() for old versions of webkit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove compile flag; unit test 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 | « no previous file | src/doc/SkDocument_PDF.cpp » ('j') | tests/PDFDocumentTest.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDocument.h
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h
index 316d15a253429ea07c7b40e102a8e22f36e8e6d8..8a797ca6a5d0193d956bf30492d9601041bf4a94 100644
--- a/include/core/SkDocument.h
+++ b/include/core/SkDocument.h
@@ -16,6 +16,8 @@
#include "SkTime.h"
class SkCanvas;
+class SkData;
+class SkPixmap;
class SkWStream;
/** SK_ScalarDefaultDPI is 72 DPI.
@@ -133,6 +135,21 @@ public:
const SkTime::DateTime* /* creationDate */,
const SkTime::DateTime* /* modifiedDate */) {}
+ /**
+ * For PDF documents, if a DCTEncoder (discrete cosine transform)
+ * is set, use it to encode SkImages and SkBitmaps as [JFIF]JPEGs.
+ * This feature is deprecated and is only supplied for backwards
+ * compatability.
+ *
+ * The prefered method to create PDFs with JPEG images is to use
+ * SkImage::NewFromEncoded() and not setDCTEncoder(). Chromium
+ * uses NewFromEncoded.
+ *
+ * If the encoder is unset, or if it returns NULL, fall back on
+ * encoding images with Deflate.
+ */
+ virtual void setDCTEncoder(SkData* (*)(const SkPixmap&)) {}
+
protected:
SkDocument(SkWStream*, void (*)(SkWStream*, bool aborted));
« no previous file with comments | « no previous file | src/doc/SkDocument_PDF.cpp » ('j') | tests/PDFDocumentTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698