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

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

Issue 1044433002: Add SkWebpCodec, for decoding .webp images. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 8 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 #ifndef SkWebpCodec_DEFINED
9 #define SkWebpCodec_DEFINED
10
11 #include "SkCodec.h"
12 #include "SkEncodedFormat.h"
13 #include "SkImageInfo.h"
14 #include "SkTypes.h"
15
16 class SkStream;
17
18 class SkWebpCodec final : public SkCodec {
19 public:
20 // Assumes IsWebp was called and returned true.
21 static SkCodec* NewFromStream(SkStream*);
22 static bool IsWebp(SkStream*);
23 protected:
24 Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&, SkPMCo lor*, int*)
25 override;
26 SkEncodedFormat onGetEncodedFormat() const override { return kWEBP_SkEncoded Format; }
27
28 bool onReallyHasAlpha() const override {
29 return this->getInfo().alphaType() != kOpaque_SkAlphaType;
30 }
31
32 SkISize onGetScaledDimensions(float desiredScale) const override;
33 private:
34 SkWebpCodec(const SkImageInfo&, SkStream*);
35
36 typedef SkCodec INHERITED;
37 };
38 #endif // SkWebpCodec_DEFINED
OLDNEW
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkWebpCodec.cpp » ('j') | src/codec/SkWebpCodec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698