Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: src/codec/SkBmpCodec.h

Issue 1472123002: Make SkCodec support peek() and read() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkBmpCodec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 void*, size_t);
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 134
139 // TODO(msarett): Override default skipping with something more clever. 135 // TODO(msarett): Override default skipping with something more clever.
140 136
141 const uint16_t fBitsPerPixel; 137 const uint16_t fBitsPerPixel;
142 const SkScanlineOrder fRowOrder; 138 const SkScanlineOrder fRowOrder;
143 139
144 typedef SkCodec INHERITED; 140 typedef SkCodec INHERITED;
145 }; 141 };
146 142
147 #endif 143 #endif
OLDNEW
« no previous file with comments | « include/codec/SkCodec.h ('k') | src/codec/SkBmpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698