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 #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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 NULL, 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; | |
| 67 | |
| 66 /* | 68 /* |
| 67 * Rewinds the image stream if necessary | 69 * Returns whether this BMP is part of an ICO image. |
| 68 */ | 70 */ |
| 69 bool handleRewind(bool inIco); | 71 bool inIco() const { |
|
scroggo_chromium
2015/08/11 16:29:42
This split follows the convention we follow for pu
msarett
2015/08/12 13:38:46
I don't feel strongly on this. Looks fine to me.
| |
| 72 return this->onInIco(); | |
| 73 } | |
| 74 | |
| 75 virtual bool onInIco() const { | |
| 76 return false; | |
| 77 } | |
| 70 | 78 |
| 71 /* | 79 /* |
| 72 * Get the destination row to start filling from | 80 * Get the destination row to start filling from |
| 73 * Used to fill the remainder of the image on incomplete input for bmps | 81 * Used to fill the remainder of the image on incomplete input for bmps |
| 74 * This is tricky since bmps may be kTopDown or kBottomUp. For kTopDown, | 82 * This is tricky since bmps may be kTopDown or kBottomUp. For kTopDown, |
| 75 * we start filling from where we left off, but for kBottomUp we start | 83 * we start filling from where we left off, but for kBottomUp we start |
| 76 * filling at the top of the image. | 84 * filling at the top of the image. |
| 77 */ | 85 */ |
| 78 void* getDstStartRow(void* dst, size_t dstRowBytes, int32_t y) const; | 86 void* getDstStartRow(void* dst, size_t dstRowBytes, int32_t y) const; |
| 79 | 87 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 96 */ | 104 */ |
| 97 static SkCodec* NewFromStream(SkStream*, bool inIco); | 105 static SkCodec* NewFromStream(SkStream*, bool inIco); |
| 98 | 106 |
| 99 const uint16_t fBitsPerPixel; | 107 const uint16_t fBitsPerPixel; |
| 100 const RowOrder fRowOrder; | 108 const RowOrder fRowOrder; |
| 101 | 109 |
| 102 typedef SkCodec INHERITED; | 110 typedef SkCodec INHERITED; |
| 103 }; | 111 }; |
| 104 | 112 |
| 105 #endif | 113 #endif |
| OLD | NEW |