aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkJpegDecoderMgr.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-06-06 17:58:33 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-06 18:20:40 +0000
commit15f4d02738895663daa484e4c8677cbad41bcab5 (patch)
tree3ee2e4f4f2b592fca2e82838fb84df80e66a617f /src/codec/SkJpegDecoderMgr.cpp
parent23f734cbf6688b120d9d6cc0a0c5beac4abbf51e (diff)
Revert "Handle different types of streams in different jpeg source managers"
This reverts commit 96cc36124d06e023005dd901b32c59b29f55a135. Reason for revert: I think this is break one of our test bots. I will reland once that is figured out. Original change's description: > Handle different types of streams in different jpeg source managers > > For streams that are memory backed (stream->getMemoryBase() returns > a non-null ptr and hasLength() returns true), handle the stream > with skjpeg_mem_source_mgr, which directly assigns memory base to > the source manager. For other non memory backed streams, handle the > stream with skjpeg_buffered_source_mgr, which is renamed from > the old skjpeg_source_mgr with no implementation change. > > Signed-off-by: cjbao <cathy.bao@intel.com> > Bug: skia: > Change-Id: I748de0bdba726bbb318922c08497135e73e37329 > Reviewed-on: https://skia-review.googlesource.com/17296 > Reviewed-by: Leon Scroggins <scroggo@google.com> > Reviewed-by: Matt Sarett <msarett@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,scroggo@google.com,cathy.bao@intel.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: Idf6c426468cc959b3f4661c0b3e86cb4d5e93688 Reviewed-on: https://skia-review.googlesource.com/18850 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/codec/SkJpegDecoderMgr.cpp')
-rw-r--r--src/codec/SkJpegDecoderMgr.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/codec/SkJpegDecoderMgr.cpp b/src/codec/SkJpegDecoderMgr.cpp
index 0b02111a76..c2837aa2b4 100644
--- a/src/codec/SkJpegDecoderMgr.cpp
+++ b/src/codec/SkJpegDecoderMgr.cpp
@@ -69,13 +69,9 @@ bool JpegDecoderMgr::getEncodedColor(SkEncodedInfo::Color* outColor) {
}
JpegDecoderMgr::JpegDecoderMgr(SkStream* stream)
- : fInit(false)
+ : fSrcMgr(stream)
+ , fInit(false)
{
- if(stream->getMemoryBase() && stream->hasLength()) {
- fSrcMgr.reset(new skjpeg_mem_source_mgr(stream));
- } else {
- fSrcMgr.reset(new skjpeg_buffered_source_mgr(stream));
- }
// Error manager must be set before any calls to libjeg in order to handle failures
fDInfo.err = jpeg_std_error(&fErrorMgr);
fErrorMgr.error_exit = skjpeg_err_exit;
@@ -84,7 +80,7 @@ JpegDecoderMgr::JpegDecoderMgr(SkStream* stream)
void JpegDecoderMgr::init() {
jpeg_create_decompress(&fDInfo);
fInit = true;
- fDInfo.src = fSrcMgr.get();
+ fDInfo.src = &fSrcMgr;
fDInfo.err->output_message = &output_message;
fDInfo.progress = &fProgressMgr;
fProgressMgr.progress_monitor = &progress_monitor;