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

Unified Diff: mojo/services/gfx/composition/cpp/formatting.cc

Issue 1748363002: Mozart: Add hit testing interfaces. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-1
Patch Set: simplify interfaces a bit Created 4 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 side-by-side diff with in-line comments
Download patch
Index: mojo/services/gfx/composition/cpp/formatting.cc
diff --git a/mojo/services/gfx/composition/cpp/formatting.cc b/mojo/services/gfx/composition/cpp/formatting.cc
index 6aefebe106dd32203e17d68b65841c755cfc5367..4666619eb9e286e76b93a03d9bf026a6199f53c8 100644
--- a/mojo/services/gfx/composition/cpp/formatting.cc
+++ b/mojo/services/gfx/composition/cpp/formatting.cc
@@ -91,8 +91,8 @@ std::ostream& operator<<(std::ostream& os,
d.Append() << "content_transform=" << value.content_transform;
if (value.content_clip)
d.Append() << "content_clip=" << value.content_clip;
- if (value.hit_id != mojo::gfx::composition::kHitIdNone)
- d.Append() << "hit_id=" << value.hit_id;
+ if (value.hit_test_behavior)
+ d.Append() << "hit_test_behavior=" << value.hit_test_behavior;
if (value.op)
d.Append() << "op=" << value.op;
d.Append() << "combinator=" << &value.combinator;
@@ -179,6 +179,58 @@ std::ostream& operator<<(std::ostream& os,
<< ", frame_deadline=" << value.frame_deadline << "}";
}
+std::ostream& operator<<(std::ostream& os,
+ const mojo::gfx::composition::HitTestBehavior& value) {
+ return os << "{visibility=" << &value.visibility << ", prune" << value.prune
+ << ", hit_rect=" << value.hit_rect << "}";
+}
+
+std::ostream& operator<<(
+ std::ostream& os,
+ const mojo::gfx::composition::HitTestBehavior::Visibility* value) {
+ switch (*value) {
+ case mojo::gfx::composition::HitTestBehavior::Visibility::OPAQUE:
+ return os << "OPAQUE";
+ case mojo::gfx::composition::HitTestBehavior::Visibility::TRANSLUCENT:
+ return os << "TRANSLUCENT";
+ case mojo::gfx::composition::HitTestBehavior::Visibility::INVISIBLE:
+ return os << "INVISIBLE";
+ default:
+ return os << "???";
+ }
+}
+
+std::ostream& operator<<(std::ostream& os,
+ const mojo::gfx::composition::HitTestResult& value) {
+ return os << "{root=" << value.root << "}";
+}
+
+std::ostream& operator<<(std::ostream& os,
+ const mojo::gfx::composition::Hit& value) {
+ os << "{";
+ if (value.is_scene()) {
+ os << "scene=" << value.get_scene();
+ } else if (value.is_node()) {
+ os << "node=" << value.get_node();
+ } else {
+ os << "???";
+ }
+ return os << "}";
+}
+
+std::ostream& operator<<(std::ostream& os,
+ const mojo::gfx::composition::SceneHit& value) {
+ return os << "{scene_token=" << value.scene_token
+ << ", scene_version=" << value.scene_version
+ << ", hits=" << value.hits << "}";
+}
+
+std::ostream& operator<<(std::ostream& os,
+ const mojo::gfx::composition::NodeHit& value) {
+ return os << "{node_id=" << value.node_id
+ << ", intersection=" << value.intersection << "}";
+}
+
} // namespace composition
} // namespace gfx
} // namespace mojo
« no previous file with comments | « mojo/services/gfx/composition/cpp/formatting.h ('k') | mojo/services/gfx/composition/interfaces/hit_tests.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698