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

Side by Side Diff: src/codec/SkCodec_libpng.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_libico.cpp ('k') | src/codec/SkCodec_wbmp.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_libpng.h" 8 #include "SkCodec_libpng.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 return false; 510 return false;
511 } 511 }
512 } 512 }
513 513
514 SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst, 514 SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst,
515 size_t rowBytes, const Options& options, 515 size_t rowBytes, const Options& options,
516 SkPMColor ctable[], int* ctableCount) { 516 SkPMColor ctable[], int* ctableCount) {
517 if (!conversion_possible(requestedInfo, this->getInfo())) { 517 if (!conversion_possible(requestedInfo, this->getInfo())) {
518 return kInvalidConversion; 518 return kInvalidConversion;
519 } 519 }
520 if (options.fSubset) {
521 // Subsets are not supported.
522 return kUnimplemented;
523 }
520 if (requestedInfo.dimensions() != this->getInfo().dimensions()) { 524 if (requestedInfo.dimensions() != this->getInfo().dimensions()) {
521 return kInvalidScale; 525 return kInvalidScale;
522 } 526 }
523 if (!this->handleRewind()) { 527 if (!this->handleRewind()) {
524 return kCouldNotRewind; 528 return kCouldNotRewind;
525 } 529 }
526 530
527 // Note that ctable and ctableCount may be modified if there is a color tabl e 531 // Note that ctable and ctableCount may be modified if there is a color tabl e
528 const Result result = this->initializeSwizzler(requestedInfo, dst, rowBytes, 532 const Result result = this->initializeSwizzler(requestedInfo, dst, rowBytes,
529 options, ctable, ctableCount) ; 533 options, ctable, ctableCount) ;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 764
761 SkASSERT(codec->fNumberPasses != INVALID_NUMBER_PASSES); 765 SkASSERT(codec->fNumberPasses != INVALID_NUMBER_PASSES);
762 if (codec->fNumberPasses > 1) { 766 if (codec->fNumberPasses > 1) {
763 // interlaced image 767 // interlaced image
764 return SkNEW_ARGS(SkPngInterlacedScanlineDecoder, (dstInfo, codec.detach ())); 768 return SkNEW_ARGS(SkPngInterlacedScanlineDecoder, (dstInfo, codec.detach ()));
765 } 769 }
766 770
767 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, codec.detach())); 771 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, codec.detach()));
768 } 772 }
769 773
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libico.cpp ('k') | src/codec/SkCodec_wbmp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698