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

Unified Diff: blimp/client/feature/compositor/decoding_image_generator.h

Issue 1680333004: Add support for encoding/decoding WebP images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@serialize-deserialize-images-framework
Patch Set: address minor last comments Created 4 years, 10 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 | « blimp/client/app/blimp_startup.cc ('k') | blimp/client/feature/compositor/decoding_image_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/client/feature/compositor/decoding_image_generator.h
diff --git a/blimp/client/feature/compositor/decoding_image_generator.h b/blimp/client/feature/compositor/decoding_image_generator.h
new file mode 100644
index 0000000000000000000000000000000000000000..1062cb85b236a1459c0ea740c4120cd02f359051
--- /dev/null
+++ b/blimp/client/feature/compositor/decoding_image_generator.h
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_DECODING_IMAGE_GENERATOR_H_
+#define BLIMP_CLIENT_FEATURE_COMPOSITOR_DECODING_IMAGE_GENERATOR_H_
+
+#include "base/macros.h"
+#include "third_party/skia/include/core/SkImageGenerator.h"
+#include "third_party/skia/include/core/SkImageInfo.h"
+
+class SkData;
+
+namespace blimp {
+namespace client {
+
+class DecodingImageGenerator : public SkImageGenerator {
+ public:
+ static SkImageGenerator* create(SkData* data);
+ explicit DecodingImageGenerator(const SkImageInfo info,
+ const void* data,
+ size_t size);
+ ~DecodingImageGenerator() override;
+
+ protected:
+ // SkImageGenerator implementation.
+ bool onGetPixels(const SkImageInfo&,
+ void* pixels,
+ size_t rowBytes,
+ SkPMColor table[],
+ int* tableCount) override;
+
+ bool onGetYUV8Planes(SkISize sizes[3],
+ void* planes[3],
+ size_t rowBytes[3],
+ SkYUVColorSpace*) override;
+
+ private:
+ SkBitmap decoded_bitmap_;
+
+ DISALLOW_COPY_AND_ASSIGN(DecodingImageGenerator);
+};
+
+} // namespace client
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_DECODING_IMAGE_GENERATOR_H_
« no previous file with comments | « blimp/client/app/blimp_startup.cc ('k') | blimp/client/feature/compositor/decoding_image_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698