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

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

Issue 2212563003: Modify SkPngCodec to recognize 565 images from the sBIT chunk (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Allow SkPngCodec to set SkImageInfo directly Created 4 years, 4 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 | « include/codec/SkCodec.h ('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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 : fEncodedInfo(info) 119 : fEncodedInfo(info)
120 , fSrcInfo(info.makeImageInfo(width, height, std::move(colorSpace))) 120 , fSrcInfo(info.makeImageInfo(width, height, std::move(colorSpace)))
121 , fStream(stream) 121 , fStream(stream)
122 , fNeedsRewind(false) 122 , fNeedsRewind(false)
123 , fOrigin(origin) 123 , fOrigin(origin)
124 , fDstInfo() 124 , fDstInfo()
125 , fOptions() 125 , fOptions()
126 , fCurrScanline(-1) 126 , fCurrScanline(-1)
127 {} 127 {}
128 128
129 SkCodec::SkCodec(const SkEncodedInfo& info, const SkImageInfo& imageInfo, SkStre am* stream,
130 Origin origin)
131 : fEncodedInfo(info)
132 , fSrcInfo(imageInfo)
133 , fStream(stream)
134 , fNeedsRewind(false)
135 , fOrigin(origin)
136 , fDstInfo()
137 , fOptions()
138 , fCurrScanline(-1)
139 {}
140
129 SkCodec::~SkCodec() {} 141 SkCodec::~SkCodec() {}
130 142
131 bool SkCodec::rewindIfNeeded() { 143 bool SkCodec::rewindIfNeeded() {
132 if (!fStream) { 144 if (!fStream) {
133 // Some codecs do not have a stream, but they hold others that do. They 145 // Some codecs do not have a stream, but they hold others that do. They
134 // must handle rewinding themselves. 146 // must handle rewinding themselves.
135 return true; 147 return true;
136 } 148 }
137 149
138 // Store the value of fNeedsRewind so we can update it. Next read will 150 // Store the value of fNeedsRewind so we can update it. Next read will
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); 393 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested);
382 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); 394 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1);
383 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { 395 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
384 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); 396 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes);
385 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); 397 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler);
386 } 398 }
387 break; 399 break;
388 } 400 }
389 } 401 }
390 } 402 }
OLDNEW
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkPngCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698