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

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

Issue 2088603002: Implement RenderPass StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 4 years, 6 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 | « cc/ipc/render_pass.typemap ('k') | cc/ipc/render_pass_struct_traits.cc » ('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 CC_IPC_RENDER_PASS_STRUCT_TRAITS_H_
6 #define CC_IPC_RENDER_PASS_STRUCT_TRAITS_H_
7
8 #include "cc/ipc/quads_struct_traits.h"
9 #include "cc/ipc/render_pass.mojom.h"
10 #include "cc/ipc/render_pass_id_struct_traits.h"
11 #include "cc/quads/render_pass.h"
12 #include "ui/gfx/mojo/transform_struct_traits.h"
13
14 namespace mojo {
15
16 template <>
17 struct StructTraits<cc::mojom::RenderPass, std::unique_ptr<cc::RenderPass>> {
18 static void* SetUpContext(const std::unique_ptr<cc::RenderPass>& input);
19 static void TearDownContext(const std::unique_ptr<cc::RenderPass>& input,
20 void* context);
21
22 static const cc::RenderPassId& id(
23 const std::unique_ptr<cc::RenderPass>& input) {
24 return input->id;
25 }
26
27 static const gfx::Rect& output_rect(
28 const std::unique_ptr<cc::RenderPass>& input) {
29 return input->output_rect;
30 }
31
32 static const gfx::Rect& damage_rect(
33 const std::unique_ptr<cc::RenderPass>& input) {
34 return input->damage_rect;
35 }
36
37 static const gfx::Transform& transform_to_root_target(
38 const std::unique_ptr<cc::RenderPass>& input) {
39 return input->transform_to_root_target;
40 }
41
42 static bool has_transparent_background(
43 const std::unique_ptr<cc::RenderPass>& input) {
44 return input->has_transparent_background;
45 }
46
47 static const cc::QuadList& quad_list(
48 const std::unique_ptr<cc::RenderPass>& input) {
49 return input->quad_list;
50 }
51
52 static const mojo::Array<uint32_t>& shared_quad_state_references(
53 const std::unique_ptr<cc::RenderPass>& input,
54 void* context) {
55 return *static_cast<mojo::Array<uint32_t>*>(context);
56 }
57
58 static const cc::SharedQuadStateList& shared_quad_state_list(
59 const std::unique_ptr<cc::RenderPass>& input) {
60 return input->shared_quad_state_list;
61 }
62
63 static bool Read(cc::mojom::RenderPassDataView data,
64 std::unique_ptr<cc::RenderPass>* out);
65 };
66
67 } // namespace mojo
68
69 #endif // CC_IPC_RENDER_PASS_STRUCT_TRAITS_H_
OLDNEW
« no previous file with comments | « cc/ipc/render_pass.typemap ('k') | cc/ipc/render_pass_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698