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

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

Issue 1726823002: Set SkColorSpace object for PNGs and parse ICC profiles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 9 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 | « resources/color_wheel_with_profile.png ('k') | src/codec/SkPngCodec.h » ('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 "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkCodecPriv.h" 10 #include "SkCodecPriv.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 return nullptr; 106 return nullptr;
107 } 107 }
108 108
109 SkCodec* SkCodec::NewFromData(SkData* data, SkPngChunkReader* reader) { 109 SkCodec* SkCodec::NewFromData(SkData* data, SkPngChunkReader* reader) {
110 if (!data) { 110 if (!data) {
111 return nullptr; 111 return nullptr;
112 } 112 }
113 return NewFromStream(new SkMemoryStream(data), reader); 113 return NewFromStream(new SkMemoryStream(data), reader);
114 } 114 }
115 115
116 SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream) 116 SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream, SkColorSpace* colorS pace)
117 : fSrcInfo(info) 117 : fSrcInfo(info)
118 , fStream(stream) 118 , fStream(stream)
119 , fNeedsRewind(false) 119 , fNeedsRewind(false)
120 , fColorSpace(colorSpace ? SkRef(colorSpace) : nullptr)
120 , fDstInfo() 121 , fDstInfo()
121 , fOptions() 122 , fOptions()
122 , fCurrScanline(-1) 123 , fCurrScanline(-1)
123 {} 124 {}
124 125
125 SkCodec::~SkCodec() {} 126 SkCodec::~SkCodec() {}
126 127
127 bool SkCodec::rewindIfNeeded() { 128 bool SkCodec::rewindIfNeeded() {
128 if (!fStream) { 129 if (!fStream) {
129 // Some codecs do not have a stream, but they hold others that do. They 130 // Some codecs do not have a stream, but they hold others that do. They
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); 378 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested);
378 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); 379 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1);
379 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { 380 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
380 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); 381 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes);
381 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); 382 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler);
382 } 383 }
383 break; 384 break;
384 } 385 }
385 } 386 }
386 } 387 }
OLDNEW
« no previous file with comments | « resources/color_wheel_with_profile.png ('k') | src/codec/SkPngCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698