| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_IPC_COPY_OUTPUT_REQUEST_STRUCT_TRAITS_H_ |
| 6 #define CC_IPC_COPY_OUTPUT_REQUEST_STRUCT_TRAITS_H_ |
| 7 |
| 8 #include "cc/ipc/copy_output_request.mojom-shared.h" |
| 9 #include "cc/output/copy_output_request.h" |
| 10 |
| 11 namespace mojo { |
| 12 |
| 13 template <> |
| 14 struct StructTraits<cc::mojom::CopyOutputRequestDataView, |
| 15 cc::CopyOutputRequest> { |
| 16 static const base::Optional<base::UnguessableToken>& source( |
| 17 const cc::CopyOutputRequest& request) { |
| 18 return request.source_; |
| 19 } |
| 20 |
| 21 static bool force_bitmap_result(const cc::CopyOutputRequest& request) { |
| 22 return request.force_bitmap_result_; |
| 23 } |
| 24 |
| 25 static const base::Optional<gfx::Rect>& area( |
| 26 const cc::CopyOutputRequest& request) { |
| 27 return request.area_; |
| 28 } |
| 29 |
| 30 static const base::Optional<cc::TextureMailbox>& texture_mailbox( |
| 31 const cc::CopyOutputRequest& request) { |
| 32 return request.texture_mailbox_; |
| 33 } |
| 34 |
| 35 static bool Read(cc::mojom::CopyOutputRequestDataView data, |
| 36 cc::CopyOutputRequest* out) { |
| 37 out->force_bitmap_result_ = data.force_bitmap_result(); |
| 38 return data.ReadSource(&out->source_) && data.ReadArea(&out->area_) && |
| 39 data.ReadTextureMailbox(&out->texture_mailbox_); |
| 40 } |
| 41 }; |
| 42 |
| 43 } // namespace mojo |
| 44 |
| 45 #endif // CC_IPC_COPY_OUTPUT_REQUEST_STRUCT_TRAITS_H_ |
| OLD | NEW |