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

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

Issue 1011343003: Enabling ico decoding with use of png and bmp decoders (Closed) Base URL: https://skia.googlesource.com/skia.git@swizzle
Patch Set: Provide the user with an option of which ico to decode Created 5 years, 9 months 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkCodec.h"
9 #include "SkImageInfo.h"
10 #include "SkStream.h"
11 #include "SkTypes.h"
12
13 /*
14 * This class implements the decoding for bmp images
15 */
16 class SkIcoCodec : public SkCodec {
17 public:
18
19 /*
20 * Checks the start of the stream to see if the image is a Ico or Cur
21 */
22 static bool IsIco(SkStream*);
23
24 /*
25 * Assumes IsIco was called and returned true
26 * Creates an Ico decoder
27 * Reads enough of the stream to determine the image format
28 */
29 static SkCodec* NewFromStream(SkStream*);
30
31 protected:
32
33 /*
34 * Initiates the Ico decode
35 */
36 virtual Result onGetPixels(const SkImageInfo& dstInfo, void* dst,
37 size_t dstRowBytes, const Options&, SkPMColor*,
38 int*) SK_OVERRIDE;
39
40 private:
41
42 /*
43 * Constructor called by NewFromStream
44 * @param embeddedCode codec for the embedded image
45 */
46 SkIcoCodec(const SkImageInfo& srcInfo, SkCodec** embeddedCodecs,
47 uint32_t numImages);
48
49 SkAutoTDeleteArray<SkCodec*> fEmbeddedCodecs; // owned
50 const uint32_t fNumImages;
51
52 typedef SkCodec INHERITED;
53 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698