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 "SkCodecPriv.h" | 10 #include "SkCodecPriv.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 #ifdef SK_CODEC_DECODES_RAW | 101 #ifdef SK_CODEC_DECODES_RAW |
102 // Try to treat the input as RAW if all the other checks failed. | 102 // Try to treat the input as RAW if all the other checks failed. |
103 return SkRawCodec::NewFromStream(streamDeleter.release()); | 103 return SkRawCodec::NewFromStream(streamDeleter.release()); |
104 #endif | 104 #endif |
105 } | 105 } |
106 | 106 |
107 return nullptr; | 107 return nullptr; |
108 } | 108 } |
109 | 109 |
110 SkCodec* SkCodec::NewFromData(SkData* data, SkPngChunkReader* reader) { | 110 SkCodec* SkCodec::NewFromData(sk_sp<SkData> data, SkPngChunkReader* reader) { |
111 if (!data) { | 111 if (!data) { |
112 return nullptr; | 112 return nullptr; |
113 } | 113 } |
114 return NewFromStream(new SkMemoryStream(data), reader); | 114 return NewFromStream(new SkMemoryStream(data), reader); |
115 } | 115 } |
116 | 116 |
117 SkCodec::SkCodec(int width, int height, const SkEncodedInfo& info, SkStream* str
eam, | 117 SkCodec::SkCodec(int width, int height, const SkEncodedInfo& info, SkStream* str
eam, |
118 sk_sp<SkColorSpace> colorSpace, Origin origin) | 118 sk_sp<SkColorSpace> colorSpace, Origin origin) |
119 : fEncodedInfo(info) | 119 : fEncodedInfo(info) |
120 , fSrcInfo(info.makeImageInfo(width, height, std::move(colorSpace))) | 120 , fSrcInfo(info.makeImageInfo(width, height, std::move(colorSpace))) |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); | 393 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); |
394 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); | 394 const SkImageInfo fillInfo = info.makeWH(fillWidth, 1); |
395 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { | 395 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { |
396 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); | 396 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); |
397 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); | 397 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); |
398 } | 398 } |
399 break; | 399 break; |
400 } | 400 } |
401 } | 401 } |
402 } | 402 } |
OLD | NEW |