diff options
author | Leon Scroggins III <scroggo@google.com> | 2017-10-18 11:43:29 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-18 17:38:15 +0000 |
commit | 5411a60e0d7370a5d47b5049de845a06fe52e98b (patch) | |
tree | 8995da6236e7f37419a4d3075c35bbdc36049672 /src/codec/SkCodec.cpp | |
parent | 1d014105ac8e5968b6d260745c807ab45dfee956 (diff) |
Add an Option for orientation on JPEG encodes
Move Origin to its own header so that SkPixmap and SkJpegEncoder need
not depend on SkCodec.
Add libexif, which is already used by Android, and use it to write the
orientation. Write a makefile based on the Android.bp in Android, minus
warnings. (libexif has an LGPL license.)
Add a test that verifies all the orientations work.
Optionally enable writing the orientation (and therefore including
libexif). Chromium does not currently need it, and Android does not
expose an API that would allow using it. Disable on Windows, where we
still have build errors to fix.
Bug: skia:7138
Change-Id: Iaeff44c36aebe0e639666979dc00e1b7594bbeb1
Reviewed-on: https://skia-review.googlesource.com/60721
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/codec/SkCodec.cpp')
-rw-r--r-- | src/codec/SkCodec.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp index c3d99f2793..59978c6fdf 100644 --- a/src/codec/SkCodec.cpp +++ b/src/codec/SkCodec.cpp @@ -128,7 +128,7 @@ std::unique_ptr<SkCodec> SkCodec::MakeFromData(sk_sp<SkData> data, SkPngChunkRea SkCodec::SkCodec(int width, int height, const SkEncodedInfo& info, XformFormat srcFormat, std::unique_ptr<SkStream> stream, - sk_sp<SkColorSpace> colorSpace, Origin origin) + sk_sp<SkColorSpace> colorSpace, SkEncodedOrigin origin) : fEncodedInfo(info) , fSrcInfo(info.makeImageInfo(width, height, std::move(colorSpace))) , fSrcXformFormat(srcFormat) @@ -142,7 +142,8 @@ SkCodec::SkCodec(int width, int height, const SkEncodedInfo& info, {} SkCodec::SkCodec(const SkEncodedInfo& info, const SkImageInfo& imageInfo, - XformFormat srcFormat, std::unique_ptr<SkStream> stream, Origin origin) + XformFormat srcFormat, std::unique_ptr<SkStream> stream, + SkEncodedOrigin origin) : fEncodedInfo(info) , fSrcInfo(imageInfo) , fSrcXformFormat(srcFormat) |