OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |