Bug 1419247 - Allow Stringify() to support nsSize. draft
authorKuoE0 <kuoe0.tw@gmail.com>
Mon, 20 Nov 2017 17:39:38 +0800
changeset 701009 52f27dad4fda4d87a79cc247230eb807d9199001
parent 697453 e1d7427787f7a26983c92ea1a1ac99eb863edd6c
child 741051 d7e65b61928e2aa9f1fe68344f276301c783735f
push id90026
push userbmo:kuoe0@mozilla.com
push dateTue, 21 Nov 2017 03:03:34 +0000
bugs1419247
milestone59.0a1
Bug 1419247 - Allow Stringify() to support nsSize. MozReview-Commit-ID: 5OU6Db5z29S
gfx/layers/LayersLogging.cpp
gfx/layers/LayersLogging.h
--- a/gfx/layers/LayersLogging.cpp
+++ b/gfx/layers/LayersLogging.cpp
@@ -97,16 +97,27 @@ AppendToString(std::stringstream& aStrea
   aStream << pfx;
   aStream << nsPrintfCString(
     "(w=%f, h=%f)",
     s.width, s.height).get();
   aStream << sfx;
 }
 
 void
+AppendToString(std::stringstream& aStream, const nsSize& sz,
+               const char* pfx, const char* sfx)
+{
+  aStream << pfx;
+  aStream << nsPrintfCString(
+    "(w=%d, h=%d)",
+    sz.width, sz.height).get();
+  aStream << sfx;
+}
+
+void
 AppendToString(std::stringstream& aStream, const wr::StickyOffsetBounds& s,
                const char* pfx, const char* sfx)
 {
   aStream << pfx;
   aStream << nsPrintfCString("(min=%f max=%f)",
       s.min, s.max).get();
   aStream << sfx;
 }
--- a/gfx/layers/LayersLogging.h
+++ b/gfx/layers/LayersLogging.h
@@ -118,16 +118,20 @@ void
 AppendToString(std::stringstream& aStream, const wr::LayoutRect& r,
                const char* pfx="", const char* sfx="");
 
 void
 AppendToString(std::stringstream& aStream, const wr::LayoutSize& s,
                const char* pfx="", const char* sfx="");
 
 void
+AppendToString(std::stringstream& aStream, const nsSize& sz,
+               const char* pfx="", const char* sfx="");
+
+void
 AppendToString(std::stringstream& aStream, const wr::StickyOffsetBounds& s,
                const char* pfx="", const char* sfx="");
 
 void
 AppendToString(std::stringstream& aStream, const nsRegion& r,
                const char* pfx="", const char* sfx="");
 
 void