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

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

Issue 1390213002: Add subsetting to SkScanlineDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@fill-refactor
Patch Set: Response to comments Created 5 years, 2 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 | « include/codec/SkCodec.h ('k') | src/codec/SkBmpMaskCodec.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 "SkBmpCodec.h" 8 #include "SkBmpCodec.h"
9 #include "SkBmpMaskCodec.h" 9 #include "SkBmpMaskCodec.h"
10 #include "SkBmpRLECodec.h" 10 #include "SkBmpRLECodec.h"
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 // Also set numColors to maxColors when it is too large 557 // Also set numColors to maxColors when it is too large
558 uint32_t maxColors = 1 << fBitsPerPixel; 558 uint32_t maxColors = 1 << fBitsPerPixel;
559 if (numColors == 0 || numColors >= maxColors) { 559 if (numColors == 0 || numColors >= maxColors) {
560 return maxColors; 560 return maxColors;
561 } 561 }
562 return numColors; 562 return numColors;
563 } 563 }
564 564
565 SkCodec::Result SkBmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, 565 SkCodec::Result SkBmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
566 const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputCo lorCount) { 566 const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputCo lorCount) {
567 if (options.fSubset) {
568 // Subsets are not supported.
569 return kUnimplemented;
570 }
571 if (!conversion_possible(dstInfo, this->getInfo())) { 567 if (!conversion_possible(dstInfo, this->getInfo())) {
572 SkCodecPrintf("Error: cannot convert input type to output type.\n"); 568 SkCodecPrintf("Error: cannot convert input type to output type.\n");
573 return kInvalidConversion; 569 return kInvalidConversion;
574 } 570 }
575 571
576 return prepareToDecode(dstInfo, options, inputColorPtr, inputColorCount); 572 return prepareToDecode(dstInfo, options, inputColorPtr, inputColorCount);
577 } 573 }
578 574
579 int SkBmpCodec::onGetScanlines(void* dst, int count, size_t rowBytes) { 575 int SkBmpCodec::onGetScanlines(void* dst, int count, size_t rowBytes) {
580 // Create a new image info representing the portion of the image to decode 576 // Create a new image info representing the portion of the image to decode
581 SkImageInfo rowInfo = this->dstInfo().makeWH(this->dstInfo().width(), count) ; 577 SkImageInfo rowInfo = this->dstInfo().makeWH(this->dstInfo().width(), count) ;
582 578
583 // Decode the requested rows 579 // Decode the requested rows
584 return this->decodeRows(rowInfo, dst, rowBytes, this->options()); 580 return this->decodeRows(rowInfo, dst, rowBytes, this->options());
585 } 581 }
OLDNEW
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkBmpMaskCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698