Title: [153952] trunk/Source/WebCore
Revision
153952
Author
[email protected]
Date
2013-08-12 12:13:34 -0700 (Mon, 12 Aug 2013)

Log Message

dataLog dumpers for WebCore's basic geometry types
https://bugs.webkit.org/show_bug.cgi?id=119636

Reviewed by Filip Pizlo.

* platform/graphics/FloatPoint.cpp:
(WebCore::FloatPoint::dump):
* platform/graphics/FloatPoint.h:
* platform/graphics/FloatRect.cpp:
(WebCore::FloatRect::dump):
* platform/graphics/FloatRect.h:
* platform/graphics/FloatSize.cpp:
(WebCore::FloatSize::dump):
* platform/graphics/FloatSize.h:
* platform/graphics/IntPoint.h:
(WebCore::IntPoint::dump):
* platform/graphics/IntRect.cpp:
(WebCore::IntRect::dump):
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
(WebCore::IntSize::dump):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (153951 => 153952)


--- trunk/Source/WebCore/ChangeLog	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/ChangeLog	2013-08-12 19:13:34 UTC (rev 153952)
@@ -1,3 +1,27 @@
+2013-08-12  Tim Horton  <[email protected]>
+
+        dataLog dumpers for WebCore's basic geometry types
+        https://bugs.webkit.org/show_bug.cgi?id=119636
+
+        Reviewed by Filip Pizlo.
+
+        * platform/graphics/FloatPoint.cpp:
+        (WebCore::FloatPoint::dump):
+        * platform/graphics/FloatPoint.h:
+        * platform/graphics/FloatRect.cpp:
+        (WebCore::FloatRect::dump):
+        * platform/graphics/FloatRect.h:
+        * platform/graphics/FloatSize.cpp:
+        (WebCore::FloatSize::dump):
+        * platform/graphics/FloatSize.h:
+        * platform/graphics/IntPoint.h:
+        (WebCore::IntPoint::dump):
+        * platform/graphics/IntRect.cpp:
+        (WebCore::IntRect::dump):
+        * platform/graphics/IntRect.h:
+        * platform/graphics/IntSize.h:
+        (WebCore::IntSize::dump):
+
 2013-08-12  Dean Jackson  <[email protected]>
 
         Shadows don't support viewport units

Modified: trunk/Source/WebCore/platform/graphics/FloatPoint.cpp (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/FloatPoint.cpp	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/FloatPoint.cpp	2013-08-12 19:13:34 UTC (rev 153952)
@@ -33,6 +33,7 @@
 #include "TransformationMatrix.h"
 #include <limits>
 #include <math.h>
+#include <wtf/PrintStream.h>
 
 namespace WebCore {
 
@@ -118,4 +119,9 @@
     return true;
 }
 
+void FloatPoint::dump(PrintStream& out) const
+{
+    out.printf("(%f, %f)", x(), y());
 }
+
+}

Modified: trunk/Source/WebCore/platform/graphics/FloatPoint.h (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/FloatPoint.h	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/FloatPoint.h	2013-08-12 19:13:34 UTC (rev 153952)
@@ -164,6 +164,8 @@
     FloatPoint matrixTransform(const TransformationMatrix&) const;
     FloatPoint matrixTransform(const AffineTransform&) const;
 
+    void dump(PrintStream& out) const;
+
 private:
     float m_x, m_y;
 };

Modified: trunk/Source/WebCore/platform/graphics/FloatRect.cpp (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/FloatRect.cpp	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/FloatRect.cpp	2013-08-12 19:13:34 UTC (rev 153952)
@@ -32,6 +32,7 @@
 #include <algorithm>
 #include <math.h>
 #include <wtf/MathExtras.h>
+#include <wtf/PrintStream.h>
 
 using std::max;
 using std::min;
@@ -252,4 +253,9 @@
                      r.width() * widthScale, r.height() * heightScale);
 }
 
+void FloatRect::dump(PrintStream& out) const
+{
+    out.print(location(), " ", size());
 }
+
+}

Modified: trunk/Source/WebCore/platform/graphics/FloatRect.h (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/FloatRect.h	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/FloatRect.h	2013-08-12 19:13:34 UTC (rev 153952)
@@ -203,6 +203,8 @@
     operator cairo_rectangle_t() const;
 #endif
 
+    void dump(PrintStream& out) const;
+
 private:
     FloatPoint m_location;
     FloatSize m_size;

Modified: trunk/Source/WebCore/platform/graphics/FloatSize.cpp (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/FloatSize.cpp	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/FloatSize.cpp	2013-08-12 19:13:34 UTC (rev 153952)
@@ -60,4 +60,9 @@
     return FloatSize(narrowPrecisionToFloat(width), narrowPrecisionToFloat(height));
 }
 
+void FloatSize::dump(PrintStream& out) const
+{
+    out.printf("(%f x %f)", width(), height());
 }
+
+}

Modified: trunk/Source/WebCore/platform/graphics/FloatSize.h (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/FloatSize.h	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/FloatSize.h	2013-08-12 19:13:34 UTC (rev 153952)
@@ -138,6 +138,8 @@
     operator NSSize() const;
 #endif
 
+    void dump(PrintStream& out) const;
+
 private:
     float m_width, m_height;
 };

Modified: trunk/Source/WebCore/platform/graphics/IntPoint.h (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/IntPoint.h	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/IntPoint.h	2013-08-12 19:13:34 UTC (rev 153952)
@@ -28,6 +28,7 @@
 
 #include "IntSize.h"
 #include <wtf/MathExtras.h>
+#include <wtf/PrintStream.h>
 
 #if USE(CG)
 typedef struct CGPoint CGPoint;
@@ -139,6 +140,8 @@
     operator Evas_Point() const;
 #endif
 
+    void dump(PrintStream& out) const;
+
 private:
     int m_x, m_y;
 };
@@ -200,6 +203,11 @@
     return ((*this) - point).diagonalLengthSquared();
 }
 
+inline void IntPoint::dump(PrintStream& out) const
+{
+    out.printf("(%d, %d)", x(), y());
+}
+
 } // namespace WebCore
 
 #endif // IntPoint_h

Modified: trunk/Source/WebCore/platform/graphics/IntRect.cpp (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/IntRect.cpp	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/IntRect.cpp	2013-08-12 19:13:34 UTC (rev 153952)
@@ -29,6 +29,7 @@
 #include "FloatRect.h"
 #include "LayoutRect.h"
 #include <algorithm>
+#include <wtf/PrintStream.h>
 
 using std::max;
 using std::min;
@@ -159,4 +160,9 @@
     return result;
 }
 
+void IntRect::dump(PrintStream& out) const
+{
+    out.print(location(), " ", size());
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/IntRect.h (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/IntRect.h	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/IntRect.h	2013-08-12 19:13:34 UTC (rev 153952)
@@ -208,6 +208,8 @@
     operator BlackBerry::Platform::IntRect() const;
 #endif
 
+    void dump(PrintStream& out) const;
+
 private:
     IntPoint m_location;
     IntSize m_size;

Modified: trunk/Source/WebCore/platform/graphics/IntSize.h (153951 => 153952)


--- trunk/Source/WebCore/platform/graphics/IntSize.h	2013-08-12 18:41:19 UTC (rev 153951)
+++ trunk/Source/WebCore/platform/graphics/IntSize.h	2013-08-12 19:13:34 UTC (rev 153952)
@@ -26,6 +26,8 @@
 #ifndef IntSize_h
 #define IntSize_h
 
+#include <wtf/PrintStream.h>
+
 #if USE(CG)
 typedef struct CGSize CGSize;
 #endif
@@ -153,6 +155,8 @@
     operator BlackBerry::Platform::IntSize() const;
 #endif
 
+    void dump(PrintStream& out) const;
+
 private:
     int m_width, m_height;
 };
@@ -196,6 +200,11 @@
     return a.width() != b.width() || a.height() != b.height();
 }
 
+inline void IntSize::dump(PrintStream& out) const
+{
+    out.printf("(%d x %d)", width(), height());
+}
+
 } // namespace WebCore
 
 #endif // IntSize_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to