Bug 958596 - Allow gfx logging of any rect, size, and point. r=Bas
☠☠ backed out by c9f4f70e46e1 ☠ ☠
authorBotond Ballo <botond@mozilla.com>
Tue, 21 Jan 2014 18:38:34 -0500
changeset 170925 79e589f750652a5ea0c1ee54ec7cf6838548e07e
parent 170924 1ed4c880ab70ab3947654f4b9c96539be34b90e9
child 170926 66dde9d67ffa7ffb59ffdd4d636ddad9021535fb
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersBas
bugs958596
milestone30.0a1
Bug 958596 - Allow gfx logging of any rect, size, and point. r=Bas
gfx/2d/Logging.h
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -7,16 +7,17 @@
 #define MOZILLA_GFX_LOGGING_H_
 
 #include <string>
 #include <sstream>
 #include <stdio.h>
 
 #include "nsDebug.h"
 #include "Point.h"
+#include "BaseRect.h"
 #include "Matrix.h"
 
 #ifdef WIN32
 // This file gets included from nsGlobalWindow.cpp, which doesn't like
 // having windows.h included in it. Since OutputDebugStringA is the only
 // thing we need from windows.h, we just declare it here directly.
 // Note: the function's documented signature is
 //  WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR lpOutputString)
@@ -91,23 +92,24 @@ public:
   Log &operator <<(const char aStr[]) { mMessage << static_cast<const char*>(aStr); return *this; }
   Log &operator <<(bool aBool) { mMessage << (aBool ? "true" : "false"); return *this; }
   Log &operator <<(int aInt) { mMessage << aInt; return *this; }
   Log &operator <<(unsigned int aInt) { mMessage << aInt; return *this; }
   Log &operator <<(long aLong) { mMessage << aLong; return *this; }
   Log &operator <<(unsigned long aLong) { mMessage << aLong; return *this; }
   Log &operator <<(Float aFloat) { mMessage << aFloat; return *this; }
   Log &operator <<(double aDouble) { mMessage << aDouble; return *this; }
-  Log &operator <<(const Point &aPoint)
+  template <typename T, typename Sub>
+  Log &operator <<(const BasePoint<T, Sub>& aPoint)
     { mMessage << "Point(" << aPoint.x << "," << aPoint.y << ")"; return *this; }
-  Log &operator <<(const Size &aSize)
+  template <typename T, typename Sub>
+  Log &operator <<(const BaseSize<T, Sub>& aSize)
     { mMessage << "Size(" << aSize.width << "," << aSize.height << ")"; return *this; }
-  Log &operator <<(const IntSize &aSize)
-    { mMessage << "IntSize(" << aSize.width << "," << aSize.height << ")"; return *this; }
-  Log &operator <<(const Rect &aRect)
+  template <typename T, typename Sub, typename Point, typename SizeT, typename Margin>
+  Log &operator <<(const BaseRect<T, Sub, Point, SizeT, Margin>& aRect)
     { mMessage << "Rect(" << aRect.x << "," << aRect.y << "," << aRect.width << "," << aRect.height << ")"; return *this; }
   Log &operator<<(const Matrix& aMatrix)
     { mMessage << "Matrix(" << aMatrix._11 << " " << aMatrix._12 << " ; " << aMatrix._21 << " " << aMatrix._22 << " ; " << aMatrix._31 << " " << aMatrix._32 << ")"; return *this; }
 
 
 private:
 
   void WriteLog(const std::string &aString) {