OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <ostream> |
| 6 |
| 7 #include "mojo/services/geometry/cpp/logging.h" |
| 8 |
| 9 namespace mojo { |
| 10 |
| 11 std::ostream& operator<<(std::ostream& os, const mojo::Point& value) { |
| 12 return os << "{x=" << value.x << ", y=" << value.y << "}"; |
| 13 } |
| 14 |
| 15 std::ostream& operator<<(std::ostream& os, const mojo::Size& value) { |
| 16 return os << "{width=" << value.width << ", height=" << value.height << "}"; |
| 17 } |
| 18 |
| 19 std::ostream& operator<<(std::ostream& os, const mojo::Rect& value) { |
| 20 return os << "{x=" << value.x << ", y=" << value.y |
| 21 << ", width=" << value.width << ", height=" << value.height << "}"; |
| 22 } |
| 23 |
| 24 std::ostream& operator<<(std::ostream& os, const mojo::RRect& value) { |
| 25 return os << "{x=" << value.x << ", y=" << value.y |
| 26 << ", width=" << value.width << ", height=" << value.height |
| 27 << ", top_left_radius_x=" << value.top_left_radius_x |
| 28 << ", top_left_radius_y=" << value.top_left_radius_y |
| 29 << ", top_right_radius_x=" << value.top_right_radius_x |
| 30 << ", top_right_radius_y=" << value.top_right_radius_y |
| 31 << ", bottom_left_radius_x=" << value.bottom_left_radius_x |
| 32 << ", bottom_left_radius_y=" << value.bottom_left_radius_y |
| 33 << ", bottom_right_radius_x=" << value.bottom_right_radius_x |
| 34 << ", bottom_right_radius_y=" << value.bottom_right_radius_y << "}"; |
| 35 } |
| 36 |
| 37 std::ostream& operator<<(std::ostream& os, const mojo::Transform& value) { |
| 38 if (value.matrix) { |
| 39 os << "["; |
| 40 for (size_t i = 0; i < 4; i++) { |
| 41 if (i != 0) |
| 42 os << ", "; |
| 43 os << "["; |
| 44 for (size_t j = 0; j < 4; j++) { |
| 45 if (j != 0) |
| 46 os << ", "; |
| 47 os << value.matrix[i * 4 + j]; |
| 48 } |
| 49 os << "]"; |
| 50 } |
| 51 os << "]"; |
| 52 } else { |
| 53 os << "null"; |
| 54 } |
| 55 return os; |
| 56 } |
| 57 |
| 58 } // namespace mojo |
OLD | NEW |