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

Side by Side Diff: cc/ipc/copy_output_request_struct_traits.h

Issue 2655963006: Implemented StructTraits for cc::CopyOutputRequest (Closed)
Patch Set: c Created 3 years, 10 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
OLDNEW
(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 bool force_bitmap_result(const cc::CopyOutputRequest& request) {
17 return request.force_bitmap_result_;
18 }
19
20 static const base::Optional<gfx::Rect>& area(
21 const cc::CopyOutputRequest& request) {
22 return request.area_;
23 }
24
25 static const base::Optional<cc::TextureMailbox>& texture_mailbox(
26 const cc::CopyOutputRequest& request) {
27 return request.texture_mailbox_;
28 }
29
30 static bool Read(cc::mojom::CopyOutputRequestDataView data,
31 cc::CopyOutputRequest* out) {
32 out->force_bitmap_result_ = data.force_bitmap_result();
33 return data.ReadArea(&out->area_) &&
34 data.ReadTextureMailbox(&out->texture_mailbox_);
35 }
36 };
37
38 } // namespace mojo
39
40 #endif // CC_IPC_COPY_OUTPUT_REQUEST_STRUCT_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698