Commit 3d1cba08 authored by Stephen Chenney's avatar Stephen Chenney Committed by Commit Bot

[CI] Add logging ToString to LayoutRectOutsets

LayoutRectOutsets appear in painting code and are otherwise cumbersome to log.

R=pdr@chromium.org

Change-Id: Iab1cb66b3692bf48250d896e0448dfbd8e3ee8ec
Reviewed-on: https://chromium-review.googlesource.com/1078938Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563030}
parent e7f95160
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <algorithm> #include <algorithm>
#include "third_party/blink/renderer/platform/wtf/assertions.h" #include "third_party/blink/renderer/platform/wtf/assertions.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink { namespace blink {
...@@ -49,4 +50,16 @@ void LayoutRectOutsets::Unite(const LayoutRectOutsets& other) { ...@@ -49,4 +50,16 @@ void LayoutRectOutsets::Unite(const LayoutRectOutsets& other) {
left_ = std::max(left_, other.left_); left_ = std::max(left_, other.left_);
} }
std::ostream& operator<<(std::ostream& ostream,
const LayoutRectOutsets& outsets) {
return ostream << outsets.ToString();
}
String LayoutRectOutsets::ToString() const {
return String::Format(
"top %s; right %s; bottom %s; left %s", Top().ToString().Ascii().data(),
Right().ToString().Ascii().data(), Bottom().ToString().Ascii().data(),
Left().ToString().Ascii().data());
}
} // namespace blink } // namespace blink
...@@ -97,6 +97,8 @@ class PLATFORM_EXPORT LayoutRectOutsets { ...@@ -97,6 +97,8 @@ class PLATFORM_EXPORT LayoutRectOutsets {
Bottom() == other.Bottom() && Left() == other.Left(); Bottom() == other.Bottom() && Left() == other.Left();
} }
String ToString() const;
private: private:
LayoutUnit top_; LayoutUnit top_;
LayoutUnit right_; LayoutUnit right_;
...@@ -145,6 +147,9 @@ inline LayoutRectOutsets EnclosingLayoutRectOutsets( ...@@ -145,6 +147,9 @@ inline LayoutRectOutsets EnclosingLayoutRectOutsets(
LayoutUnit::FromFloatCeil(rect.Left())); LayoutUnit::FromFloatCeil(rect.Left()));
} }
PLATFORM_EXPORT std::ostream& operator<<(std::ostream&,
const LayoutRectOutsets&);
} // namespace blink } // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GEOMETRY_LAYOUT_RECT_OUTSETS_H_ #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GEOMETRY_LAYOUT_RECT_OUTSETS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment