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 "SkScanlineDecoder.h" | 8 #include "SkScanlineDecoder.h" |
9 #include "SkCodec_libpng.h" | 9 #include "SkCodec_libpng.h" |
10 #include "SkCodec_wbmp.h" | 10 #include "SkCodec_wbmp.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return NULL; | 55 return NULL; |
56 } else { | 56 } else { |
57 return codec.detach(); | 57 return codec.detach(); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 SkScanlineDecoder* SkScanlineDecoder::NewFromData(SkData* data) { | 61 SkScanlineDecoder* SkScanlineDecoder::NewFromData(SkData* data) { |
62 if (!data) { | 62 if (!data) { |
63 return NULL; | 63 return NULL; |
64 } | 64 } |
65 return NewFromStream(SkNEW_ARGS(SkMemoryStream, (data))); | 65 return NewFromStream(new SkMemoryStream(data)); |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo, | 69 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo, |
70 const SkCodec::Options* options, SkPMColor ctable[], int* ctableCount) { | 70 const SkCodec::Options* options, SkPMColor ctable[], int* ctableCount) { |
71 // Ensure that valid color ptrs are passed in for kIndex8 color type | 71 // Ensure that valid color ptrs are passed in for kIndex8 color type |
72 if (kIndex_8_SkColorType == dstInfo.colorType()) { | 72 if (kIndex_8_SkColorType == dstInfo.colorType()) { |
73 if (NULL == ctable || NULL == ctableCount) { | 73 if (NULL == ctable || NULL == ctableCount) { |
74 return SkCodec::kInvalidParameters; | 74 return SkCodec::kInvalidParameters; |
75 } | 75 } |
(...skipping 18 matching lines...) Expand all Loading... |
94 | 94 |
95 fCurrScanline = 0; | 95 fCurrScanline = 0; |
96 fDstInfo = dstInfo; | 96 fDstInfo = dstInfo; |
97 return SkCodec::kSuccess; | 97 return SkCodec::kSuccess; |
98 } | 98 } |
99 | 99 |
100 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) { | 100 SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) { |
101 return this->start(dstInfo, NULL, NULL, NULL); | 101 return this->start(dstInfo, NULL, NULL, NULL); |
102 } | 102 } |
103 | 103 |
OLD | NEW |