OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_ | 5 #ifndef SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_ |
6 #define SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_ | 6 #define SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "skia/public/interfaces/bitmap_array.mojom.h" | 10 #include "skia/public/interfaces/bitmap_array.mojom.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 | 14 |
15 template <> | 15 template <> |
16 struct StructTraits<skia::mojom::BitmapArray, std::vector<SkBitmap>> { | 16 struct StructTraits<skia::mojom::BitmapArrayDataView, std::vector<SkBitmap>> { |
17 static const std::vector<SkBitmap>& bitmaps( | 17 static const std::vector<SkBitmap>& bitmaps( |
18 const std::vector<SkBitmap>& bitmaps) { | 18 const std::vector<SkBitmap>& bitmaps) { |
19 return bitmaps; | 19 return bitmaps; |
20 } | 20 } |
21 | 21 |
22 static bool Read(skia::mojom::BitmapArrayDataView data, | 22 static bool Read(skia::mojom::BitmapArrayDataView data, |
23 std::vector<SkBitmap>* out) { | 23 std::vector<SkBitmap>* out) { |
24 return data.ReadBitmaps(out); | 24 return data.ReadBitmaps(out); |
25 } | 25 } |
26 }; | 26 }; |
27 | 27 |
28 } // namespace mojo | 28 } // namespace mojo |
29 | 29 |
30 #endif // SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_ | 30 #endif // SKIA_PUBLIC_INTERFACES_BITMAP_ARRAY_STRUCT_TRAITS_H_ |
OLD | NEW |