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

Unified Diff: skia/public/interfaces/bitmap_array_struct_traits.h

Issue 2096763005: Provide StructTraits for a vector<SkBitmap> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 6 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 | « skia/public/interfaces/bitmap_array.typemap ('k') | skia/public/interfaces/test/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/public/interfaces/bitmap_array_struct_traits.h
diff --git a/skia/public/interfaces/bitmap_array_struct_traits.h b/skia/public/interfaces/bitmap_array_struct_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..fff6ef33725c5e378a0a1c4d288fee19a5ea37de
--- /dev/null
+++ b/skia/public/interfaces/bitmap_array_struct_traits.h
@@ -0,0 +1,30 @@
+// 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 SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_
+#define SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_
+
+#include <vector>
+
+#include "skia/public/interfaces/bitmap_array.mojom.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<skia::mojom::BitmapArray, std::vector<SkBitmap>> {
+ static const std::vector<SkBitmap>& bitmaps(
+ const std::vector<SkBitmap>& bitmaps) {
+ return bitmaps;
+ }
+
+ static bool Read(skia::mojom::BitmapArrayDataView data,
+ std::vector<SkBitmap>* out) {
+ return data.ReadBitmaps(out);
+ }
+};
+
+} // namespace mojo
+
+#endif // SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_
« no previous file with comments | « skia/public/interfaces/bitmap_array.typemap ('k') | skia/public/interfaces/test/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698