aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkBitmapKey.h
Commit message (Collapse)AuthorAge
* SkPDF: simplify drawImage/Bitmap/Sprite code.Gravatar Hal Canary2017-07-12
| | | | | | | | | | | | | | | - SkImageSubset becomes SkKeyedImage - SkPDFCanvas::onDraw{Bitmap, Image} go away - Remove SkPDFCanvas: base classes now do the right thing. - SkPDFDevice::draw{Bitmap,Image}{Rect,}() simplified - 244 fewer SLOC. All but a few PDFs are identical, those rasterize almost the same. Change-Id: I3ceb3b8935c689719cedf1ad544b0407b5c1733e Reviewed-on: https://skia-review.googlesource.com/22218 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkPDF: subset drawImageRect while still dedupingGravatar Hal Canary2016-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | - Replace SkImageBitmap with SkImageSubset - SkBitmapKey becomes trivial for simplicity. - SkPDFCanvas::onDraw(Bitmap|Image)Rect now clip and call SkCanvas::onDraw(Bitmap|Image)Rect. - SkPDFDevice::draw(Bitmap|BitmapRect|Sprite) now convert bitmap into SkImageSubset via make_image_subset function. - SkPDFDevice::draw(Image|Bitmap)Rect now implemented again. - SkPDFDevice::internalDrawImage now performs image subsetting as needed, while still deduping properly. BUG=633528 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2785 Change-Id: I063346d12b0e9c6b6c0c4943ee25400c88aa1a44 Reviewed-on: https://skia-review.googlesource.com/2785 Reviewed-by: Ben Wagner <bungeman@google.com>
* SkPDF: properly dedup bitmaps in shadersGravatar halcanary2016-04-01
| | | | | | | BUG=skia:5161 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1848383002 Review URL: https://codereview.chromium.org/1848383002
* SkPDF: draw{Image,Bitmap} always serializes earlyGravatar halcanary2016-03-25
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