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

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

Issue 1019543003: Do not create empty color table if it does not exist (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | 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_libbmp.h" 8 #include "SkCodec_libbmp.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 return false; 563 return false;
564 } 564 }
565 565
566 // After reading the color table, skip to the start of the pixel array 566 // After reading the color table, skip to the start of the pixel array
567 if (stream()->skip(fOffset - colorBytes) != fOffset - colorBytes) { 567 if (stream()->skip(fOffset - colorBytes) != fOffset - colorBytes) {
568 SkDebugf("Error: unable to skip to image data.\n"); 568 SkDebugf("Error: unable to skip to image data.\n");
569 return false; 569 return false;
570 } 570 }
571 571
572 // Set the color table and return true on success 572 // Set the color table and return true on success
573 fColorTable.reset(SkNEW_ARGS(SkColorTable, (colorTable, maxColors))); 573 if (maxColors > 0) {
574 fColorTable.reset(SkNEW_ARGS(SkColorTable, (colorTable, maxColors)));
575 }
574 return true; 576 return true;
575 } 577 }
576 578
577 /* 579 /*
578 * 580 *
579 * Performs the bitmap decoding for bit masks input format 581 * Performs the bitmap decoding for bit masks input format
580 * 582 *
581 */ 583 */
582 SkCodec::Result SkBmpCodec::decodeMask(const SkImageInfo& dstInfo, 584 SkCodec::Result SkBmpCodec::decodeMask(const SkImageInfo& dstInfo,
583 void* dst, size_t dstRowBytes) { 585 void* dst, size_t dstRowBytes) {
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 } 1002 }
1001 dstRow = SkTAddOffset<SkPMColor>(dstRow, dstRowBytes); 1003 dstRow = SkTAddOffset<SkPMColor>(dstRow, dstRowBytes);
1002 } 1004 }
1003 } 1005 }
1004 } 1006 }
1005 */ 1007 */
1006 1008
1007 // Finished decoding the entire image 1009 // Finished decoding the entire image
1008 return kSuccess; 1010 return kSuccess;
1009 } 1011 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698