OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkImage.h" | 10 #include "SkImage.h" |
11 #include "SkImageDecoder.h" | 11 #include "SkImageDecoder.h" |
12 #include "SkImageEncoder.h" | 12 #include "SkImageEncoder.h" |
13 #include "SkMovie.h" | 13 #include "SkMovie.h" |
| 14 #include "SkPixelSerializer.h" |
14 #include "SkStream.h" | 15 #include "SkStream.h" |
15 | 16 |
16 class SkColorTable; | 17 class SkColorTable; |
17 class SkPngChunkReader; | 18 class SkPngChunkReader; |
18 | 19 |
19 // Empty implementations for SkImageDecoder. | 20 // Empty implementations for SkImageDecoder. |
20 | 21 |
21 SkImageDecoder::SkImageDecoder() {} | 22 SkImageDecoder::SkImageDecoder() {} |
22 | 23 |
23 SkImageDecoder::~SkImageDecoder() {} | 24 SkImageDecoder::~SkImageDecoder() {} |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 102 |
102 SkData* SkImageEncoder::EncodeData(const SkBitmap&, Type, int quality) { | 103 SkData* SkImageEncoder::EncodeData(const SkBitmap&, Type, int quality) { |
103 return nullptr; | 104 return nullptr; |
104 } | 105 } |
105 | 106 |
106 SkData* SkImageEncoder::EncodeData(const SkImageInfo&, const void* pixels, size_
t rowBytes, | 107 SkData* SkImageEncoder::EncodeData(const SkImageInfo&, const void* pixels, size_
t rowBytes, |
107 Type, int quality) { | 108 Type, int quality) { |
108 return nullptr; | 109 return nullptr; |
109 } | 110 } |
110 | 111 |
| 112 SkData* SkImageEncoder::EncodeData(const SkPixmap&, Type, int) { |
| 113 return nullptr; |
| 114 } |
| 115 |
111 bool SkImageEncoder::encodeStream(SkWStream*, const SkBitmap&, int) { | 116 bool SkImageEncoder::encodeStream(SkWStream*, const SkBitmap&, int) { |
112 return false; | 117 return false; |
113 } | 118 } |
114 | 119 |
115 SkData* SkImageEncoder::encodeData(const SkBitmap&, int) { | 120 SkData* SkImageEncoder::encodeData(const SkBitmap&, int) { |
116 return nullptr; | 121 return nullptr; |
117 } | 122 } |
118 | 123 |
119 bool SkImageEncoder::encodeFile(const char file[], const SkBitmap& bm, int quali
ty) { | 124 bool SkImageEncoder::encodeFile(const char file[], const SkBitmap& bm, int quali
ty) { |
120 return false; | 125 return false; |
121 } | 126 } |
| 127 |
| 128 namespace { |
| 129 class ImageEncoderPixelSerializer final : public SkPixelSerializer { |
| 130 protected: |
| 131 bool onUseEncodedData(const void*, size_t) override { return true; } |
| 132 SkData* onEncode(const SkPixmap&) override { return nullptr; } |
| 133 }; |
| 134 } // namespace |
| 135 |
| 136 SkPixelSerializer* SkImageEncoder::CreatePixelSerializer() { |
| 137 return new ImageEncoderPixelSerializer; |
| 138 } |
| 139 |
122 ///////////////////////////////////////////////////////////////////////// | 140 ///////////////////////////////////////////////////////////////////////// |
OLD | NEW |