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

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

Issue 1641273003: Support decoding opaque to *premul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update SkMaskSwizzler to support opaque to premul Created 4 years, 10 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
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 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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698