History log of /external/skia/src/pdf/SkPDFBitmap.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b8d6af169bf631dcb68ba5a796436434ff78be65 29-Jun-2016 martina.kollarova <martina.kollarova@intel.com> Remove unnecessary includes in src/pdf/

Use forward declaration more.

BUG=None
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2110033002

Review-Url: https://codereview.chromium.org/2110033002
/external/skia/src/pdf/SkPDFBitmap.h
a50151dcb5a0b8bfdef383e363e519c91d2d2c7a 25-Mar-2016 halcanary <halcanary@google.com> SkPDF: draw{Image,Bitmap} always serializes early

Before this change, the PDFCanon held a map from BitmapKeys
to SkImages for de-duping bitmaps. Even if the PDFDocument
serialized images early, the Canon still held a ref to that
image inside the map. With this change, the Canon holds a
single map from BitmapKeys to PDFObjects. Now, Images are
only held by the PDFObject, which the document serializes
and drops early.

This change also:

- Moves SkBitmapKey into its own header (for possible
reuse); it now can operate with images as well as
bitmaps.

- Creates SkImageBitmap, which wraps a pointer to a bitmap
or an image and abstracts out some common tasks so that
drawBitmap and drawImage behave the same.

- Modifies SkPDFCreateBitmapObject to take and return a
sk_sp<T>, not a T*.

- Refactors SkPDFDevice::internalDrawImage to use bitmaps
or images (via a SkImageBitmap).

- Turns on pre-serialization of all images.

BUG=skia:5087

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

Review URL: https://codereview.chromium.org/1829693002
/external/skia/src/pdf/SkPDFBitmap.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h
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.h