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

Unified Diff: components/mus/public/cpp/property_type_converters.h

Issue 1824183002: Mash: Show app icons in shelf based on the Widget's app icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more review comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/public/cpp/lib/property_type_converters.cc ('k') | components/mus/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/property_type_converters.h
diff --git a/components/mus/public/cpp/property_type_converters.h b/components/mus/public/cpp/property_type_converters.h
index eac34a8ef911ccd42f4777a2136b960e71cdf413..cec17d659c612ba871b9878911b8cf9533bf5efb 100644
--- a/components/mus/public/cpp/property_type_converters.h
+++ b/components/mus/public/cpp/property_type_converters.h
@@ -11,6 +11,8 @@
#include "base/strings/string16.h"
#include "mojo/public/cpp/bindings/type_converter.h"
+class SkBitmap;
+
namespace gfx {
class Rect;
class Size;
@@ -21,6 +23,8 @@ namespace mojo {
// TODO(beng): these methods serialize types used for standard properties
// to vectors of bytes used by Window::SetSharedProperty().
// replace this with serialization code generated @ bindings.
+// This would be especially useful for SkBitmap, which could be
+// replaced with the skia.Bitmap mojom struct serialization.
template <>
struct TypeConverter<const std::vector<uint8_t>, gfx::Rect> {
@@ -67,6 +71,17 @@ struct TypeConverter<std::string, const std::vector<uint8_t>> {
static std::string Convert(const std::vector<uint8_t>& input);
};
+// NOTE: These methods only serialize and deserialize the common case of RGBA
+// 8888 bitmaps with premultiplied alpha.
+template <>
+struct TypeConverter<const std::vector<uint8_t>, SkBitmap> {
+ static const std::vector<uint8_t> Convert(const SkBitmap& input);
+};
+template <>
+struct TypeConverter<SkBitmap, const std::vector<uint8_t>> {
+ static SkBitmap Convert(const std::vector<uint8_t>& input);
+};
+
} // namespace mojo
#endif // COMPONENTS_MUS_PUBLIC_CPP_PROPERTY_TYPE_CONVERTERS_H_
« no previous file with comments | « components/mus/public/cpp/lib/property_type_converters.cc ('k') | components/mus/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698