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

Side by Side 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: Created 4 years, 5 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_
6 #define SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_
7
8 #include <vector>
9
10 #include "skia/public/interfaces/bitmap_array.mojom.h"
11 #include "third_party/skia/include/core/SkBitmap.h"
12
13 namespace mojo {
14
15 template <>
16 struct StructTraits<skia::mojom::BitmapArray, std::vector<SkBitmap>> {
17 static const std::vector<SkBitmap>& bitmaps(
18 const std::vector<SkBitmap>& bitmaps) {
19 return bitmaps;
20 }
21
22 static bool Read(skia::mojom::BitmapArrayDataView data,
23 std::vector<SkBitmap>* out) {
24 std::vector<SkBitmap> bitmaps;
25 if (!data.ReadBitmaps(&bitmaps))
Fady Samuel 2016/06/23 21:45:12 It seems like you could simply: data.ReadBitmaps(
rjkroege 2016/06/24 14:13:20 Thanks. Done.
26 return false;
27 *out = std::move(bitmaps);
28 return true;
29 }
30 };
31
32 } // namespace mojo
33
34 #endif // SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_
OLDNEW
« 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