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

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

Issue 1254483004: Scanline decoding for wbmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments 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 "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 const Result result = this->onGetPixels(info, pixels, rowBytes, *options, ct able, ctableCount); 127 const Result result = this->onGetPixels(info, pixels, rowBytes, *options, ct able, ctableCount);
128 128
129 if ((kIncompleteInput == result || kSuccess == result) && ctableCount) { 129 if ((kIncompleteInput == result || kSuccess == result) && ctableCount) {
130 SkASSERT(*ctableCount >= 0 && *ctableCount <= 256); 130 SkASSERT(*ctableCount >= 0 && *ctableCount <= 256);
131 } 131 }
132 return result; 132 return result;
133 } 133 }
134 134
135 SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) { 135 SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes) {
136 SkASSERT(kIndex_8_SkColorType != info.colorType()); 136 SkASSERT(kIndex_8_SkColorType != info.colorType());
137 if (kIndex_8_SkColorType == info.colorType()) { 137 if (kIndex_8_SkColorType == info.colorType()) {
scroggo 2015/08/05 14:36:20 For consistency, I think you should also remove th
emmaleer 2015/08/05 15:06:55 Why would we need this check, if we assert above t
scroggo 2015/08/05 15:23:16 For running in release. ASSERTs only happen in deb
msarett 2015/08/05 15:29:42 I'm wondering if this is an argument for me to add
msarett 2015/08/05 15:29:42 Done.
scroggo 2015/08/05 17:55:37 Yes, I think the assert here would be good.
msarett 2015/08/05 18:50:33 Per our discussion in person, I'm not adding an as
scroggo 2015/08/05 19:35:38 An alternative I just thought of - we could have t
138 return kInvalidConversion; 138 return kInvalidConversion;
139 } 139 }
140 return this->getPixels(info, pixels, rowBytes, NULL, NULL, NULL); 140 return this->getPixels(info, pixels, rowBytes, NULL, NULL, NULL);
141 } 141 }
142
OLDNEW
« no previous file with comments | « resources/index8.png ('k') | src/codec/SkCodecPriv.h » ('j') | src/codec/SkCodecPriv.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698