Chromium Code Reviews| 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 "SkColorTable.h" | 9 #include "SkColorTable.h" |
| 10 #include "SkImageInfo.h" | 10 #include "SkImageInfo.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 | 49 |
| 50 /* | 50 /* |
| 51 * Creates the color table | 51 * Creates the color table |
| 52 * Sets colorCount to the new color count if it is non-NULL | 52 * Sets colorCount to the new color count if it is non-NULL |
| 53 */ | 53 */ |
| 54 bool createColorTable(int* colorCount); | 54 bool createColorTable(int* colorCount); |
| 55 | 55 |
| 56 bool initializeStreamBuffer(); | 56 bool initializeStreamBuffer(); |
| 57 | 57 |
| 58 /* | 58 /* |
| 59 * It is possible for an encoded image stream to contain more encoded data t han | |
| 60 * it reports that it has. Before signalling kIncompleteInput, we should ch eck | |
|
scroggo
2015/08/12 14:14:30
Maybe this should say something like:
Before sign
msarett
2015/08/12 15:01:24
Agreed. Done.
| |
| 61 * if we can reset the stream buffer with additional data. | |
| 62 * | |
| 63 * @return the number of bytes remaining in the new stream buffer | |
|
scroggo
2015/08/12 14:14:30
nit: In my mind, the stream buffer itself is not n
msarett
2015/08/12 15:01:24
Yeah agreed. I need the remove the work "new" fro
| |
| 64 */ | |
| 65 size_t resetStreamBuffer(); | |
|
scroggo
2015/08/12 14:14:30
I'm not a big fan of the name. It doesn't really e
msarett
2015/08/12 15:01:24
I like checkForMoreData.
| |
| 66 | |
| 67 /* | |
| 59 * Set an RLE pixel using the color table | 68 * Set an RLE pixel using the color table |
| 60 */ | 69 */ |
| 61 void setPixel(void* dst, size_t dstRowBytes, | 70 void setPixel(void* dst, size_t dstRowBytes, |
| 62 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, | 71 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, |
| 63 uint8_t index); | 72 uint8_t index); |
| 64 /* | 73 /* |
| 65 * Set an RLE24 pixel from R, G, B values | 74 * Set an RLE24 pixel from R, G, B values |
| 66 */ | 75 */ |
| 67 void setRGBPixel(void* dst, size_t dstRowBytes, | 76 void setRGBPixel(void* dst, size_t dstRowBytes, |
| 68 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, | 77 const SkImageInfo& dstInfo, uint32_t x, uint32_t y, |
| 69 uint8_t red, uint8_t green, uint8_t blue); | 78 uint8_t red, uint8_t green, uint8_t blue); |
| 70 | 79 |
| 71 /* | 80 /* |
| 72 * Performs the bitmap decoding for RLE input format | 81 * Performs the bitmap decoding for RLE input format |
| 73 */ | 82 */ |
| 74 Result decode(const SkImageInfo& dstInfo, void* dst, | 83 Result decode(const SkImageInfo& dstInfo, void* dst, |
| 75 size_t dstRowBytes, const Options& opts); | 84 size_t dstRowBytes, const Options& opts); |
| 76 | 85 |
| 77 SkAutoTUnref<SkColorTable> fColorTable; // owned | 86 SkAutoTUnref<SkColorTable> fColorTable; // owned |
| 78 const uint32_t fNumColors; | 87 const uint32_t fNumColors; |
| 79 const uint32_t fBytesPerColor; | 88 const uint32_t fBytesPerColor; |
| 80 const uint32_t fOffset; | 89 const uint32_t fOffset; |
| 81 SkAutoTDeleteArray<uint8_t> fStreamBuffer; | 90 SkAutoTDeleteArray<uint8_t> fStreamBuffer; |
| 82 size_t fRLEBytes; | 91 size_t fRLEBytes; |
| 83 uint32_t fCurrRLEByte; | 92 uint32_t fCurrRLEByte; |
| 84 | 93 |
| 85 typedef SkBmpCodec INHERITED; | 94 typedef SkBmpCodec INHERITED; |
| 86 }; | 95 }; |
| OLD | NEW |