Bug 1367870 - Add stringification helper for WrRect. r=jrmuizel
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 25 May 2017 17:49:30 -0400
changeset 409351 25c281fca778ac22d64857128e426a43fa6543e3
parent 409350 8f762279e32cc257acbc851ae2cfeb0020ce8e3b
child 409352 55d3640b8a2db961e50bcfe676e478a6bccfeccf
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1367870
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1367870 - Add stringification helper for WrRect. r=jrmuizel MozReview-Commit-ID: FMw6tPI2LOJ
gfx/layers/LayersLogging.cpp
gfx/layers/LayersLogging.h
--- a/gfx/layers/LayersLogging.cpp
+++ b/gfx/layers/LayersLogging.cpp
@@ -65,16 +65,27 @@ AppendToString(std::stringstream& aStrea
   aStream << pfx;
   aStream << nsPrintfCString(
     "(x=%d, y=%d, w=%d, h=%d)",
     r.x, r.y, r.width, r.height).get();
   aStream << sfx;
 }
 
 void
+AppendToString(std::stringstream& aStream, const WrRect& r,
+               const char* pfx, const char* sfx)
+{
+  aStream << pfx;
+  aStream << nsPrintfCString(
+    "(x=%f, y=%f, w=%f, h=%f)",
+    r.x, r.y, r.width, r.height).get();
+  aStream << sfx;
+}
+
+void
 AppendToString(std::stringstream& aStream, const nsRegion& r,
                const char* pfx, const char* sfx)
 {
   aStream << pfx;
 
   aStream << "< ";
   for (auto iter = r.RectIter(); !iter.Done(); iter.Next()) {
     AppendToString(aStream, iter.Get());
--- a/gfx/layers/LayersLogging.h
+++ b/gfx/layers/LayersLogging.h
@@ -13,16 +13,18 @@
 #include "mozilla/gfx/Types.h"          // for SamplingFilter, SurfaceFormat
 #include "mozilla/layers/CompositorTypes.h"  // for TextureFlags
 #include "mozilla/layers/WebRenderLayersLogging.h"
 #include "nsAString.h"
 #include "nsPrintfCString.h"            // for nsPrintfCString
 #include "nsRegion.h"                   // for nsRegion, nsIntRegion
 #include "nscore.h"                     // for nsACString, etc
 
+struct WrRect;
+
 namespace mozilla {
 namespace gfx {
 template <class units, class F> struct RectTyped;
 } // namespace gfx
 
 enum class ImageFormat;
 
 namespace layers {
@@ -83,16 +85,20 @@ AppendToString(std::stringstream& aStrea
   aStream << pfx;
   aStream << nsPrintfCString(
     "(x=%d, y=%d, w=%d, h=%d)",
     r.x, r.y, r.width, r.height).get();
   aStream << sfx;
 }
 
 void
+AppendToString(std::stringstream& aStream, const WrRect& r,
+               const char* pfx="", const char* sfx="");
+
+void
 AppendToString(std::stringstream& aStream, const nsRegion& r,
                const char* pfx="", const char* sfx="");
 
 void
 AppendToString(std::stringstream& aStream, const nsIntRegion& r,
                const char* pfx="", const char* sfx="");
 
 template <typename units>