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