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 #ifndef SkBmpCodec_DEFINED | 7 #ifndef SkBmpCodec_DEFINED |
8 #define SkBmpCodec_DEFINED | 8 #define SkBmpCodec_DEFINED |
9 | 9 |
10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 protected: | 51 protected: |
52 | 52 |
53 SkBmpCodec(const SkImageInfo& info, SkStream* stream, uint16_t bitsPerPixel, | 53 SkBmpCodec(const SkImageInfo& info, SkStream* stream, uint16_t bitsPerPixel, |
54 RowOrder rowOrder); | 54 RowOrder rowOrder); |
55 | 55 |
56 SkEncodedFormat onGetEncodedFormat() const override { return kBMP_SkEncodedF
ormat; } | 56 SkEncodedFormat onGetEncodedFormat() const override { return kBMP_SkEncodedF
ormat; } |
57 | 57 |
58 /* | 58 /* |
59 * Read enough of the stream to initialize the SkBmpCodec. Returns a bool | 59 * Read enough of the stream to initialize the SkBmpCodec. Returns a bool |
60 * representing success or failure. If it returned true, and codecOut was | 60 * representing success or failure. If it returned true, and codecOut was |
61 * not NULL, it will be set to a new SkBmpCodec. | 61 * not nullptr, it will be set to a new SkBmpCodec. |
62 * Does *not* take ownership of the passed in SkStream. | 62 * Does *not* take ownership of the passed in SkStream. |
63 */ | 63 */ |
64 static bool ReadHeader(SkStream*, bool inIco, SkCodec** codecOut); | 64 static bool ReadHeader(SkStream*, bool inIco, SkCodec** codecOut); |
65 | 65 |
66 bool onRewind() override; | 66 bool onRewind() override; |
67 | 67 |
68 /* | 68 /* |
69 * Returns whether this BMP is part of an ICO image. | 69 * Returns whether this BMP is part of an ICO image. |
70 */ | 70 */ |
71 bool inIco() const { | 71 bool inIco() const { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 */ | 104 */ |
105 static SkCodec* NewFromStream(SkStream*, bool inIco); | 105 static SkCodec* NewFromStream(SkStream*, bool inIco); |
106 | 106 |
107 const uint16_t fBitsPerPixel; | 107 const uint16_t fBitsPerPixel; |
108 const RowOrder fRowOrder; | 108 const RowOrder fRowOrder; |
109 | 109 |
110 typedef SkCodec INHERITED; | 110 typedef SkCodec INHERITED; |
111 }; | 111 }; |
112 | 112 |
113 #endif | 113 #endif |
OLD | NEW |