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

Unified Diff: mojo/services/geometry/cpp/logging.cc

Issue 1517853002: Extend the geometry APIs. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years 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/geometry/cpp/logging.cc
diff --git a/mojo/services/geometry/cpp/logging.cc b/mojo/services/geometry/cpp/logging.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b05f1440d218397a2e8e6148518653fc1b883da9
--- /dev/null
+++ b/mojo/services/geometry/cpp/logging.cc
@@ -0,0 +1,58 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/geometry/cpp/logging.h"
+
+namespace mojo {
+
+std::ostream& operator<<(std::ostream& os, const mojo::Point& value) {
+ return os << "{x=" << value.x << ", y=" << value.y << "}";
+}
+
+std::ostream& operator<<(std::ostream& os, const mojo::Size& value) {
+ return os << "{width=" << value.width << ", height=" << value.height << "}";
+}
+
+std::ostream& operator<<(std::ostream& os, const mojo::Rect& value) {
+ return os << "{x=" << value.x << ", y=" << value.y
+ << ", width=" << value.width << ", height=" << value.height << "}";
+}
+
+std::ostream& operator<<(std::ostream& os, const mojo::RRect& value) {
+ return os << "{x=" << value.x << ", y=" << value.y
+ << ", width=" << value.width << ", height=" << value.height
+ << ", top_left_radius_x=" << value.top_left_radius_x
+ << ", top_left_radius_y=" << value.top_left_radius_y
+ << ", top_right_radius_x=" << value.top_right_radius_x
+ << ", top_right_radius_y=" << value.top_right_radius_y
+ << ", bottom_left_radius_x=" << value.bottom_left_radius_x
+ << ", bottom_left_radius_y=" << value.bottom_left_radius_y
+ << ", bottom_right_radius_x=" << value.bottom_right_radius_x
+ << ", bottom_right_radius_y=" << value.bottom_right_radius_y << "}";
+}
+
+std::ostream& operator<<(std::ostream& os, const mojo::Transform& value) {
+ if (value.matrix) {
+ os << "[";
+ for (size_t i = 0; i < 4; i++) {
+ if (i != 0)
+ os << ", ";
+ os << "[";
+ for (size_t j = 0; j < 4; j++) {
+ if (j != 0)
+ os << ", ";
+ os << value.matrix[i * 4 + j];
+ }
+ os << "]";
+ }
+ os << "]";
+ } else {
+ os << "null";
+ }
+ return os;
+
+ return os << value.matrix;
viettrungluu 2015/12/11 00:15:13 Delete.
jeffbrown 2015/12/11 19:40:55 Gahh... thanks.
+}
+
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698