diff options
author | Hal Canary <halcanary@google.com> | 2017-07-18 10:28:31 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-18 19:33:34 +0000 |
commit | 4f29c20f20ce62150998786be8b9f8a81a901d72 (patch) | |
tree | 82e9ce0a4a2b83261f610ddbfe233728285ed26a /src/pdf/SkPDFUtils.h | |
parent | e46828675c617fd636e8a64f3be60f7f396c35f1 (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/SkPDFUtils.h')
-rw-r--r-- | src/pdf/SkPDFUtils.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pdf/SkPDFUtils.h b/src/pdf/SkPDFUtils.h index 93509fedd8..27d0a3adbe 100644 --- a/src/pdf/SkPDFUtils.h +++ b/src/pdf/SkPDFUtils.h @@ -4,11 +4,10 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ - - #ifndef SkPDFUtils_DEFINED #define SkPDFUtils_DEFINED +#include "SkPDFTypes.h" #include "SkPaint.h" #include "SkPath.h" #include "SkShader.h" @@ -124,6 +123,8 @@ void PopulateTilingPatternDict(SkPDFDict* pattern, SkRect& bbox, sk_sp<SkPDFDict> resources, const SkMatrix& matrix); + +bool ToBitmap(const SkImage* img, SkBitmap* dst); } // namespace SkPDFUtils #endif |