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

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

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

Powered by Google App Engine
This is Rietveld 408576698