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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 * when we want to decode the full or one when we are | 74 * when we want to decode the full or one when we are |
75 * sampling. | 75 * sampling. |
76 */ | 76 */ |
77 int32_t getDstRow(int32_t y, int32_t height) const; | 77 int32_t getDstRow(int32_t y, int32_t height) const; |
78 | 78 |
79 /* | 79 /* |
80 * Accessors used by subclasses | 80 * Accessors used by subclasses |
81 */ | 81 */ |
82 uint16_t bitsPerPixel() const { return fBitsPerPixel; } | 82 uint16_t bitsPerPixel() const { return fBitsPerPixel; } |
83 SkScanlineOrder onGetScanlineOrder() const override { return fRowOrder; } | 83 SkScanlineOrder onGetScanlineOrder() const override { return fRowOrder; } |
| 84 size_t srcRowBytes() const { return fSrcRowBytes; } |
84 | 85 |
85 /* | 86 /* |
86 * To be overriden by bmp subclasses, which provide unique implementations. | 87 * To be overriden by bmp subclasses, which provide unique implementations. |
87 * Performs subclass specific setup. | 88 * Performs subclass specific setup. |
88 * | 89 * |
89 * @param dstInfo Contains output information. Height specifies | 90 * @param dstInfo Contains output information. Height specifies |
90 * the total number of rows that will be decoded. | 91 * the total number of rows that will be decoded. |
91 * @param options Additonal options to pass to the decoder. | 92 * @param options Additonal options to pass to the decoder. |
92 * @param inputColorPtr Client-provided memory for a color table. Must | 93 * @param inputColorPtr Client-provided memory for a color table. Must |
93 * be enough for 256 colors. This will be | 94 * be enough for 256 colors. This will be |
(...skipping 26 matching lines...) Expand all Loading... |
120 * | 121 * |
121 * @param dstInfo Contains output information. Height specifies the | 122 * @param dstInfo Contains output information. Height specifies the |
122 * number of rows to decode at this time. | 123 * number of rows to decode at this time. |
123 * @param dst Memory location to store output pixels | 124 * @param dst Memory location to store output pixels |
124 * @param dstRowBytes Bytes in a row of the destination | 125 * @param dstRowBytes Bytes in a row of the destination |
125 * @return Number of rows successfully decoded | 126 * @return Number of rows successfully decoded |
126 */ | 127 */ |
127 virtual int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowB
ytes, | 128 virtual int decodeRows(const SkImageInfo& dstInfo, void* dst, size_t dstRowB
ytes, |
128 const Options& opts) = 0; | 129 const Options& opts) = 0; |
129 | 130 |
| 131 virtual bool skipRows(int count); |
| 132 |
130 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti
ons&, | 133 Result onStartScanlineDecode(const SkImageInfo& dstInfo, const SkCodec::Opti
ons&, |
131 SkPMColor inputColorPtr[], int* inputColorCount) override; | 134 SkPMColor inputColorPtr[], int* inputColorCount) override; |
132 | 135 |
133 int onGetScanlines(void* dst, int count, size_t rowBytes) override; | 136 int onGetScanlines(void* dst, int count, size_t rowBytes) override; |
134 | 137 |
135 // TODO(msarett): Override default skipping with something more clever. | 138 bool onSkipScanlines(int count) override; |
136 | 139 |
137 const uint16_t fBitsPerPixel; | 140 const uint16_t fBitsPerPixel; |
138 const SkScanlineOrder fRowOrder; | 141 const SkScanlineOrder fRowOrder; |
| 142 const size_t fSrcRowBytes; |
139 | 143 |
140 typedef SkCodec INHERITED; | 144 typedef SkCodec INHERITED; |
141 }; | 145 }; |
142 | 146 |
143 #endif | 147 #endif |
OLD | NEW |