OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |