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

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

Issue 1260673002: SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove setSampleX(), move IsInterlaced() to scanlineDecoder Created 5 years, 4 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_libgif.h" 8 #include "SkCodec_libgif.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // Modify the dst pointer 434 // Modify the dst pointer
435 const int32_t dstBytesPerPixel = 435 const int32_t dstBytesPerPixel =
436 SkColorTypeBytesPerPixel(dstColorType); 436 SkColorTypeBytesPerPixel(dstColorType);
437 void* subsetDst = SkTAddOffset<void*>(dst, 437 void* subsetDst = SkTAddOffset<void*>(dst,
438 dstRowBytes * imageTop + 438 dstRowBytes * imageTop +
439 dstBytesPerPixel * imageLeft); 439 dstBytesPerPixel * imageLeft);
440 440
441 // Create the subset swizzler 441 // Create the subset swizzler
442 swizzler.reset(SkSwizzler::CreateSwizzler( 442 swizzler.reset(SkSwizzler::CreateSwizzler(
443 SkSwizzler::kIndex, colorTable, subsetDstInfo, 443 SkSwizzler::kIndex, colorTable, subsetDstInfo,
444 subsetDst, dstRowBytes, zeroInit)); 444 subsetDst, dstRowBytes, zeroInit, opts.fSampleX));
445 } else { 445 } else {
446 // Create the fully dimensional swizzler 446 // Create the fully dimensional swizzler
447 swizzler.reset(SkSwizzler::CreateSwizzler( 447 swizzler.reset(SkSwizzler::CreateSwizzler(
448 SkSwizzler::kIndex, colorTable, dstInfo, dst, 448 SkSwizzler::kIndex, colorTable, dstInfo, dst,
449 dstRowBytes, zeroInit)); 449 dstRowBytes, zeroInit, opts.fSampleX));
450 } 450 }
451 451
452 // Stores output from dgiflib and input to the swizzler 452 // Stores output from dgiflib and input to the swizzler
453 SkAutoTDeleteArray<uint8_t> 453 SkAutoTDeleteArray<uint8_t>
454 buffer(SkNEW_ARRAY(uint8_t, innerWidth)); 454 buffer(SkNEW_ARRAY(uint8_t, innerWidth));
455 455
456 // Check the interlace flag and iterate over rows of the input 456 // Check the interlace flag and iterate over rows of the input
457 if (fGif->Image.Interlace) { 457 if (fGif->Image.Interlace) {
458 // In interlace mode, the rows of input are rearranged in 458 // In interlace mode, the rows of input are rearranged in
459 // the output image. We use an iterator to take care of 459 // the output image. We use an iterator to take care of
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 // giflib returns an error code if the record type is not known. 565 // giflib returns an error code if the record type is not known.
566 // We should catch this error immediately. 566 // We should catch this error immediately.
567 SkASSERT(false); 567 SkASSERT(false);
568 break; 568 break;
569 } 569 }
570 } while (TERMINATE_RECORD_TYPE != recordType); 570 } while (TERMINATE_RECORD_TYPE != recordType);
571 571
572 return gif_error("Could not find any images to decode in gif file.\n", 572 return gif_error("Could not find any images to decode in gif file.\n",
573 kInvalidInput); 573 kInvalidInput);
574 } 574 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698