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

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: Stop DM from running large interlaced images on 32-bit Ubuntu GCE bots b/c they are running out of … 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
« no previous file with comments | « src/codec/SkBmpStandardCodec.cpp ('k') | src/codec/SkCodec_libpng.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_libgif.h" 8 #include "SkCodec_libgif.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 // Modify the dst pointer 437 // Modify the dst pointer
438 const int32_t dstBytesPerPixel = 438 const int32_t dstBytesPerPixel =
439 SkColorTypeBytesPerPixel(dstColorType); 439 SkColorTypeBytesPerPixel(dstColorType);
440 dst = SkTAddOffset<void*>(dst, 440 dst = SkTAddOffset<void*>(dst,
441 dstRowBytes * imageTop + 441 dstRowBytes * imageTop +
442 dstBytesPerPixel * imageLeft); 442 dstBytesPerPixel * imageLeft);
443 443
444 // Create the subset swizzler 444 // Create the subset swizzler
445 swizzler.reset(SkSwizzler::CreateSwizzler( 445 swizzler.reset(SkSwizzler::CreateSwizzler(
446 SkSwizzler::kIndex, colorTable, subsetDstInfo, 446 SkSwizzler::kIndex, colorTable, subsetDstInfo,
447 zeroInit)); 447 zeroInit, this->getInfo()));
448 } else { 448 } else {
449 // Create the fully dimensional swizzler 449 // Create the fully dimensional swizzler
450 swizzler.reset(SkSwizzler::CreateSwizzler( 450 swizzler.reset(SkSwizzler::CreateSwizzler(
451 SkSwizzler::kIndex, colorTable, dstInfo, zeroInit)); 451 SkSwizzler::kIndex, colorTable, dstInfo,
452 zeroInit, this->getInfo()));
452 } 453 }
453 454
454 // Stores output from dgiflib and input to the swizzler 455 // Stores output from dgiflib and input to the swizzler
455 SkAutoTDeleteArray<uint8_t> 456 SkAutoTDeleteArray<uint8_t>
456 buffer(SkNEW_ARRAY(uint8_t, innerWidth)); 457 buffer(SkNEW_ARRAY(uint8_t, innerWidth));
457 458
458 // Check the interlace flag and iterate over rows of the input 459 // Check the interlace flag and iterate over rows of the input
459 if (fGif->Image.Interlace) { 460 if (fGif->Image.Interlace) {
460 // In interlace mode, the rows of input are rearranged in 461 // In interlace mode, the rows of input are rearranged in
461 // the output image. We use an iterator to take care of 462 // the output image. We use an iterator to take care of
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 // giflib returns an error code if the record type is not known. 574 // giflib returns an error code if the record type is not known.
574 // We should catch this error immediately. 575 // We should catch this error immediately.
575 SkASSERT(false); 576 SkASSERT(false);
576 break; 577 break;
577 } 578 }
578 } while (TERMINATE_RECORD_TYPE != recordType); 579 } while (TERMINATE_RECORD_TYPE != recordType);
579 580
580 return gif_error("Could not find any images to decode in gif file.\n", 581 return gif_error("Could not find any images to decode in gif file.\n",
581 kInvalidInput); 582 kInvalidInput);
582 } 583 }
OLDNEW
« no previous file with comments | « src/codec/SkBmpStandardCodec.cpp ('k') | src/codec/SkCodec_libpng.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698