summaryrefslogtreecommitdiff
path: root/libs/ui/Rect.cpp
diff options
context:
space:
mode:
author Xin Li <delphij@google.com> 2021-10-06 22:53:36 +0000
committer Xin Li <delphij@google.com> 2021-10-06 22:53:36 +0000
commit097d2a50873100486d65a69cb1cbabf37fb3b188 (patch)
treec2f19f92e4503b2de0afeebdd9bf7aeb1bb2e9c1 /libs/ui/Rect.cpp
parentcbfb18e134845deeace954bbba818acda48cb80f (diff)
parentadcb6a2733c1baf66e5ad72365965ab504f5f959 (diff)
Merge Android 12
Bug: 202323961 Merged-In: Ifb27b3eb12454fa96f07e6797745c697b4f831c4 Change-Id: I2a7f5931477fddb51564c2eabcdc96ce58888ce8
Diffstat (limited to 'libs/ui/Rect.cpp')
-rw-r--r--libs/ui/Rect.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/ui/Rect.cpp b/libs/ui/Rect.cpp
index 13fed3a239..a8d6285169 100644
--- a/libs/ui/Rect.cpp
+++ b/libs/ui/Rect.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <android-base/stringprintf.h>
#include <system/graphics.h>
#include <ui/Rect.h>
@@ -149,4 +150,13 @@ Rect Rect::reduce(const Rect& exclude) const {
return result;
}
+std::string to_string(const android::Rect& rect) {
+ return android::base::StringPrintf("Rect(%d, %d, %d, %d)", rect.left, rect.top, rect.right,
+ rect.bottom);
+}
+
+void PrintTo(const Rect& rect, ::std::ostream* os) {
+ *os << to_string(rect);
+}
+
}; // namespace android