Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1895383002: Revert of Add SkEncodedInfo to report properties of encoded image data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codec/SkJpegCodec.h ('k') | src/codec/SkJpegDecoderMgr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index 6b97b2fe4ad3384b22b42a32e8c300ee88ab9d34..76d2ee85727f20e3d06e92e5b0aa1e7acfd1bd43 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -211,20 +211,17 @@
}
if (codecOut) {
- // Get the encoded color type
- SkEncodedInfo::Color color = decoderMgr->getEncodedColor();
- if (SkEncodedInfo::kUnknown_Color == color) {
- return false;
- }
+ // Recommend the color type to decode to
+ const SkColorType colorType = decoderMgr->getColorType();
// Create image info object and the codec
- SkEncodedInfo info = SkEncodedInfo::Make(color, SkEncodedInfo::kOpaque_Alpha, 8);
+ const SkImageInfo& imageInfo = SkImageInfo::Make(decoderMgr->dinfo()->image_width,
+ decoderMgr->dinfo()->image_height, colorType, kOpaque_SkAlphaType);
Origin orientation = get_exif_orientation(decoderMgr->dinfo());
sk_sp<SkColorSpace> colorSpace = get_icc_profile(decoderMgr->dinfo());
- *codecOut = new SkJpegCodec(decoderMgr->dinfo()->image_width,
- decoderMgr->dinfo()->image_height, info, stream, decoderMgr.release(), colorSpace,
+ *codecOut = new SkJpegCodec(imageInfo, stream, decoderMgr.release(), colorSpace,
orientation);
} else {
SkASSERT(nullptr != decoderMgrOut);
@@ -245,9 +242,9 @@
return nullptr;
}
-SkJpegCodec::SkJpegCodec(int width, int height, const SkEncodedInfo& info, SkStream* stream,
+SkJpegCodec::SkJpegCodec(const SkImageInfo& srcInfo, SkStream* stream,
JpegDecoderMgr* decoderMgr, sk_sp<SkColorSpace> colorSpace, Origin origin)
- : INHERITED(width, height, info, stream, colorSpace, origin)
+ : INHERITED(srcInfo, stream, colorSpace, origin)
, fDecoderMgr(decoderMgr)
, fReadyState(decoderMgr->dinfo()->global_state)
, fSwizzlerSubset(SkIRect::MakeEmpty())
« no previous file with comments | « src/codec/SkJpegCodec.h ('k') | src/codec/SkJpegDecoderMgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698