Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(875)

Issue 7068055: Encode images with DCTDecode (JPEG) in PDFs if it makes sense. Fallback to FlateDecode (zip) if it … (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by edisonn
Modified:
11 years, 7 months ago
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Encode images with DCTDecode (JPEG) in PDFs if it makes sense. Fallback to FlateDecode (zip) if it makes sense. Otherewise include uncompressed stream. This change will reduce the size of PDFs to 50% (in the case of the existing SKPs, we reduce the total size of PDFs from 105MB to 50MB) Committed: https://code.google.com/p/skia/source/detail?r=8835

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 22

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : #

Patch Set 13 : #

Patch Set 14 : #

Patch Set 15 : #

Patch Set 16 : #

Patch Set 17 : #

Patch Set 18 : #

Patch Set 19 : #

Total comments: 55

Patch Set 20 : #

Patch Set 21 : #

Patch Set 22 : #

Patch Set 23 : #

Total comments: 2

Patch Set 24 : #

Patch Set 25 : #

Patch Set 26 : #

Patch Set 27 : #

Patch Set 28 : #

Total comments: 27

Patch Set 29 : #

Patch Set 30 : #

Patch Set 31 : #

Total comments: 24

Patch Set 32 : #

Patch Set 33 : #

Patch Set 34 : #

Total comments: 15

Patch Set 35 : #

Patch Set 36 : #

Total comments: 23

Patch Set 37 : #

Patch Set 38 : #

Patch Set 39 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+361 lines, -163 lines) Patch
M gm/gmmain.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 4 chunks +38 lines, -0 lines 0 comments Download
M gyp/pdf.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +2 lines, -0 lines 0 comments Download
M include/pdf/SkPDFDevice.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 3 chunks +19 lines, -0 lines 0 comments Download
M src/pdf/SkPDFDevice.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +3 lines, -2 lines 0 comments Download
M src/pdf/SkPDFImage.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 4 chunks +6 lines, -4 lines 0 comments Download
M src/pdf/SkPDFImage.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 3 chunks +12 lines, -6 lines 0 comments Download
A + src/pdf/SkPDFImageStream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 1 chunk +24 lines, -46 lines 0 comments Download
A + src/pdf/SkPDFImageStream.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 2 chunks +49 lines, -88 lines 0 comments Download
M src/pdf/SkPDFStream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 1 chunk +32 lines, -11 lines 0 comments Download
M tests/PDFPrimitivesTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 5 chunks +120 lines, -1 line 0 comments Download
M tools/PdfRenderer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 4 chunks +6 lines, -3 lines 0 comments Download
M tools/PdfRenderer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 1 chunk +1 line, -0 lines 0 comments Download
M tools/render_pdfs_main.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 6 chunks +49 lines, -2 lines 0 comments Download

Messages

Total messages: 27
edisonn
11 years, 11 months ago (2013-01-09 14:35:22 UTC) #1
reed1
I love the idea of the feature... we need to be thoughtful as to how ...
11 years, 11 months ago (2013-01-09 15:08:49 UTC) #2
Steve VanDeBogart
This is a pretty invasive change. I think a lot of the modifications can be ...
11 years, 11 months ago (2013-01-09 16:46:49 UTC) #3
Leon
> I love the idea of the feature... we need to be thoughtful as to ...
11 years, 11 months ago (2013-01-09 18:21:57 UTC) #4
edisonn
I am refactoring this, but as I am not aware of all use cases, adding ...
11 years, 10 months ago (2013-01-22 21:24:55 UTC) #5
edisonn
On 2013/01/09 16:46:49, Steve VanDeBogart wrote: > This is a pretty invasive change. I think ...
11 years, 10 months ago (2013-01-22 21:32:16 UTC) #6
Steve VanDeBogart
On 2013/01/22 21:24:55, edisonn wrote: > I am refactoring this, but as I am not ...
11 years, 10 months ago (2013-01-22 23:09:32 UTC) #7
edisonn
Steve, I have not implemented the flags suggested. (actually I did implememted them, but then ...
11 years, 8 months ago (2013-03-27 14:14:15 UTC) #8
Steve VanDeBogart
Looking a lot closer. https://codereview.appspot.com/7068055/diff/43001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): https://codereview.appspot.com/7068055/diff/43001/include/pdf/SkPDFDevice.h#newcode69 include/pdf/SkPDFDevice.h:69: EncodeToDCTStream encoder = NULL); Interesting ...
11 years, 8 months ago (2013-03-27 20:34:54 UTC) #9
Steve VanDeBogart
https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp File src/pdf/SkPDFImageStream.cpp (right): https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp#newcode101 src/pdf/SkPDFImageStream.cpp:101: if (fSrcRect != bitmapBounds) { On 2013/03/27 20:34:55, Steve ...
11 years, 8 months ago (2013-03-27 20:36:57 UTC) #10
edisonn
https://codereview.appspot.com/7068055/diff/43001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): https://codereview.appspot.com/7068055/diff/43001/include/pdf/SkPDFDevice.h#newcode69 include/pdf/SkPDFDevice.h:69: EncodeToDCTStream encoder = NULL); I don't think I want ...
11 years, 8 months ago (2013-03-28 17:09:37 UTC) #11
Steve VanDeBogart
https://codereview.appspot.com/7068055/diff/43001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): https://codereview.appspot.com/7068055/diff/43001/include/pdf/SkPDFDevice.h#newcode69 include/pdf/SkPDFDevice.h:69: EncodeToDCTStream encoder = NULL); Interesting... In general we have ...
11 years, 8 months ago (2013-03-28 19:27:42 UTC) #12
edisonn
https://codereview.appspot.com/7068055/diff/43001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): https://codereview.appspot.com/7068055/diff/43001/include/pdf/SkPDFDevice.h#newcode69 include/pdf/SkPDFDevice.h:69: EncodeToDCTStream encoder = NULL); On 2013/03/28 19:27:42, Steve VanDeBogart ...
11 years, 8 months ago (2013-03-28 21:31:54 UTC) #13
Steve VanDeBogart
https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp File src/pdf/SkPDFImageStream.cpp (right): https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp#newcode114 src/pdf/SkPDFImageStream.cpp:114: fEncoder(&jpegCompressedWStream, *bitmapToUse)) { It will take more time to ...
11 years, 8 months ago (2013-03-29 17:51:23 UTC) #14
edisonn
https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp File src/pdf/SkPDFImageStream.cpp (right): https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp#newcode114 src/pdf/SkPDFImageStream.cpp:114: fEncoder(&jpegCompressedWStream, *bitmapToUse)) { Convert all our SKPs to PDFs ...
11 years, 8 months ago (2013-03-29 18:05:23 UTC) #15
Steve VanDeBogart
https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp File src/pdf/SkPDFImageStream.cpp (right): https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp#newcode114 src/pdf/SkPDFImageStream.cpp:114: fEncoder(&jpegCompressedWStream, *bitmapToUse)) { Data is great! What's the difference ...
11 years, 8 months ago (2013-03-29 18:08:10 UTC) #16
edisonn
https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp File src/pdf/SkPDFImageStream.cpp (right): https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp#newcode114 src/pdf/SkPDFImageStream.cpp:114: fEncoder(&jpegCompressedWStream, *bitmapToUse)) { 51 vs 66 seconds On 2013/03/29 ...
11 years, 8 months ago (2013-03-29 18:41:46 UTC) #17
Steve VanDeBogart
https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp File src/pdf/SkPDFImageStream.cpp (right): https://codereview.appspot.com/7068055/diff/43001/src/pdf/SkPDFImageStream.cpp#newcode114 src/pdf/SkPDFImageStream.cpp:114: fEncoder(&jpegCompressedWStream, *bitmapToUse)) { So 4% improvement on size cost ...
11 years, 8 months ago (2013-03-29 18:45:24 UTC) #18
edisonn
I hope I did not forgot to address any comments. Let me know if I ...
11 years, 8 months ago (2013-04-02 20:28:16 UTC) #19
Steve VanDeBogart
It looks like you missed a bunch of comments. Added the high level ones again, ...
11 years, 8 months ago (2013-04-02 21:01:52 UTC) #20
edisonn
https://codereview.appspot.com/7068055/diff/107001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): https://codereview.appspot.com/7068055/diff/107001/include/pdf/SkPDFDevice.h#newcode23 include/pdf/SkPDFDevice.h:23: typedef bool (*EncodeToDCTStream)(SkWStream*, const SkBitmap&, const SkIRect&); On 2013/04/02 ...
11 years, 8 months ago (2013-04-05 17:20:52 UTC) #21
Steve VanDeBogart
https://codereview.appspot.com/7068055/diff/113002/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): https://codereview.appspot.com/7068055/diff/113002/include/pdf/SkPDFDevice.h#newcode23 include/pdf/SkPDFDevice.h:23: typedef bool (*EncodeToDCTStream)(SkWStream* stream, const SkBitmap& bitmap, const SkIRect& ...
11 years, 8 months ago (2013-04-06 00:41:05 UTC) #22
edisonn
https://codereview.appspot.com/7068055/diff/113002/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): https://codereview.appspot.com/7068055/diff/113002/include/pdf/SkPDFDevice.h#newcode23 include/pdf/SkPDFDevice.h:23: typedef bool (*EncodeToDCTStream)(SkWStream* stream, const SkBitmap& bitmap, const SkIRect& ...
11 years, 8 months ago (2013-04-18 12:48:09 UTC) #23
Steve VanDeBogart
Mostly just nits and one memory question. https://codereview.appspot.com/7068055/diff/113002/src/pdf/SkPDFImageStream.h File src/pdf/SkPDFImageStream.h (right): https://codereview.appspot.com/7068055/diff/113002/src/pdf/SkPDFImageStream.h#newcode55 src/pdf/SkPDFImageStream.h:55: StreamCompression fCompressionType; ...
11 years, 8 months ago (2013-04-18 18:54:26 UTC) #24
edisonn
https://codereview.appspot.com/7068055/diff/151001/gm/gmmain.cpp File gm/gmmain.cpp (right): https://codereview.appspot.com/7068055/diff/151001/gm/gmmain.cpp#newcode177 gm/gmmain.cpp:177: bool encodeToDCTStream(SkWStream* stream, const SkBitmap& bitmap, const SkIRect& rect); ...
11 years, 8 months ago (2013-04-18 20:13:16 UTC) #25
Steve VanDeBogart
LGTM https://codereview.appspot.com/7068055/diff/151001/include/pdf/SkPDFDevice.h File include/pdf/SkPDFDevice.h (right): https://codereview.appspot.com/7068055/diff/151001/include/pdf/SkPDFDevice.h#newcode132 include/pdf/SkPDFDevice.h:132: * @param encoder The encoder to encode a ...
11 years, 8 months ago (2013-04-18 21:49:41 UTC) #26
edisonn
11 years, 7 months ago (2013-04-24 13:01:09 UTC) #27
Message was sent while issue was closed.
Committed patchset #39 manually as r8835 (presubmit successful).
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b