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

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

Issue 1694023002: Revert of Fix colorType/alphaType checks in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 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);
358 fStorage.reset(get_row_bytes(fDecoderMgr->dinfo())); 357 fStorage.reset(get_row_bytes(fDecoderMgr->dinfo()));
359 fSrcRow = fStorage.get(); 358 fSrcRow = fStorage.get();
360 } 359 }
361 360
362 SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) { 361 SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) {
363 if (!createIfNecessary || fSwizzler) { 362 if (!createIfNecessary || fSwizzler) {
364 SkASSERT(!fSwizzler || (fSrcRow && fStorage.get() == fSrcRow)); 363 SkASSERT(!fSwizzler || (fSrcRow && fStorage.get() == fSrcRow));
365 return fSwizzler; 364 return fSwizzler;
366 } 365 }
367 366
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 646
648 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); 647 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock);
649 if (linesRead < remainingRows) { 648 if (linesRead < remainingRows) {
650 // FIXME: Handle incomplete YUV decodes without signalling an error. 649 // FIXME: Handle incomplete YUV decodes without signalling an error.
651 return kInvalidInput; 650 return kInvalidInput;
652 } 651 }
653 } 652 }
654 653
655 return kSuccess; 654 return kSuccess;
656 } 655 }
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