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

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

Issue 2045293002: Add support for multiple frames in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix a test - we now draw transparent background for missing color table Created 4 years, 1 month 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/SkGifCodec.cpp ('k') | src/codec/SkStreamBuffer.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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (!this->codec()->skipScanlines(sampleY - 1)) { 297 if (!this->codec()->skipScanlines(sampleY - 1)) {
298 this->codec()->fillIncompleteImage(info, pixels, rowByte s, 298 this->codec()->fillIncompleteImage(info, pixels, rowByte s,
299 options.fZeroInitialized, dstHeight, y + 1); 299 options.fZeroInitialized, dstHeight, y + 1);
300 return SkCodec::kIncompleteInput; 300 return SkCodec::kIncompleteInput;
301 } 301 }
302 } 302 }
303 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); 303 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes);
304 } 304 }
305 return SkCodec::kSuccess; 305 return SkCodec::kSuccess;
306 } 306 }
307 case SkCodec::kOutOfOrder_SkScanlineOrder:
308 case SkCodec::kBottomUp_SkScanlineOrder: { 307 case SkCodec::kBottomUp_SkScanlineOrder: {
309 // Note that these modes do not support subsetting. 308 // Note that these modes do not support subsetting.
310 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight); 309 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight);
311 int y; 310 int y;
312 for (y = 0; y < nativeSize.height(); y++) { 311 for (y = 0; y < nativeSize.height(); y++) {
313 int srcY = this->codec()->nextScanline(); 312 int srcY = this->codec()->nextScanline();
314 if (is_coord_necessary(srcY, sampleY, dstHeight)) { 313 if (is_coord_necessary(srcY, sampleY, dstHeight)) {
315 void* pixelPtr = SkTAddOffset<void>(pixels, 314 void* pixelPtr = SkTAddOffset<void>(pixels,
316 rowBytes * get_dst_coord(srcY, sampleY)); 315 rowBytes * get_dst_coord(srcY, sampleY));
317 if (1 != this->codec()->getScanlines(pixelPtr, 1, rowBytes)) { 316 if (1 != this->codec()->getScanlines(pixelPtr, 1, rowBytes)) {
(...skipping 23 matching lines...) Expand all
341 void* rowPtr = SkTAddOffset<void>(pixels, rowBytes * get_dst_coo rd(srcY, sampleY)); 340 void* rowPtr = SkTAddOffset<void>(pixels, rowBytes * get_dst_coo rd(srcY, sampleY));
342 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f ZeroInitialized); 341 SkSampler::Fill(fillInfo, rowPtr, rowBytes, fillValue, options.f ZeroInitialized);
343 } 342 }
344 return SkCodec::kIncompleteInput; 343 return SkCodec::kIncompleteInput;
345 } 344 }
346 default: 345 default:
347 SkASSERT(false); 346 SkASSERT(false);
348 return SkCodec::kUnimplemented; 347 return SkCodec::kUnimplemented;
349 } 348 }
350 } 349 }
OLDNEW
« no previous file with comments | « src/codec/SkGifCodec.cpp ('k') | src/codec/SkStreamBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698