OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "mojo/services/gfx/composition/cpp/formatting.h" | 5 #include "mojo/services/gfx/composition/cpp/formatting.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 std::ostream& operator<<(std::ostream& os, | 86 std::ostream& operator<<(std::ostream& os, |
87 const mojo::gfx::composition::Node& value) { | 87 const mojo::gfx::composition::Node& value) { |
88 os << "{"; | 88 os << "{"; |
89 Delimiter d(os); | 89 Delimiter d(os); |
90 if (value.content_transform) | 90 if (value.content_transform) |
91 d.Append() << "content_transform=" << value.content_transform; | 91 d.Append() << "content_transform=" << value.content_transform; |
92 if (value.content_clip) | 92 if (value.content_clip) |
93 d.Append() << "content_clip=" << value.content_clip; | 93 d.Append() << "content_clip=" << value.content_clip; |
94 if (value.hit_id != mojo::gfx::composition::kHitIdNone) | 94 if (value.hit_test_behavior) |
95 d.Append() << "hit_id=" << value.hit_id; | 95 d.Append() << "hit_test_behavior=" << value.hit_test_behavior; |
96 if (value.op) | 96 if (value.op) |
97 d.Append() << "op=" << value.op; | 97 d.Append() << "op=" << value.op; |
98 d.Append() << "combinator=" << &value.combinator; | 98 d.Append() << "combinator=" << &value.combinator; |
99 if (value.child_node_ids) | 99 if (value.child_node_ids) |
100 d.Append() << "child_node_ids=" << value.child_node_ids; | 100 d.Append() << "child_node_ids=" << value.child_node_ids; |
101 return os << "}"; | 101 return os << "}"; |
102 } | 102 } |
103 | 103 |
104 std::ostream& operator<<( | 104 std::ostream& operator<<( |
105 std::ostream& os, | 105 std::ostream& os, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return os << "{alpha=" << static_cast<int>(value.alpha) << "}"; | 172 return os << "{alpha=" << static_cast<int>(value.alpha) << "}"; |
173 } | 173 } |
174 | 174 |
175 std::ostream& operator<<(std::ostream& os, | 175 std::ostream& operator<<(std::ostream& os, |
176 const mojo::gfx::composition::FrameInfo& value) { | 176 const mojo::gfx::composition::FrameInfo& value) { |
177 return os << "{frame_time=" << value.frame_time | 177 return os << "{frame_time=" << value.frame_time |
178 << ", frame_interval=" << value.frame_interval | 178 << ", frame_interval=" << value.frame_interval |
179 << ", frame_deadline=" << value.frame_deadline << "}"; | 179 << ", frame_deadline=" << value.frame_deadline << "}"; |
180 } | 180 } |
181 | 181 |
| 182 std::ostream& operator<<(std::ostream& os, |
| 183 const mojo::gfx::composition::HitTestBehavior& value) { |
| 184 return os << "{visibility=" << &value.visibility << ", prune" << value.prune |
| 185 << ", hit_rect=" << value.hit_rect << "}"; |
| 186 } |
| 187 |
| 188 std::ostream& operator<<( |
| 189 std::ostream& os, |
| 190 const mojo::gfx::composition::HitTestBehavior::Visibility* value) { |
| 191 switch (*value) { |
| 192 case mojo::gfx::composition::HitTestBehavior::Visibility::OPAQUE: |
| 193 return os << "OPAQUE"; |
| 194 case mojo::gfx::composition::HitTestBehavior::Visibility::TRANSLUCENT: |
| 195 return os << "TRANSLUCENT"; |
| 196 case mojo::gfx::composition::HitTestBehavior::Visibility::INVISIBLE: |
| 197 return os << "INVISIBLE"; |
| 198 default: |
| 199 return os << "???"; |
| 200 } |
| 201 } |
| 202 |
| 203 std::ostream& operator<<(std::ostream& os, |
| 204 const mojo::gfx::composition::HitTestResult& value) { |
| 205 return os << "{root=" << value.root << "}"; |
| 206 } |
| 207 |
| 208 std::ostream& operator<<(std::ostream& os, |
| 209 const mojo::gfx::composition::Hit& value) { |
| 210 os << "{"; |
| 211 if (value.is_scene()) { |
| 212 os << "scene=" << value.get_scene(); |
| 213 } else if (value.is_node()) { |
| 214 os << "node=" << value.get_node(); |
| 215 } else { |
| 216 os << "???"; |
| 217 } |
| 218 return os << "}"; |
| 219 } |
| 220 |
| 221 std::ostream& operator<<(std::ostream& os, |
| 222 const mojo::gfx::composition::SceneHit& value) { |
| 223 return os << "{scene_token=" << value.scene_token |
| 224 << ", scene_version=" << value.scene_version |
| 225 << ", hits=" << value.hits << "}"; |
| 226 } |
| 227 |
| 228 std::ostream& operator<<(std::ostream& os, |
| 229 const mojo::gfx::composition::NodeHit& value) { |
| 230 return os << "{node_id=" << value.node_id |
| 231 << ", intersection=" << value.intersection << "}"; |
| 232 } |
| 233 |
182 } // namespace composition | 234 } // namespace composition |
183 } // namespace gfx | 235 } // namespace gfx |
184 } // namespace mojo | 236 } // namespace mojo |
OLD | NEW |