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 "SkBmpCodec.h" | 8 #include "SkBmpCodec.h" |
9 #include "SkCodec.h" | 9 #include "SkCodec.h" |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 return NULL; | 65 return NULL; |
66 } else { | 66 } else { |
67 return codec.detach(); | 67 return codec.detach(); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 SkCodec* SkCodec::NewFromData(SkData* data) { | 71 SkCodec* SkCodec::NewFromData(SkData* data) { |
72 if (!data) { | 72 if (!data) { |
73 return NULL; | 73 return NULL; |
74 } | 74 } |
75 return NewFromStream(SkNEW_ARGS(SkMemoryStream, (data))); | 75 return NewFromStream(new SkMemoryStream(data)); |
76 } | 76 } |
77 | 77 |
78 SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream) | 78 SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream) |
79 : fInfo(info) | 79 : fInfo(info) |
80 , fStream(stream) | 80 , fStream(stream) |
81 , fNeedsRewind(false) | 81 , fNeedsRewind(false) |
82 {} | 82 {} |
83 | 83 |
84 SkCodec::~SkCodec() {} | 84 SkCodec::~SkCodec() {} |
85 | 85 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 if ((kIncompleteInput == result || kSuccess == result) && ctableCount) { | 142 if ((kIncompleteInput == result || kSuccess == result) && ctableCount) { |
143 SkASSERT(*ctableCount >= 0 && *ctableCount <= 256); | 143 SkASSERT(*ctableCount >= 0 && *ctableCount <= 256); |
144 } | 144 } |
145 return result; | 145 return result; |
146 } | 146 } |
147 | 147 |
148 SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t
rowBytes) { | 148 SkCodec::Result SkCodec::getPixels(const SkImageInfo& info, void* pixels, size_t
rowBytes) { |
149 return this->getPixels(info, pixels, rowBytes, NULL, NULL, NULL); | 149 return this->getPixels(info, pixels, rowBytes, NULL, NULL, NULL); |
150 } | 150 } |
OLD | NEW |