Bug 1367870 - Add stringification helper for WrRect. r=jrmuizel

MozReview-Commit-ID: FMw6tPI2LOJ
This commit is contained in:
Kartikaya Gupta 2017-05-25 17:49:30 -04:00
Родитель cbaaff5376
Коммит 29bcb40e01
2 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -69,6 +69,17 @@ AppendToString(std::stringstream& aStream, const nsRect& r,
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)

Просмотреть файл

@ -18,6 +18,8 @@
#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;
@ -87,6 +89,10 @@ AppendToString(std::stringstream& aStream, const mozilla::gfx::IntRectTyped<T>&
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="");