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

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

Issue 2335203002: Implement Fill() for incomplete decodes to RGBA_F16 (Closed)
Patch Set: Fix win builds Created 4 years, 3 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 | « src/codec/SkPngCodec.cpp ('k') | src/codec/SkSampler.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 "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
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
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 }
OLDNEW
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | src/codec/SkSampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698