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

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

Issue 1240143002: Add the ability to decode a subset to SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix some conversion warning/errors. Created 5 years, 5 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 | « src/codec/SkCodec_libbmp.cpp ('k') | src/codec/SkCodec_libico.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 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_libgif.h" 8 #include "SkCodec_libgif.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 GifFileType* gifOut = NULL; 250 GifFileType* gifOut = NULL;
251 if (!ReadHeader(this->stream(), NULL, &gifOut)) { 251 if (!ReadHeader(this->stream(), NULL, &gifOut)) {
252 return kCouldNotRewind; 252 return kCouldNotRewind;
253 } else { 253 } else {
254 SkASSERT(NULL != gifOut); 254 SkASSERT(NULL != gifOut);
255 fGif.reset(gifOut); 255 fGif.reset(gifOut);
256 } 256 }
257 } 257 }
258 258
259 // Check for valid input parameters 259 // Check for valid input parameters
260 if (opts.fSubset) {
261 // Subsets are not supported.
262 return kUnimplemented;
263 }
260 if (dstInfo.dimensions() != this->getInfo().dimensions()) { 264 if (dstInfo.dimensions() != this->getInfo().dimensions()) {
261 return gif_error("Scaling not supported.\n", kInvalidScale); 265 return gif_error("Scaling not supported.\n", kInvalidScale);
262 } 266 }
263 if (!conversion_possible(dstInfo, this->getInfo())) { 267 if (!conversion_possible(dstInfo, this->getInfo())) {
264 return gif_error("Cannot convert input type to output type.\n", 268 return gif_error("Cannot convert input type to output type.\n",
265 kInvalidConversion); 269 kInvalidConversion);
266 } 270 }
267 271
268 // Use this as a container to hold information about any gif extension 272 // Use this as a container to hold information about any gif extension
269 // blocks. This generally stores transparency and animation instructions. 273 // blocks. This generally stores transparency and animation instructions.
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 // giflib returns an error code if the record type is not known. 565 // giflib returns an error code if the record type is not known.
562 // We should catch this error immediately. 566 // We should catch this error immediately.
563 SkASSERT(false); 567 SkASSERT(false);
564 break; 568 break;
565 } 569 }
566 } while (TERMINATE_RECORD_TYPE != recordType); 570 } while (TERMINATE_RECORD_TYPE != recordType);
567 571
568 return gif_error("Could not find any images to decode in gif file.\n", 572 return gif_error("Could not find any images to decode in gif file.\n",
569 kInvalidInput); 573 kInvalidInput);
570 } 574 }
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libbmp.cpp ('k') | src/codec/SkCodec_libico.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698