| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 | 8 |
| 9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 , fPreferQualityOverSpeed(false) | 43 , fPreferQualityOverSpeed(false) |
| 44 , fRequireUnpremultipliedColors(false) { | 44 , fRequireUnpremultipliedColors(false) { |
| 45 } | 45 } |
| 46 | 46 |
| 47 SkImageDecoder::~SkImageDecoder() { | 47 SkImageDecoder::~SkImageDecoder() { |
| 48 SkSafeUnref(fPeeker); | 48 SkSafeUnref(fPeeker); |
| 49 SkSafeUnref(fChooser); | 49 SkSafeUnref(fChooser); |
| 50 SkSafeUnref(fAllocator); | 50 SkSafeUnref(fAllocator); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void SkImageDecoder::copyFieldsToOther(SkImageDecoder* other) { |
| 54 if (NULL == other) { |
| 55 return; |
| 56 } |
| 57 other->setPeeker(fPeeker); |
| 58 other->setChooser(fChooser); |
| 59 other->setAllocator(fAllocator); |
| 60 other->setSampleSize(fSampleSize); |
| 61 if (fUsePrefTable) { |
| 62 other->setPrefConfigTable(fPrefTable); |
| 63 } else { |
| 64 other->fDefaultPref = fDefaultPref; |
| 65 } |
| 66 other->setPreferQualityOverSpeed(fPreferQualityOverSpeed); |
| 67 other->setRequireUnpremultipliedColors(fRequireUnpremultipliedColors); |
| 68 } |
| 69 |
| 53 SkImageDecoder::Format SkImageDecoder::getFormat() const { | 70 SkImageDecoder::Format SkImageDecoder::getFormat() const { |
| 54 return kUnknown_Format; | 71 return kUnknown_Format; |
| 55 } | 72 } |
| 56 | 73 |
| 57 const char* SkImageDecoder::getFormatName() const { | 74 const char* SkImageDecoder::getFormatName() const { |
| 58 return GetFormatName(this->getFormat()); | 75 return GetFormatName(this->getFormat()); |
| 59 } | 76 } |
| 60 | 77 |
| 61 const char* SkImageDecoder::GetFormatName(Format format) { | 78 const char* SkImageDecoder::GetFormatName(Format format) { |
| 62 switch (format) { | 79 switch (format) { |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 if (kUnknown_Format == *format) { | 461 if (kUnknown_Format == *format) { |
| 445 if (stream->rewind()) { | 462 if (stream->rewind()) { |
| 446 *format = GetStreamFormat(stream); | 463 *format = GetStreamFormat(stream); |
| 447 } | 464 } |
| 448 } | 465 } |
| 449 } | 466 } |
| 450 delete codec; | 467 delete codec; |
| 451 } | 468 } |
| 452 return success; | 469 return success; |
| 453 } | 470 } |
| OLD | NEW |