History log of /external/skia/src/pdf/SkPDFBitmap.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7363e13a07f8b6a9d4ba82ff7b13526f0a89eaee 26-Feb-2016 halcanary <halcanary@google.com> SkPDF: Let client re-encode JPGs if they want to

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1734223003

Review URL: https://codereview.chromium.org/1734223003
/external/skia/src/pdf/SkPDFBitmap.cpp
712fdf7603c62820b21174da9b0a2071c174936b 10-Dec-2015 halcanary <halcanary@google.com> SkDocument::setDCTEncoder() for old versions of webkit

Review URL: https://codereview.chromium.org/1505763003
/external/skia/src/pdf/SkPDFBitmap.cpp
70d1554d8ea08ddb887550f98b9cfd0afd395d65 22-Nov-2015 halcanary <halcanary@google.com> SkPDF: add `final` keyword to leaf classes

Review URL: https://codereview.chromium.org/1461403002
/external/skia/src/pdf/SkPDFBitmap.cpp
80ec3dbf72b596bb00e6f9ded211fd6ac7729b9b 10-Nov-2015 halcanary <halcanary@google.com> SkPDF: Deal with missing ColorTable (don't assert)

Review URL: https://codereview.chromium.org/1414083005
/external/skia/src/pdf/SkPDFBitmap.cpp
aa4ba90792a99eed96ac51006bd478d453a751c4 06-Nov-2015 halcanary <halcanary@google.com> SkPDF: images support 32-but-not-N32 colortype

BUG=550559

Review URL: https://codereview.chromium.org/1407063005
/external/skia/src/pdf/SkPDFBitmap.cpp
34422610ac22adceeabb66023120f27b96cae953 12-Oct-2015 halcanary <halcanary@google.com> SkPDF: Optionally output PDF/A-2b archive format.

Note: this format does not yet pass validation tests.

Add skia_pdf_generate_pdfa GYP flag. Default to off for now.
PDF/A files are not reproducable, so they make correctness
testing harder.

Turn the Metadata struct into te SkPDFMetadata struct. This
splits out a lot of functionality around both kinds of metadata.

When PDF/A is used, add an ID entry to the trailer.

Add SkPDFObjNumMap::addObjectRecursively.

Test with

GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
ninja -C out/Release dm
out/Release/dm --config pdf --src skp gm -w /tmp/dm

With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs
generated from GMs and SKPs render identically in Pdfium.

BUG=skia:3110

Review URL: https://codereview.chromium.org/1394263003
/external/skia/src/pdf/SkPDFBitmap.cpp
21f99b7733c5d468deee9f8dadd59e77ed33d5ca 09-Oct-2015 bungeman <bungeman@google.com> Revert of SkPDF: Optionally output PDF/A-2b archive format. (patchset #5 id:80001 of https://codereview.chromium.org/1394263003/ )

Reason for revert:
SkMD5 is not really part of the Skia library. This is breaking the roll by using it, since Chromium doesn't build it.

Original issue's description:
> SkPDF: Optionally output PDF/A-2b archive format.
>
> Note: this format does not yet pass validation tests.
>
> Add skia_pdf_generate_pdfa GYP flag. Default to off for now.
> PDF/A files are not reproducable, so they make correctness
> testing harder.
>
> Turn the Metadata struct into te SkPDFMetadata struct. This
> splits out a lot of functionality around both kinds of metadata.
>
> When PDF/A is used, add an ID entry to the trailer.
>
> Add SkPDFObjNumMap::addObjectRecursively.
>
> Test with
>
> GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
> ninja -C out/Release dm
> out/Release/dm --config pdf --src skp gm -w /tmp/dm
>
> With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
> SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs
> generated from GMs and SKPs render identically in Pdfium.
>
> BUG=skia:3110
>
> Committed: https://skia.googlesource.com/skia/+/939c0fe51f157104758bcb268643c8b6d317a530

TBR=tomhudson@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3110

Review URL: https://codereview.chromium.org/1398193002
/external/skia/src/pdf/SkPDFBitmap.cpp
939c0fe51f157104758bcb268643c8b6d317a530 09-Oct-2015 halcanary <halcanary@google.com> SkPDF: Optionally output PDF/A-2b archive format.

Note: this format does not yet pass validation tests.

Add skia_pdf_generate_pdfa GYP flag. Default to off for now.
PDF/A files are not reproducable, so they make correctness
testing harder.

Turn the Metadata struct into te SkPDFMetadata struct. This
splits out a lot of functionality around both kinds of metadata.

When PDF/A is used, add an ID entry to the trailer.

Add SkPDFObjNumMap::addObjectRecursively.

Test with

GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
ninja -C out/Release dm
out/Release/dm --config pdf --src skp gm -w /tmp/dm

With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs
generated from GMs and SKPs render identically in Pdfium.

BUG=skia:3110

Review URL: https://codereview.chromium.org/1394263003
/external/skia/src/pdf/SkPDFBitmap.cpp
7a14b310d6c618fa2151d93a43b29f9599adc32a 01-Oct-2015 halcanary <halcanary@google.com> SkPDF: Implement drawImage*() properly

drawImage calls now properly embeds the original jpeg.

NOTE: drawBitmap*() calls no longer embed JPEG files when
possible (this is in advance of eliminating bitmaps backed
by encoded data). Chromium has already moved from
drawBitmap to drawImage.

Comparisons:

control:
total PDF drawImage/drawBitmap calls: 8010
total PDF jpeg images: 0
total PDF regular images: 3581

experiament:
total PDF drawImage/drawBitmap calls: 8014
total PDF jpeg images: 271
total PDF regular images: 3311
total PDF regular images: 3582 (271 + 3311)

When comparing rendered output there were perceptual
differences in the following four GMs: colorcube, emboss,
colormatrix, and tablecolorfilter. All of these differences
were improvements (that is, closer to the 8888 rendering)
due fixing a bug with colorfilters and forgetting to call
notifyPixelsChanged.

No SKPs had perceptual differences.

Total PDF size dropped from 133964 kB to 126276 kB, a 5.7%
improvement (mostly due to restoring use of JPG images in
SKPs).

BUG=skia:4370

Review URL: https://codereview.chromium.org/1372783003
/external/skia/src/pdf/SkPDFBitmap.cpp
96fcdcc219d2a0d3579719b84b28bede76efba64 27-Aug-2015 halcanary <halcanary@google.com> Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
/external/skia/src/pdf/SkPDFBitmap.cpp
385fe4d4b62d7d1dd76116dd570df3290a2f487b 26-Aug-2015 halcanary <halcanary@google.com> Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
/external/skia/src/pdf/SkPDFBitmap.cpp
a060eba0836f98902ca078d5f9fc6191ba0c0a52 19-Aug-2015 halcanary <halcanary@google.com> SkPDF: Simplify PDFStream / emitObject() const

Compress SkPDFStream's data on setData(), not emitObject(); no longer stateful.

SkPDFObject::emitObject is now const. This makes it easier to reason about state.

Minimal performance gains.

Review URL: https://codereview.chromium.org/1304493002
/external/skia/src/pdf/SkPDFBitmap.cpp
d9e57158ebd9b1f8317f0d76ef0402cfce0b0253 12-Aug-2015 halcanary <halcanary@google.com> SkPDF: Move SkFlate into src/pdf (part 1/3) [reland]

Rename to SkDeflate so Chromium builders continue to work

Next, we change remove SkFlate from Chromium build files, then we can delete SkFlate.

Review URL: https://codereview.chromium.org/1285913002
/external/skia/src/pdf/SkPDFBitmap.cpp
96287f7af7ff6aaa48b8d28ec6b7b79836da2d7c 07-May-2015 halcanary <halcanary@google.com> SkPDF: detect YUV-JPEG without relying on ImageGenerator

JPEG/JFIF References:
* http://www.w3.org/Graphics/JPEG/itu-t81.pdf
* http://www.w3.org/Graphics/JPEG/jfif3.pdf

BUG=476721
BUG=446940

Review URL: https://codereview.chromium.org/1133443003
/external/skia/src/pdf/SkPDFBitmap.cpp
a25b3371a7209105e6c05f7bbb53d19e2b14498b 27-Apr-2015 halcanary <halcanary@google.com> SkPDF: clean up uses of deprecated calls in other SkPDF classes

BUG=skia:3585

Review URL: https://codereview.chromium.org/1107923002
/external/skia/src/pdf/SkPDFBitmap.cpp
a8448bc3dfe0f2e768838b4416fb3ebf823b694e 17-Apr-2015 halcanary <halcanary@google.com> PDF: Correctly embed JPEG images directly into PDF output.

We only embed images with YUV planes. That should only grab the
subset of color JPEGs supported by PDF.

BUG=skia:3180

Review URL: https://codereview.chromium.org/1025773002
/external/skia/src/pdf/SkPDFBitmap.cpp
37c46cad21632cfc1411b08d73af37a1fffe2944 31-Mar-2015 halcanary <halcanary@google.com> SkPDF: Factor SkPDFCatalog into SkPDFObjNumMap and SkPDFSubstituteMap

Motivation: Keep separate features separate. Also, future
linearization work will need to have several objNumMap
objects share a substituteMap. Also "catalog" has a
specific meaning in PDF. This catalog did not map to that
catalog.

- Modify SkPDFObject::emitObject and SkPDFObject::addResources
interface to requiore SkPDFObjNumMap and SkPDFSubstituteMap.
- SkPDFObjNumMap const in SkPDFObject::emitObject.
- Remove SkPDFCatalog.cpp/.h
- Modify SkDocument_PDF.cpp to use new functions
- Fold in SkPDFStream::populate
- Fold in SkPDFBitmap::emitDict
- Move SkPDFObjNumMap and SkPDFSubstituteMap to SkPDFTypes.h
- Note (via assert) that SkPDFArray & SkPDFDict don't need to
check substitutes.
- Remove extra space from SkPDFDict serialization.
- SkPDFBitmap SkPDFType0Font SkPDFGraphicState SkPDFStream
updated to new interface.
- PDFPrimitivesTest updated for new interface.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1049753002
/external/skia/src/pdf/SkPDFBitmap.cpp
36352bf5e38f45a70ee4f4fc132a38048d38206d 26-Mar-2015 mtklein <mtklein@chromium.org> C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}

NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
/external/skia/src/pdf/SkPDFBitmap.cpp
d4714af018158c15e13439bef2c9b5bafc25c1d7 25-Mar-2015 halcanary <halcanary@google.com> SkPDF SkPDFObject::addResources signature simplified

- SkPDFcatalog keeps a ordered list of object pointers
- Elimiante SkTSet template class
- SkPDFObject::addResources signature changes

BUG=skia:3585

Review URL: https://codereview.chromium.org/1038523004
/external/skia/src/pdf/SkPDFBitmap.cpp
db0dcc7436375e5d59c27f9011f09b64de407c9d 20-Mar-2015 halcanary <halcanary@google.com> PDF: remove last use of SkPDFImage

Add a GM.

BUG=skia:255

Review URL: https://codereview.chromium.org/950633003
/external/skia/src/pdf/SkPDFBitmap.cpp
1b600d3446b3d236bfa06cf116ec41960bea6ac8 20-Mar-2015 reed <reed@google.com> Revert of PDF: remove last use of SkPDFImage (patchset #5 id:120001 of https://codereview.chromium.org/950633003/)

Reason for revert:
static void draw(SkCanvas* canvas,
const SkPaint& p,
const SkBitmap& src,
SkColorType colorType,
const char text[]) {
SkASSERT(src.colorType() == colorType);
canvas->drawBitmap(src, 0.0f, 0.0f);
canvas->drawText(text, strlen(text), 0.0f, 12.0f, p);
}

This assert is firing, at least on macs, where all images get decoded into 32bit at the moment.

Original issue's description:
> PDF: remove last use of SkPDFImage
>
> Add a GM.
>
> BUG=skia:255
>
> Committed: https://skia.googlesource.com/skia/+/86ad8d643624a55b02e529100bbe4e2940115fa1

TBR=mtklein@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:255

Review URL: https://codereview.chromium.org/1024113002
/external/skia/src/pdf/SkPDFBitmap.cpp
86ad8d643624a55b02e529100bbe4e2940115fa1 20-Mar-2015 halcanary <halcanary@google.com> PDF: remove last use of SkPDFImage

Add a GM.

BUG=skia:255

Review URL: https://codereview.chromium.org/950633003
/external/skia/src/pdf/SkPDFBitmap.cpp
3d32d50364d1b63777fbf05c3593a35601bde9e2 01-Mar-2015 halcanary <halcanary@google.com> PDF: Switch some unit tests to higher level API.

Also, clean up some headers.

Review URL: https://codereview.chromium.org/968683002
/external/skia/src/pdf/SkPDFBitmap.cpp
2e3f9d8a9309686eeb4c76ccfde5800da87a68b3 27-Feb-2015 halcanary <halcanary@google.com> PDF: Canon now owns a reference to all interned objects

Add SkPDFCanon::reset function to unref all objects.

No longer possible to remove object from canon

Motivation: this doesn't change these object's lifetime, (they will
still be fully unrefed when SkDocument::close() is called, but we no
longer have to remove them from the array when their destructor is
called.

Review URL: https://codereview.chromium.org/966863002
/external/skia/src/pdf/SkPDFBitmap.cpp
e6cf9cb68511ff08156f834859db39232eb37be8 26-Feb-2015 mtklein <mtklein@chromium.org> miniz support in SkFlate / PDF
- Adds miniz.c v115_r4 (latest release) to third_party.
- Merges SkDeflateWStream into SkFlate so including "miniz.c" links
without duplicating symbols.

The only interesting code change I've made is to remove the line
fImpl->fZStream.data_type = Z_BINARY;
from SkDeflateWStream::SkDeflateWStream(). miniz doesn't have Z_BINARY
defined, and as far as I can tell, both zlib and miniz ignore data_type.

We should be able to swap skflate.gyp's dependency between zlib.gyp:zlib and
zlib.gyp:miniz at will (except of course on Windows) if we're interested in
zlib itself. I've left android framework on its own zlib. I think this all
means we can stop defining SK_NO_FLATE on Windows.

I'll leave the possible cleanup of SK_NO_FLATE itself for another time. Might
be we always want to keep this dependency optional.

CQ_EXTRA_TRYBOTS=client.skia:Test-Win8-ShuttleA-HD7770-x86-Debug-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/957323003
/external/skia/src/pdf/SkPDFBitmap.cpp
792c80f5a7b66e75d42664ccb298f31962c6654c 20-Feb-2015 halcanary <halcanary@google.com> PDF: Now threadsafe!

The PDF canvas is now just as threadsafe as any other Skia canvas.

DM updated to thread PDF tests.

SkDocument_PDF now owns SkPDFCanon, and pointers to that canon are
passed around to all classes that need access to the canon.

BUG=skia:2683

Review URL: https://codereview.chromium.org/944643002
/external/skia/src/pdf/SkPDFBitmap.cpp
cabc08c4296e1ce6c6d9d84cf702361cf439c1bc 19-Feb-2015 mtklein <mtklein@chromium.org> PDF: why do we have flags no one uses (or can use)?

BUG=skia:

Review URL: https://codereview.chromium.org/936403002
/external/skia/src/pdf/SkPDFBitmap.cpp
1b5c604d9d344537941b11b136348edfc39f236c 18-Feb-2015 halcanary <halcanary@google.com> PDF: Add (low-memory) SkPDFBitmap class

Also: Add SkDeflateWStream and associated unit tests.

SkPDFBitmap is a replacement for SkPDFImage. As of now, it only
supports 8888 bitmaps (the most common case).

SkPDFBitmap takes very little extra memory (aside from refing the
bitmap's pixels), and its emitObject() does not cache any data.

The SkPDFBitmap::Create function will check the canon for duplicates.
This can reduce the size of the output PDF.

Motivation: this gives another ~40% decrease in PDF memory overhead

TODO: Support other ColorTypes and scrap SkPDFImage.

BUG=skia:3030

Review URL: https://codereview.chromium.org/918813002
/external/skia/src/pdf/SkPDFBitmap.cpp