Chromium Code Reviews| 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. | |
|
msarett
2015/10/07 22:15:14
This is broken. Will fix later.
| |
| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 496 fSampler.reset(new SkBmpRLESampler(this)); | 502 fSampler.reset(new SkBmpRLESampler(this)); |
| 497 } | 503 } |
| 498 | 504 |
| 499 return fSampler; | 505 return fSampler; |
| 500 } | 506 } |
| 501 | 507 |
| 502 int SkBmpRLECodec::setSampleX(int sampleX){ | 508 int SkBmpRLECodec::setSampleX(int sampleX){ |
| 503 fSampleX = sampleX; | 509 fSampleX = sampleX; |
| 504 return get_scaled_dimension(this->getInfo().width(), sampleX); | 510 return get_scaled_dimension(this->getInfo().width(), sampleX); |
| 505 } | 511 } |
| OLD | NEW |