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" |
| 11 #include "SkColorTable.h" | 11 #include "SkColorTable.h" |
| 12 #include "SkImageInfo.h" | 12 #include "SkImageInfo.h" |
| 13 #include "SkStream.h" | 13 #include "SkStream.h" |
| 14 #include "SkSwizzler.h" | 14 #include "SkSwizzler.h" |
| 15 #include "SkTypes.h" | 15 #include "SkTypes.h" |
| 16 | 16 |
| 17 /* | 17 /* |
| 18 * This class enables code sharing between its bmp codec subclasses. The | 18 * This class enables code sharing between its bmp codec subclasses. The |
| 19 * subclasses actually do the work. | 19 * subclasses actually do the work. |
| 20 */ | 20 */ |
| 21 class SkBmpCodec : public SkCodec { | 21 class SkBmpCodec : public SkCodec { |
| 22 public: | 22 public: |
| 23 | 23 static bool IsBmp(const char*, size_t); |
|
reed1
2015/12/08 15:04:57
const void* ?
In general, skia always uses void*
scroggo
2015/12/08 18:35:44
Done.
| |
| 24 /* | |
| 25 * Checks the start of the stream to see if the image is a bmp | |
| 26 */ | |
| 27 static bool IsBmp(SkStream*); | |
| 28 | 24 |
| 29 /* | 25 /* |
| 30 * Assumes IsBmp was called and returned true | 26 * Assumes IsBmp was called and returned true |
| 31 * Creates a bmp decoder | 27 * Creates a bmp decoder |
| 32 * Reads enough of the stream to determine the image format | 28 * Reads enough of the stream to determine the image format |
| 33 */ | 29 */ |
| 34 static SkCodec* NewFromStream(SkStream*); | 30 static SkCodec* NewFromStream(SkStream*); |
| 35 | 31 |
| 36 /* | 32 /* |
| 37 * Creates a bmp decoder for a bmp embedded in ico | 33 * Creates a bmp decoder for a bmp embedded in ico |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 | 139 |
| 144 // TODO(msarett): Override default skipping with something more clever. | 140 // TODO(msarett): Override default skipping with something more clever. |
| 145 | 141 |
| 146 const uint16_t fBitsPerPixel; | 142 const uint16_t fBitsPerPixel; |
| 147 const SkScanlineOrder fRowOrder; | 143 const SkScanlineOrder fRowOrder; |
| 148 | 144 |
| 149 typedef SkCodec INHERITED; | 145 typedef SkCodec INHERITED; |
| 150 }; | 146 }; |
| 151 | 147 |
| 152 #endif | 148 #endif |
| OLD | NEW |