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

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

Issue 2360863003: Make SkColorSpaceXform::New() take bare ptrs (Closed)
Patch Set: Created 4 years, 2 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 | « gm/colorspacexform.cpp ('k') | src/codec/SkPngCodec.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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 fSwizzlerSubset.width() == options.fSubset->width()); 626 fSwizzlerSubset.width() == options.fSubset->width());
627 swizzlerOptions.fSubset = &fSwizzlerSubset; 627 swizzlerOptions.fSubset = &fSwizzlerSubset;
628 } 628 }
629 fSwizzler.reset(SkSwizzler::CreateSwizzler(swizzlerInfo, nullptr, dstInfo, s wizzlerOptions, 629 fSwizzler.reset(SkSwizzler::CreateSwizzler(swizzlerInfo, nullptr, dstInfo, s wizzlerOptions,
630 nullptr, preSwizzled)); 630 nullptr, preSwizzled));
631 SkASSERT(fSwizzler); 631 SkASSERT(fSwizzler);
632 } 632 }
633 633
634 void SkJpegCodec::initializeColorXform(const SkImageInfo& dstInfo) { 634 void SkJpegCodec::initializeColorXform(const SkImageInfo& dstInfo) {
635 if (needs_color_xform(dstInfo, this->getInfo())) { 635 if (needs_color_xform(dstInfo, this->getInfo())) {
636 fColorXform = SkColorSpaceXform::New(sk_ref_sp(this->getInfo().colorSpac e()), 636 fColorXform = SkColorSpaceXform::New(this->getInfo().colorSpace(), dstIn fo.colorSpace());
637 sk_ref_sp(dstInfo.colorSpace()));
638 SkASSERT(fColorXform); 637 SkASSERT(fColorXform);
639 } 638 }
640 } 639 }
641 640
642 SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) { 641 SkSampler* SkJpegCodec::getSampler(bool createIfNecessary) {
643 if (!createIfNecessary || fSwizzler) { 642 if (!createIfNecessary || fSwizzler) {
644 SkASSERT(!fSwizzler || (fSwizzleSrcRow && fStorage.get() == fSwizzleSrcR ow)); 643 SkASSERT(!fSwizzler || (fSwizzleSrcRow && fStorage.get() == fSwizzleSrcR ow));
645 return fSwizzler; 644 return fSwizzler;
646 } 645 }
647 646
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 925
927 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock); 926 JDIMENSION linesRead = jpeg_read_raw_data(dinfo, yuv, numRowsPerBlock);
928 if (linesRead < remainingRows) { 927 if (linesRead < remainingRows) {
929 // FIXME: Handle incomplete YUV decodes without signalling an error. 928 // FIXME: Handle incomplete YUV decodes without signalling an error.
930 return kInvalidInput; 929 return kInvalidInput;
931 } 930 }
932 } 931 }
933 932
934 return kSuccess; 933 return kSuccess;
935 } 934 }
OLDNEW
« no previous file with comments | « gm/colorspacexform.cpp ('k') | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698