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

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

Issue 1006583005: SkCodec: add wbmp class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-03-27 (Friday) 10:53:14 EDT Created 5 years, 8 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_wbmp.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_libpng.h" 8 #include "SkCodec_libpng.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // FIXME: Here is where we should likely insert some of the modifications 413 // FIXME: Here is where we should likely insert some of the modifications
414 // made in the factory. 414 // made in the factory.
415 png_read_update_info(fPng_ptr, fInfo_ptr); 415 png_read_update_info(fPng_ptr, fInfo_ptr);
416 416
417 return kSuccess; 417 return kSuccess;
418 } 418 }
419 419
420 SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst, 420 SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst,
421 size_t rowBytes, const Options& options, 421 size_t rowBytes, const Options& options,
422 SkPMColor ctable[], int* ctableCount) { 422 SkPMColor ctable[], int* ctableCount) {
423 if (!this->rewindIfNeeded()) { 423 SkCodec::RewindState rewindState = this->rewindIfNeeded();
424 if (rewindState == kCouldNotRewind_RewindState) {
425 return kCouldNotRewind;
426 } else if (rewindState == kRewound_RewindState) {
427 // TODO(scroggo): handle rewinds
424 return kCouldNotRewind; 428 return kCouldNotRewind;
425 } 429 }
426 if (requestedInfo.dimensions() != this->getInfo().dimensions()) { 430 if (requestedInfo.dimensions() != this->getInfo().dimensions()) {
427 return kInvalidScale; 431 return kInvalidScale;
428 } 432 }
429 if (!conversion_possible(requestedInfo, this->getInfo())) { 433 if (!conversion_possible(requestedInfo, this->getInfo())) {
430 return kInvalidConversion; 434 return kInvalidConversion;
431 } 435 }
432 436
433 const Result result = this->initializeSwizzler(requestedInfo, dst, rowBytes, 437 const Result result = this->initializeSwizzler(requestedInfo, dst, rowBytes,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 576
573 SkASSERT(fNumberPasses != INVALID_NUMBER_PASSES); 577 SkASSERT(fNumberPasses != INVALID_NUMBER_PASSES);
574 if (fNumberPasses > 1) { 578 if (fNumberPasses > 1) {
575 // We cannot efficiently do scanline decoding. 579 // We cannot efficiently do scanline decoding.
576 return NULL; 580 return NULL;
577 } 581 }
578 582
579 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, this)); 583 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, this));
580 } 584 }
581 585
OLDNEW
« no previous file with comments | « src/codec/SkCodec_libbmp.cpp ('k') | src/codec/SkCodec_wbmp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698