зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1475024 - Add Stringify overloads for RectAbsolute. r=bas
MozReview-Commit-ID: GLisM28IEVG --HG-- extra : rebase_source : af648babcd1f5dfac1256deb68d229fcecbf1f43
This commit is contained in:
Родитель
1016484c2a
Коммит
475557764c
|
@ -12,6 +12,7 @@
|
|||
#include "nsDebug.h" // for NS_ERROR
|
||||
#include "nsPoint.h" // for nsPoint
|
||||
#include "nsRect.h" // for nsRect
|
||||
#include "nsRectAbsolute.h" // for nsRectAbsolute
|
||||
#include "base/basictypes.h"
|
||||
|
||||
using namespace mozilla::gfx;
|
||||
|
@ -68,6 +69,17 @@ AppendToString(std::stringstream& aStream, const nsRect& r,
|
|||
aStream << sfx;
|
||||
}
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const nsRectAbsolute& r,
|
||||
const char* pfx, const char* sfx)
|
||||
{
|
||||
aStream << pfx;
|
||||
aStream << nsPrintfCString(
|
||||
"(l=%d, t=%d, r=%d, b=%d)",
|
||||
r.Left(), r.Top(), r.Right(), r.Bottom()).get();
|
||||
aStream << sfx;
|
||||
}
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const wr::ColorF& c,
|
||||
const char* pfx, const char* sfx)
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include "nsRegion.h" // for nsRegion, nsIntRegion
|
||||
#include "nscore.h" // for nsACString, etc
|
||||
|
||||
struct nsRectAbsolute;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace gfx {
|
||||
|
@ -49,6 +51,10 @@ void
|
|||
AppendToString(std::stringstream& aStream, const nsRect& r,
|
||||
const char* pfx="", const char* sfx="");
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const nsRectAbsolute& r,
|
||||
const char* pfx="", const char* sfx="");
|
||||
|
||||
template<class T>
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const mozilla::gfx::PointTyped<T>& p,
|
||||
|
@ -97,6 +103,30 @@ AppendToString(std::stringstream& aStream, const mozilla::gfx::IntRectTyped<T>&
|
|||
aStream << sfx;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const mozilla::gfx::RectAbsoluteTyped<T>& r,
|
||||
const char* pfx="", const char* sfx="")
|
||||
{
|
||||
aStream << pfx;
|
||||
aStream << nsPrintfCString(
|
||||
"(l=%f, t=%f, r=%f, b=%f)",
|
||||
r.Left(), r.Top(), r.Right(), r.Bottom()).get();
|
||||
aStream << sfx;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const mozilla::gfx::IntRectAbsoluteTyped<T>& r,
|
||||
const char* pfx="", const char* sfx="")
|
||||
{
|
||||
aStream << pfx;
|
||||
aStream << nsPrintfCString(
|
||||
"(l=%d, t=%d, r=%d, b=%d)",
|
||||
r.Left(), r.Top(), r.Right(), r.Bottom()).get();
|
||||
aStream << sfx;
|
||||
}
|
||||
|
||||
void
|
||||
AppendToString(std::stringstream& aStream, const wr::ColorF& c,
|
||||
const char* pfx="", const char* sfx="");
|
||||
|
|
Загрузка…
Ссылка в новой задаче