| 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 uint64_t fillValue = this->codec()->getFillValue(info); |
| 257 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); | 257 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); |
| 258 for (; y < nativeSize.height(); y++) { | 258 for (; y < nativeSize.height(); y++) { |
| 259 int srcY = this->codec()->outputScanline(y); | 259 int srcY = this->codec()->outputScanline(y); |
| 260 if (!is_coord_necessary(srcY, sampleY, dstHeight)) { | 260 if (!is_coord_necessary(srcY, sampleY, dstHeight)) { |
| 261 continue; | 261 continue; |
| 262 } | 262 } |
| 263 | 263 |
| 264 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)); |
| 265 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f
ZeroInitialized); | 265 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f
ZeroInitialized); |
| 266 } | 266 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 288 // this->codec() has already handled filling uninitialized memor
y. | 288 // this->codec() has already handled filling uninitialized memor
y. |
| 289 return SkCodec::kIncompleteInput; | 289 return SkCodec::kIncompleteInput; |
| 290 } | 290 } |
| 291 return SkCodec::kSuccess; | 291 return SkCodec::kSuccess; |
| 292 } | 292 } |
| 293 default: | 293 default: |
| 294 SkASSERT(false); | 294 SkASSERT(false); |
| 295 return SkCodec::kUnimplemented; | 295 return SkCodec::kUnimplemented; |
| 296 } | 296 } |
| 297 } | 297 } |
| OLD | NEW |