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

Side by Side Diff: src/images/SkImageDecoder_libgif.cpp

Issue 1516833003: Switch SkAutoMalloc to SkAutoTMalloc to avoid cast (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Go back to patch set 3 Created 5 years 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/effects/SkColorCubeFilter.cpp ('k') | src/images/SkImageDecoder_libjpeg.cpp » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkColor.h" 8 #include "SkColor.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkColorTable.h" 10 #include "SkColorTable.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } 371 }
372 } 372 }
373 373
374 // abort if either inner dimension is <= 0 374 // abort if either inner dimension is <= 0
375 if (innerWidth <= 0 || innerHeight <= 0) { 375 if (innerWidth <= 0 || innerHeight <= 0) {
376 return error_return(*bm, "non-pos inner width/height"); 376 return error_return(*bm, "non-pos inner width/height");
377 } 377 }
378 378
379 SkAutoLockPixels alp(*bm); 379 SkAutoLockPixels alp(*bm);
380 380
381 SkAutoMalloc storage(innerWidth); 381 SkAutoTMalloc<uint8_t> storage(innerWidth);
382 uint8_t* scanline = (uint8_t*) storage.get(); 382 uint8_t* scanline = storage.get();
383 383
384 // GIF has an option to store the scanlines of an image, plus a larg er background, 384 // GIF has an option to store the scanlines of an image, plus a larg er background,
385 // filled by a fill color. In this case, we will use a subset of the larger bitmap 385 // filled by a fill color. In this case, we will use a subset of the larger bitmap
386 // for sampling. 386 // for sampling.
387 SkBitmap subset; 387 SkBitmap subset;
388 SkBitmap* workingBitmap; 388 SkBitmap* workingBitmap;
389 // are we only a subset of the total bounds? 389 // are we only a subset of the total bounds?
390 if ((imageTop | imageLeft) > 0 || 390 if ((imageTop | imageLeft) > 0 ||
391 innerWidth < width || innerHeight < height) { 391 innerWidth < width || innerHeight < height) {
392 // Fill the background. 392 // Fill the background.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory); 532 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory);
533 533
534 static SkImageDecoder::Format get_format_gif(SkStreamRewindable* stream) { 534 static SkImageDecoder::Format get_format_gif(SkStreamRewindable* stream) {
535 if (is_gif(stream)) { 535 if (is_gif(stream)) {
536 return SkImageDecoder::kGIF_Format; 536 return SkImageDecoder::kGIF_Format;
537 } 537 }
538 return SkImageDecoder::kUnknown_Format; 538 return SkImageDecoder::kUnknown_Format;
539 } 539 }
540 540
541 static SkImageDecoder_FormatReg gFormatReg(get_format_gif); 541 static SkImageDecoder_FormatReg gFormatReg(get_format_gif);
OLDNEW
« no previous file with comments | « src/effects/SkColorCubeFilter.cpp ('k') | src/images/SkImageDecoder_libjpeg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698