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

Unified Diff: src/codec/SkWebpAdapterCodec.h

Issue 1406223002: Create an SkAndroidCodec API separate from SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Win bot fix Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | src/codec/SkWebpAdapterCodec.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkWebpAdapterCodec.h
diff --git a/src/codec/SkWebpAdapterCodec.h b/src/codec/SkWebpAdapterCodec.h
new file mode 100644
index 0000000000000000000000000000000000000000..b48f39bb60cd8eddf4faf9662b898030a9db6f06
--- /dev/null
+++ b/src/codec/SkWebpAdapterCodec.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SkWebpAdapterCodec_DEFINED
+#define SkWebpAdapterCodec_DEFINED
+
+#include "SkAndroidCodec.h"
+#include "SkWebpCodec.h"
+
+/**
+ * This class implements the functionality of SkAndroidCodec. It uses an
+ * SkWebpCodec.
+ */
+class SkWebpAdapterCodec : public SkAndroidCodec {
+public:
+
+ explicit SkWebpAdapterCodec(SkWebpCodec*);
+
+ virtual ~SkWebpAdapterCodec() {}
+
+protected:
+
+ SkEncodedFormat onGetEncodedFormat() const override { return kWEBP_SkEncodedFormat; };
+
+ SkISize onGetSampledDimensions(int sampleSize) const override;
+
+ bool onGetSupportedSubset(SkIRect* desiredSubset) const override;
+
+ SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
+ AndroidOptions& options) override;
+
+private:
+
+ SkAutoTDelete<SkWebpCodec> fCodec;
+
+ typedef SkAndroidCodec INHERITED;
+};
+#endif // SkWebpAdapterCodec_DEFINED
« no previous file with comments | « src/codec/SkSwizzler.cpp ('k') | src/codec/SkWebpAdapterCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698