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 "SkCodec.h" | 8 #include "SkCodec.h" |
9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkMath.h" | 10 #include "SkMath.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 246 } |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 if (nativeSize.height() == y) { | 250 if (nativeSize.height() == y) { |
251 return SkCodec::kSuccess; | 251 return SkCodec::kSuccess; |
252 } | 252 } |
253 | 253 |
254 // We handle filling uninitialized memory here instead of using this
->codec(). | 254 // We handle filling uninitialized memory here instead of using this
->codec(). |
255 // this->codec() does not know that we are sampling. | 255 // this->codec() does not know that we are sampling. |
256 const uint32_t fillValue = this->codec()->getFillValue(info.colorTyp
e(), | 256 const uint32_t fillValue = this->codec()->getFillValue(info.colorTyp
e()); |
257 info.alphaType()); | |
258 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); | 257 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); |
259 for (; y < nativeSize.height(); y++) { | 258 for (; y < nativeSize.height(); y++) { |
260 int srcY = this->codec()->outputScanline(y); | 259 int srcY = this->codec()->outputScanline(y); |
261 if (!is_coord_necessary(srcY, sampleY, dstHeight)) { | 260 if (!is_coord_necessary(srcY, sampleY, dstHeight)) { |
262 continue; | 261 continue; |
263 } | 262 } |
264 | 263 |
265 void* rowPtr = SkTAddOffset<void>(pixels, rowBytes * get_dst_coo
rd(srcY, sampleY)); | 264 void* rowPtr = SkTAddOffset<void>(pixels, rowBytes * get_dst_coo
rd(srcY, sampleY)); |
266 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f
ZeroInitialized); | 265 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f
ZeroInitialized); |
267 } | 266 } |
(...skipping 21 matching lines...) Expand all Loading... |
289 // this->codec() has already handled filling uninitialized memor
y. | 288 // this->codec() has already handled filling uninitialized memor
y. |
290 return SkCodec::kIncompleteInput; | 289 return SkCodec::kIncompleteInput; |
291 } | 290 } |
292 return SkCodec::kSuccess; | 291 return SkCodec::kSuccess; |
293 } | 292 } |
294 default: | 293 default: |
295 SkASSERT(false); | 294 SkASSERT(false); |
296 return SkCodec::kUnimplemented; | 295 return SkCodec::kUnimplemented; |
297 } | 296 } |
298 } | 297 } |
OLD | NEW |