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

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

Issue 1445313002: Make SkAndroidCodec support gif (Closed) Base URL: https://skia.googlesource.com/skia.git@bmp
Patch Set: Response to comments Created 5 years, 1 month 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/SkCodec_libgif.cpp ('k') | src/codec/SkSwizzler.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.h" 8 #include "SkCodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkMath.h" 10 #include "SkMath.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 if (!fCodec->skipScanlines(sampleY - 1)) { 219 if (!fCodec->skipScanlines(sampleY - 1)) {
220 fCodec->fillIncompleteImage(info, pixels, rowBytes, 220 fCodec->fillIncompleteImage(info, pixels, rowBytes,
221 options.fZeroInitialized, dstHeight, y + 1); 221 options.fZeroInitialized, dstHeight, y + 1);
222 return SkCodec::kIncompleteInput; 222 return SkCodec::kIncompleteInput;
223 } 223 }
224 } 224 }
225 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes); 225 pixelPtr = SkTAddOffset<void>(pixelPtr, rowBytes);
226 } 226 }
227 return SkCodec::kSuccess; 227 return SkCodec::kSuccess;
228 } 228 }
229 case SkCodec::kOutOfOrder_SkScanlineOrder:
229 case SkCodec::kBottomUp_SkScanlineOrder: { 230 case SkCodec::kBottomUp_SkScanlineOrder: {
230 // Note that this mode does not support subsetting. 231 // Note that these modes do not support subsetting.
231 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight); 232 SkASSERT(0 == subsetY && nativeSize.height() == subsetHeight);
232 int y; 233 int y;
233 for (y = 0; y < nativeSize.height(); y++) { 234 for (y = 0; y < nativeSize.height(); y++) {
234 int srcY = fCodec->nextScanline(); 235 int srcY = fCodec->nextScanline();
235 if (is_coord_necessary(srcY, sampleY, dstHeight)) { 236 if (is_coord_necessary(srcY, sampleY, dstHeight)) {
236 void* pixelPtr = SkTAddOffset<void>(pixels, 237 void* pixelPtr = SkTAddOffset<void>(pixels,
237 rowBytes * get_dst_coord(srcY, sampleY)); 238 rowBytes * get_dst_coord(srcY, sampleY));
238 if (1 != fCodec->getScanlines(pixelPtr, 1, rowBytes)) { 239 if (1 != fCodec->getScanlines(pixelPtr, 1, rowBytes)) {
239 break; 240 break;
240 } 241 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // fCodec has already handled filling uninitialized memory. 287 // fCodec has already handled filling uninitialized memory.
287 return SkCodec::kIncompleteInput; 288 return SkCodec::kIncompleteInput;
288 } 289 }
289 return SkCodec::kSuccess; 290 return SkCodec::kSuccess;
290 } 291 }
291 default: 292 default:
292 SkASSERT(false); 293 SkASSERT(false);
293 return SkCodec::kUnimplemented; 294 return SkCodec::kUnimplemented;
294 } 295 }
295 } 296 }
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libgif.cpp ('k') | src/codec/SkSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698