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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/doc/SkDocument_PDF.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkDocument_DEFINED 8 #ifndef SkDocument_DEFINED
9 #define SkDocument_DEFINED 9 #define SkDocument_DEFINED
10 10
11 #include "SkBitmap.h" 11 #include "SkBitmap.h"
12 #include "SkPicture.h" 12 #include "SkPicture.h"
13 #include "SkRect.h" 13 #include "SkRect.h"
14 #include "SkRefCnt.h" 14 #include "SkRefCnt.h"
15 #include "SkString.h" 15 #include "SkString.h"
16 #include "SkTime.h" 16 #include "SkTime.h"
17 17
18 class SkCanvas; 18 class SkCanvas;
19 class SkPixelSerializer;
19 class SkWStream; 20 class SkWStream;
20 21
21 /** SK_ScalarDefaultDPI is 72 DPI. 22 /** SK_ScalarDefaultDPI is 72 DPI.
22 */ 23 */
23 #define SK_ScalarDefaultRasterDPI 72.0f 24 #define SK_ScalarDefaultRasterDPI 72.0f
24 25
25 /** 26 /**
26 * High-level API for creating a document-based canvas. To use.. 27 * High-level API for creating a document-based canvas. To use..
27 * 28 *
28 * 1. Create a document, specifying a stream to store the output. 29 * 1. Create a document, specifying a stream to store the output.
(...skipping 22 matching lines...) Expand all
51 * for larger PDF files too, which would use more memory 52 * for larger PDF files too, which would use more memory
52 * while rendering, and it would be slower to be processed 53 * while rendering, and it would be slower to be processed
53 * or sent online or to printer. 54 * or sent online or to printer.
54 * @returns NULL if there is an error, otherwise a newly created 55 * @returns NULL if there is an error, otherwise a newly created
55 * PDF-backed SkDocument. 56 * PDF-backed SkDocument.
56 */ 57 */
57 static SkDocument* CreatePDF(SkWStream*, 58 static SkDocument* CreatePDF(SkWStream*,
58 SkScalar dpi = SK_ScalarDefaultRasterDPI); 59 SkScalar dpi = SK_ScalarDefaultRasterDPI);
59 60
60 /** 61 /**
62 * @param jpegEncoder For PDF documents, if a jpegEncoder is set,
63 * use it to encode SkImages and SkBitmaps as [JFIF]JPEGs.
64 * This feature is deprecated and is only supplied for
65 * backwards compatability.
66 *
67 * The prefered method to create PDFs with JPEG images is
68 * to use SkImage::NewFromEncoded() and not jpegEncoder.
69 * Chromium uses NewFromEncoded.
70 *
71 * If the encoder is unset, or if jpegEncoder->onEncode()
72 * returns NULL, fall back on encoding images losslessly
73 * with Deflate.
74 */
75 static SkDocument* CreatePDF(SkWStream*,
76 SkScalar dpi,
77 SkPixelSerializer* jpegEncoder);
78
79 /**
61 * Create a PDF-backed document, writing the results into a file. 80 * Create a PDF-backed document, writing the results into a file.
62 */ 81 */
63 static SkDocument* CreatePDF(const char outputFilePath[], 82 static SkDocument* CreatePDF(const char outputFilePath[],
64 SkScalar dpi = SK_ScalarDefaultRasterDPI); 83 SkScalar dpi = SK_ScalarDefaultRasterDPI);
65 84
66 /** 85 /**
67 * Create a XPS-backed document, writing the results into the stream. 86 * Create a XPS-backed document, writing the results into the stream.
68 * Returns NULL if XPS is not supported. 87 * Returns NULL if XPS is not supported.
69 */ 88 */
70 static SkDocument* CreateXPS(SkWStream* stream, 89 static SkDocument* CreateXPS(SkWStream* stream,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 177
159 private: 178 private:
160 SkWStream* fStream; 179 SkWStream* fStream;
161 void (*fDoneProc)(SkWStream*, bool aborted); 180 void (*fDoneProc)(SkWStream*, bool aborted);
162 State fState; 181 State fState;
163 182
164 typedef SkRefCnt INHERITED; 183 typedef SkRefCnt INHERITED;
165 }; 184 };
166 185
167 #endif 186 #endif
OLDNEW
« no previous file with comments | « no previous file | src/doc/SkDocument_PDF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698