Bug 879004 - Move template methods to header file. r=BenWa

This commit is contained in:
Kartikaya Gupta 2013-06-10 09:05:43 -04:00
parent 8cf123d18d
commit 9b6d544096
2 changed files with 15 additions and 25 deletions

View File

@ -6,7 +6,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "LayersLogging.h"
#include "nsPrintfCString.h"
using namespace mozilla::gfx;
@ -95,16 +94,6 @@ AppendToString(nsACString& s, const nsIntPoint& p,
return s += sfx;
}
template<class T>
nsACString&
AppendToString(nsACString& s, const PointTyped<T>& p,
const char* pfx, const char* sfx)
{
s += pfx;
s += nsPrintfCString("(x=%f, y=%f)", p.x, p.y);
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const nsIntRect& r,
const char* pfx, const char* sfx)
@ -116,18 +105,6 @@ AppendToString(nsACString& s, const nsIntRect& r,
return s += sfx;
}
template<class T>
nsACString&
AppendToString(nsACString& s, const RectTyped<T>& r,
const char* pfx, const char* sfx)
{
s += pfx;
s.AppendPrintf(
"(x=%f, y=%f, w=%f, h=%f)",
r.x, r.y, r.width, r.height);
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const nsIntRegion& r,
const char* pfx, const char* sfx)

View File

@ -16,6 +16,7 @@
#include "gfxColor.h"
#include "gfx3DMatrix.h"
#include "nsRegion.h"
#include "nsPrintfCString.h"
namespace mozilla {
namespace layers {
@ -47,7 +48,12 @@ AppendToString(nsACString& s, const nsIntPoint& p,
template<class T>
nsACString&
AppendToString(nsACString& s, const mozilla::gfx::PointTyped<T>& p,
const char* pfx="", const char* sfx="");
const char* pfx="", const char* sfx="")
{
s += pfx;
s += nsPrintfCString("(x=%f, y=%f)", p.x, p.y);
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const nsIntRect& r,
@ -56,7 +62,14 @@ AppendToString(nsACString& s, const nsIntRect& r,
template<class T>
nsACString&
AppendToString(nsACString& s, const mozilla::gfx::RectTyped<T>& r,
const char* pfx="", const char* sfx="");
const char* pfx="", const char* sfx="")
{
s += pfx;
s.AppendPrintf(
"(x=%f, y=%f, w=%f, h=%f)",
r.x, r.y, r.width, r.height);
return s += sfx;
}
nsACString&
AppendToString(nsACString& s, const nsIntRegion& r,