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

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

Issue 2000713003: Add SkColorSpace to SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@public
Patch Set: Created 4 years, 6 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 "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkCodecPriv.h" 10 #include "SkCodecPriv.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 SkCodec* SkCodec::NewFromData(SkData* data, SkPngChunkReader* reader) { 110 SkCodec* SkCodec::NewFromData(SkData* data, SkPngChunkReader* reader) {
111 if (!data) { 111 if (!data) {
112 return nullptr; 112 return nullptr;
113 } 113 }
114 return NewFromStream(new SkMemoryStream(data), reader); 114 return NewFromStream(new SkMemoryStream(data), reader);
115 } 115 }
116 116
117 SkCodec::SkCodec(int width, int height, const SkEncodedInfo& info, SkStream* str eam, 117 SkCodec::SkCodec(int width, int height, const SkEncodedInfo& info, SkStream* str eam,
118 sk_sp<SkColorSpace> colorSpace, Origin origin) 118 sk_sp<SkColorSpace> colorSpace, Origin origin)
119 : fEncodedInfo(info) 119 : fEncodedInfo(info)
120 , fSrcInfo(info.makeImageInfo(width, height)) 120 , fSrcInfo(info.makeImageInfo(width, height, colorSpace))
121 , fStream(stream) 121 , fStream(stream)
122 , fNeedsRewind(false) 122 , fNeedsRewind(false)
123 , fColorSpace(colorSpace) 123 , fColorSpace(std::move(colorSpace))
124 , fOrigin(origin) 124 , fOrigin(origin)
125 , fDstInfo() 125 , fDstInfo()
126 , fOptions() 126 , fOptions()
127 , fCurrScanline(-1) 127 , fCurrScanline(-1)
128 {} 128 {}
129 129
130 SkCodec::~SkCodec() {} 130 SkCodec::~SkCodec() {}
131 131
132 bool SkCodec::rewindIfNeeded() { 132 bool SkCodec::rewindIfNeeded() {
133 if (!fStream) { 133 if (!fStream) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); 382 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested);
383 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); 383 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1);
384 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { 384 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
385 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); 385 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes);
386 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); 386 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler);
387 } 387 }
388 break; 388 break;
389 } 389 }
390 } 390 }
391 } 391 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698