OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ | 5 #ifndef CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ |
6 #define CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ | 6 #define CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ |
7 | 7 |
8 #include "cc/ipc/copy_output_result.mojom-shared.h" | 8 #include "cc/ipc/copy_output_result.mojom-shared.h" |
| 9 #include "cc/ipc/texture_mailbox_releaser.mojom.h" |
9 #include "cc/ipc/texture_mailbox_struct_traits.h" | 10 #include "cc/ipc/texture_mailbox_struct_traits.h" |
10 #include "cc/output/copy_output_result.h" | 11 #include "cc/output/copy_output_result.h" |
11 #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h" | 12 #include "skia/public/interfaces/bitmap_skbitmap_struct_traits.h" |
12 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" | 13 #include "ui/gfx/geometry/mojo/geometry_struct_traits.h" |
13 | 14 |
14 namespace mojo { | 15 namespace mojo { |
15 | 16 |
16 template <> | 17 template <> |
17 struct StructTraits<cc::mojom::CopyOutputResultDataView, | 18 struct StructTraits<cc::mojom::CopyOutputResultDataView, |
18 std::unique_ptr<cc::CopyOutputResult>> { | 19 std::unique_ptr<cc::CopyOutputResult>> { |
19 static const gfx::Size& size( | 20 static const gfx::Size& size( |
20 const std::unique_ptr<cc::CopyOutputResult>& result) { | 21 const std::unique_ptr<cc::CopyOutputResult>& result) { |
21 return result->size_; | 22 return result->size_; |
22 } | 23 } |
23 | 24 |
24 static const SkBitmap& bitmap( | 25 static const SkBitmap& bitmap( |
25 const std::unique_ptr<cc::CopyOutputResult>& result); | 26 const std::unique_ptr<cc::CopyOutputResult>& result); |
26 | 27 |
27 static const cc::TextureMailbox& texture_mailbox( | 28 static const cc::TextureMailbox& texture_mailbox( |
28 const std::unique_ptr<cc::CopyOutputResult>& result) { | 29 const std::unique_ptr<cc::CopyOutputResult>& result) { |
29 return result->texture_mailbox_; | 30 return result->texture_mailbox_; |
30 } | 31 } |
31 | 32 |
| 33 static cc::mojom::TextureMailboxReleaserPtr releaser( |
| 34 const std::unique_ptr<cc::CopyOutputResult>& result); |
| 35 |
32 static bool Read(cc::mojom::CopyOutputResultDataView data, | 36 static bool Read(cc::mojom::CopyOutputResultDataView data, |
33 std::unique_ptr<cc::CopyOutputResult>* out_p); | 37 std::unique_ptr<cc::CopyOutputResult>* out_p); |
34 }; | 38 }; |
35 | 39 |
36 } // namespace mojo | 40 } // namespace mojo |
37 | 41 |
38 #endif // CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ | 42 #endif // CC_IPC_COPY_OUTPUT_RESULT_STRUCT_TRAITS_H_ |
OLD | NEW |