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

Side by Side Diff: src/codec/SkJpegCodec.cpp

Issue 1695473002: Fix colorType/alphaType checks in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/codec/SkGifCodec.cpp ('k') | src/codec/SkWbmpCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkMSAN.h" 9 #include "SkMSAN.h"
10 #include "SkJpegCodec.h" 10 #include "SkJpegCodec.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // This function should only be called if the colorType is suppo rted by jpeg 365 // This function should only be called if the colorType is suppo rted by jpeg
366 SkASSERT(false); 366 SkASSERT(false);
367 } 367 }
368 } 368 }
369 369
370 if (JCS_RGB == fDecoderMgr->dinfo()->out_color_space) { 370 if (JCS_RGB == fDecoderMgr->dinfo()->out_color_space) {
371 srcConfig = SkSwizzler::kRGB; 371 srcConfig = SkSwizzler::kRGB;
372 } 372 }
373 373
374 fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, nullptr, dstInfo, opti ons)); 374 fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, nullptr, dstInfo, opti ons));
375 SkASSERT(fSwizzler);
375 fStorage.reset(get_row_bytes(fDecoderMgr->dinfo())); 376 fStorage.reset(get_row_bytes(fDecoderMgr->dinfo()));
376 fSrcRow = fStorage.get(); 377 fSrcRow = fStorage.get();
377 } 378 }
378 379
379 SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) { 380 SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) {
380 if (!createIfNecessary || fSwizzler) { 381 if (!createIfNecessary || fSwizzler) {
381 SkASSERT(!fSwizzler || (fSrcRow && fStorage.get() == fSrcRow)); 382 SkASSERT(!fSwizzler || (fSrcRow && fStorage.get() == fSrcRow));
382 return fSwizzler; 383 return fSwizzler;
383 } 384 }
384 385
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 666
666 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); 667 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock);
667 if (linesRead < remainingRows) { 668 if (linesRead < remainingRows) {
668 // FIXME: Handle incomplete YUV decodes without signalling an error. 669 // FIXME: Handle incomplete YUV decodes without signalling an error.
669 return kInvalidInput; 670 return kInvalidInput;
670 } 671 }
671 } 672 }
672 673
673 return kSuccess; 674 return kSuccess;
674 } 675 }
OLDNEW
« no previous file with comments | « src/codec/SkGifCodec.cpp ('k') | src/codec/SkWbmpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698