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

Side by Side Diff: src/codec/SkCodec_libbmp.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_libbmp.h" 8 #include "SkCodec_libbmp.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 default: 1127 default:
1128 SkASSERT(false); 1128 SkASSERT(false);
1129 return kInvalidInput; 1129 return kInvalidInput;
1130 } 1130 }
1131 1131
1132 // Get a pointer to the color table if it exists 1132 // Get a pointer to the color table if it exists
1133 const SkPMColor* colorPtr = NULL != fColorTable.get() ? fColorTable->readCol ors() : NULL; 1133 const SkPMColor* colorPtr = NULL != fColorTable.get() ? fColorTable->readCol ors() : NULL;
1134 1134
1135 // Create swizzler 1135 // Create swizzler
1136 SkAutoTDelete<SkSwizzler> swizzler(SkSwizzler::CreateSwizzler(config, 1136 SkAutoTDelete<SkSwizzler> swizzler(SkSwizzler::CreateSwizzler(config,
1137 colorPtr, dstInfo, dst, dstRowBytes, kNo_ZeroInitialized)); 1137 colorPtr, dstInfo, dst, dstRowBytes, kNo_ZeroInitialized, opts.fSamp leX));
scroggo 2015/07/28 15:58:10 If we're going to pass zeroInitialized (which is a
1138 1138
1139 // Allocate space for a row buffer and a source for the swizzler 1139 // Allocate space for a row buffer and a source for the swizzler
1140 SkAutoTDeleteArray<uint8_t> srcBuffer(SkNEW_ARRAY(uint8_t, rowBytes)); 1140 SkAutoTDeleteArray<uint8_t> srcBuffer(SkNEW_ARRAY(uint8_t, rowBytes));
1141 1141
1142 // Iterate over rows of the image 1142 // Iterate over rows of the image
1143 // FIXME: bool transparent = true; 1143 // FIXME: bool transparent = true;
1144 for (int y = 0; y < height; y++) { 1144 for (int y = 0; y < height; y++) {
1145 // Read a row of the input 1145 // Read a row of the input
1146 if (stream()->read(srcBuffer.get(), rowBytes) != rowBytes) { 1146 if (stream()->read(srcBuffer.get(), rowBytes) != rowBytes) {
1147 SkCodecPrintf("Warning: incomplete input stream.\n"); 1147 SkCodecPrintf("Warning: incomplete input stream.\n");
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 uint32_t alphaBit = 1225 uint32_t alphaBit =
1226 (srcBuffer.get()[quotient] >> shift) & 0x1; 1226 (srcBuffer.get()[quotient] >> shift) & 0x1;
1227 dstRow[x] &= alphaBit - 1; 1227 dstRow[x] &= alphaBit - 1;
1228 } 1228 }
1229 } 1229 }
1230 } 1230 }
1231 1231
1232 // Finished decoding the entire image 1232 // Finished decoding the entire image
1233 return kSuccess; 1233 return kSuccess;
1234 } 1234 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698