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

Side by Side Diff: src/codec/SkBmpRLECodec.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 | « src/codec/SkBmpMaskCodec.cpp ('k') | src/codec/SkBmpStandardCodec.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 "SkBmpRLECodec.h" 8 #include "SkBmpRLECodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 // This case should not be reached. We should catch an invalid 252 // This case should not be reached. We should catch an invalid
253 // color type when we check that the conversion is possible. 253 // color type when we check that the conversion is possible.
254 SkASSERT(false); 254 SkASSERT(false);
255 break; 255 break;
256 } 256 }
257 } 257 }
258 } 258 }
259 259
260 SkCodec::Result SkBmpRLECodec::prepareToDecode(const SkImageInfo& dstInfo, 260 SkCodec::Result SkBmpRLECodec::prepareToDecode(const SkImageInfo& dstInfo,
261 const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputCo lorCount) { 261 const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputCo lorCount) {
262 // FIXME: Support subsets for scanline decodes.
263 if (options.fSubset) {
264 // Subsets are not supported.
265 return kUnimplemented;
266 }
267
262 // Reset fSampleX. If it needs to be a value other than 1, it will get modif ied by 268 // Reset fSampleX. If it needs to be a value other than 1, it will get modif ied by
263 // the sampler. 269 // the sampler.
264 fSampleX = 1; 270 fSampleX = 1;
265 // Create the color table if necessary and prepare the stream for decode 271 // Create the color table if necessary and prepare the stream for decode
266 // Note that if it is non-NULL, inputColorCount will be modified 272 // Note that if it is non-NULL, inputColorCount will be modified
267 if (!this->createColorTable(inputColorCount)) { 273 if (!this->createColorTable(inputColorCount)) {
268 SkCodecPrintf("Error: could not create color table.\n"); 274 SkCodecPrintf("Error: could not create color table.\n");
269 return SkCodec::kInvalidInput; 275 return SkCodec::kInvalidInput;
270 } 276 }
271 277
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 fSampler.reset(new SkBmpRLESampler(this)); 506 fSampler.reset(new SkBmpRLESampler(this));
501 } 507 }
502 508
503 return fSampler; 509 return fSampler;
504 } 510 }
505 511
506 int SkBmpRLECodec::setSampleX(int sampleX){ 512 int SkBmpRLECodec::setSampleX(int sampleX){
507 fSampleX = sampleX; 513 fSampleX = sampleX;
508 return get_scaled_dimension(this->getInfo().width(), sampleX); 514 return get_scaled_dimension(this->getInfo().width(), sampleX);
509 } 515 }
OLDNEW
« no previous file with comments | « src/codec/SkBmpMaskCodec.cpp ('k') | src/codec/SkBmpStandardCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698