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

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: Fix bot errors 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
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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 case kRGB_565_SkColorType: 347 case kRGB_565_SkColorType:
348 srcConfig = SkSwizzler::kNoOp16; 348 srcConfig = SkSwizzler::kNoOp16;
349 break; 349 break;
350 default: 350 default:
351 // This function should only be called if the colorType is suppo rted by jpeg 351 // This function should only be called if the colorType is suppo rted by jpeg
352 SkASSERT(false); 352 SkASSERT(false);
353 } 353 }
354 } 354 }
355 355
356 fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, nullptr, dstInfo, opti ons)); 356 fSwizzler.reset(SkSwizzler::CreateSwizzler(srcConfig, nullptr, dstInfo, opti ons));
357 SkASSERT(fSwizzler);
357 fStorage.reset(get_row_bytes(fDecoderMgr->dinfo())); 358 fStorage.reset(get_row_bytes(fDecoderMgr->dinfo()));
358 fSrcRow = fStorage.get(); 359 fSrcRow = fStorage.get();
359 } 360 }
360 361
361 SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) { 362 SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) {
362 if (!createIfNecessary || fSwizzler) { 363 if (!createIfNecessary || fSwizzler) {
363 SkASSERT(!fSwizzler || (fSrcRow && fStorage.get() == fSrcRow)); 364 SkASSERT(!fSwizzler || (fSrcRow && fStorage.get() == fSrcRow));
364 return fSwizzler; 365 return fSwizzler;
365 } 366 }
366 367
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 647
647 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); 648 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock);
648 if (linesRead < remainingRows) { 649 if (linesRead < remainingRows) {
649 // FIXME: Handle incomplete YUV decodes without signalling an error. 650 // FIXME: Handle incomplete YUV decodes without signalling an error.
650 return kInvalidInput; 651 return kInvalidInput;
651 } 652 }
652 } 653 }
653 654
654 return kSuccess; 655 return kSuccess;
655 } 656 }
OLDNEW
« no previous file with comments | « src/codec/SkGifCodec.cpp ('k') | src/codec/SkWbmpCodec.cpp » ('j') | src/codec/SkWbmpCodec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698