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

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-26 (Thursday) 15:46:11 EDT Created 5 years, 9 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_libpng.h" 8 #include "SkCodec_libpng.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 // FIXME: Here is where we should likely insert some of the modifications 410 // FIXME: Here is where we should likely insert some of the modifications
411 // made in the factory. 411 // made in the factory.
412 png_read_update_info(fPng_ptr, fInfo_ptr); 412 png_read_update_info(fPng_ptr, fInfo_ptr);
413 413
414 return kSuccess; 414 return kSuccess;
415 } 415 }
416 416
417 SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst, 417 SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst,
418 size_t rowBytes, const Options& options, 418 size_t rowBytes, const Options& options,
419 SkPMColor ctable[], int* ctableCount) { 419 SkPMColor ctable[], int* ctableCount) {
420 if (!this->rewindIfNeeded()) { 420 SkCodec::RewindState rewindState = this->rewindIfNeeded();
421 if (rewindState == kCouldNotRewind_RewindState) {
422 return kCouldNotRewind;
423 } else if (rewindState == kRewound_RewindState) {
424 // TODO(scroggo): handle rewinds
421 return kCouldNotRewind; 425 return kCouldNotRewind;
422 } 426 }
423 if (requestedInfo.dimensions() != this->getInfo().dimensions()) { 427 if (requestedInfo.dimensions() != this->getInfo().dimensions()) {
424 return kInvalidScale; 428 return kInvalidScale;
425 } 429 }
426 if (!conversion_possible(requestedInfo, this->getInfo())) { 430 if (!conversion_possible(requestedInfo, this->getInfo())) {
427 return kInvalidConversion; 431 return kInvalidConversion;
428 } 432 }
429 433
430 const Result result = this->initializeSwizzler(requestedInfo, dst, rowBytes, 434 const Result result = this->initializeSwizzler(requestedInfo, dst, rowBytes,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 573
570 SkASSERT(fNumberPasses != INVALID_NUMBER_PASSES); 574 SkASSERT(fNumberPasses != INVALID_NUMBER_PASSES);
571 if (fNumberPasses > 1) { 575 if (fNumberPasses > 1) {
572 // We cannot efficiently do scanline decoding. 576 // We cannot efficiently do scanline decoding.
573 return NULL; 577 return NULL;
574 } 578 }
575 579
576 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, this)); 580 return SkNEW_ARGS(SkPngScanlineDecoder, (dstInfo, this));
577 } 581 }
578 582
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698