aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkKeyedImage.h
diff options
context:
space:
mode:
authorGravatar Hal Canary <halcanary@google.com>2017-07-18 10:28:31 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-18 19:33:34 +0000
commit4f29c20f20ce62150998786be8b9f8a81a901d72 (patch)
tree82e9ce0a4a2b83261f610ddbfe233728285ed26a /src/pdf/SkKeyedImage.h
parente46828675c617fd636e8a64f3be60f7f396c35f1 (diff)
SkPDF: Re-use Jpeg Image Shaders
Also, de-dup shader better. - SkBitmapKeyFromImage function factors out image de-dup code. - SkPDFUtils::ToBitmap funtion factors out to-bitmap code - make_image_shader function now takes Image rather than Bitmap. All tests render the same. Some are significantly smaller PDFs. Change-Id: Id8dd36b31c8e573f44a5e9f6058d5a1d622b6385 Reviewed-on: https://skia-review.googlesource.com/24081 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/pdf/SkKeyedImage.h')
-rw-r--r--src/pdf/SkKeyedImage.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pdf/SkKeyedImage.h b/src/pdf/SkKeyedImage.h
index f74ec5c170..f489e576cd 100644
--- a/src/pdf/SkKeyedImage.h
+++ b/src/pdf/SkKeyedImage.h
@@ -37,4 +37,10 @@ private:
sk_sp<SkImage> fImage;
SkBitmapKey fKey = {{0, 0, 0, 0}, 0};
};
+
+/**
+ * Given an Image, return the Bitmap Key that corresponds to it. If the Image
+ * wraps a Bitmap, use that Bitmap's key.
+ */
+SkBitmapKey SkBitmapKeyFromImage(const SkImage*);
#endif // SkKeyedImage_DEFINED