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

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

Issue 1010903003: Add scanline decoding to SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove testing only changes. 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_libbmp.h" 8 #include "SkCodec_libbmp.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 * 452 *
453 */ 453 */
454 SkCodec::Result SkBmpCodec::onGetPixels(const SkImageInfo& dstInfo, 454 SkCodec::Result SkBmpCodec::onGetPixels(const SkImageInfo& dstInfo,
455 void* dst, size_t dstRowBytes, 455 void* dst, size_t dstRowBytes,
456 const Options&, 456 const Options&,
457 SkPMColor*, int*) { 457 SkPMColor*, int*) {
458 // Check for proper input and output formats 458 // Check for proper input and output formats
459 if (!this->rewindIfNeeded()) { 459 if (!this->rewindIfNeeded()) {
460 return kCouldNotRewind; 460 return kCouldNotRewind;
461 } 461 }
462 if (dstInfo.dimensions() != this->getOriginalInfo().dimensions()) { 462 if (dstInfo.dimensions() != this->getInfo().dimensions()) {
463 SkDebugf("Error: scaling not supported.\n"); 463 SkDebugf("Error: scaling not supported.\n");
464 return kInvalidScale; 464 return kInvalidScale;
465 } 465 }
466 if (!conversion_possible(dstInfo, this->getOriginalInfo())) { 466 if (!conversion_possible(dstInfo, this->getInfo())) {
467 SkDebugf("Error: cannot convert input type to output type.\n"); 467 SkDebugf("Error: cannot convert input type to output type.\n");
468 return kInvalidConversion; 468 return kInvalidConversion;
469 } 469 }
470 470
471 // Create the color table if necessary and prepare the stream for decode 471 // Create the color table if necessary and prepare the stream for decode
472 if (!createColorTable(dstInfo.alphaType())) { 472 if (!createColorTable(dstInfo.alphaType())) {
473 SkDebugf("Error: could not create color table.\n"); 473 SkDebugf("Error: could not create color table.\n");
474 return kInvalidInput; 474 return kInvalidInput;
475 } 475 }
476 476
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 } 1002 }
1003 dstRow = SkTAddOffset<SkPMColor>(dstRow, dstRowBytes); 1003 dstRow = SkTAddOffset<SkPMColor>(dstRow, dstRowBytes);
1004 } 1004 }
1005 } 1005 }
1006 } 1006 }
1007 */ 1007 */
1008 1008
1009 // Finished decoding the entire image 1009 // Finished decoding the entire image
1010 return kSuccess; 1010 return kSuccess;
1011 } 1011 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698