gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r12034: Move Matrix::transform(point


From: Bastiaan Jacques
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r12034: Move Matrix::transform(point) back into the source file.
Date: Sat, 13 Mar 2010 00:37:40 +0100
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 12034
committer: Bastiaan Jacques <address@hidden>
branch nick: trunk
timestamp: Sat 2010-03-13 00:37:40 +0100
message:
  Move Matrix::transform(point) back into the source file.
modified:
  backend/Renderer.h
  libcore/Geometry.h
  libcore/SWFMatrix.cpp
  libcore/SWFMatrix.h
  libcore/SWFRect.cpp
  testsuite/libcore.all/MatrixTest.cpp
=== modified file 'backend/Renderer.h'
--- a/backend/Renderer.h        2010-03-11 01:47:08 +0000
+++ b/backend/Renderer.h        2010-03-12 23:37:40 +0000
@@ -151,6 +151,7 @@
 #include "gnash.h" // Quality
 #include "DisplayObject.h"
 #include "Range2d.h"
+#include "Point2d.h"
 #include "RGBA.h"
 #include "log.h"
 

=== modified file 'libcore/Geometry.h'
--- a/libcore/Geometry.h        2010-03-11 01:47:08 +0000
+++ b/libcore/Geometry.h        2010-03-12 23:37:40 +0000
@@ -22,6 +22,7 @@
 #include "dsodefs.h"
 #include "SWFMatrix.h"
 #include "SWFRect.h"
+#include "Point2d.h"
 
 #include <vector> // for path composition
 #include <cmath> // sqrt

=== modified file 'libcore/SWFMatrix.cpp'
--- a/libcore/SWFMatrix.cpp     2010-03-11 01:47:08 +0000
+++ b/libcore/SWFMatrix.cpp     2010-03-12 23:37:40 +0000
@@ -25,6 +25,7 @@
 #include "log.h"
 #include "GnashNumeric.h"
 #include "SWFRect.h"
+#include "Point2d.h"
 
 #include <cmath>
 #include <iomanip>
@@ -126,6 +127,30 @@
 }
 
 void
+SWFMatrix::transform(geometry::Range2d<boost::int32_t>& r) const
+{
+    boost::int32_t xmin = r.getMinX(),
+                   xmax = r.getMaxX(),
+                   ymin = r.getMinY(),
+                   ymax = r.getMaxY();
+
+    point p0(xmin, ymin);
+    point p1(xmin, ymax);
+    point p2(xmax, ymax);
+    point p3(xmax, ymin);
+
+    transform(p0);
+    transform(p1);
+    transform(p2);
+    transform(p3);
+
+    r.setTo(p0.x, p0.y);
+    r.expandTo(p1.x, p1.y);
+    r.expandTo(p2.x, p2.y);
+    r.expandTo(p3.x, p3.y);
+}
+
+void
 SWFMatrix::set_identity()
 // Set the SWFMatrix to identity.
 {

=== modified file 'libcore/SWFMatrix.h'
--- a/libcore/SWFMatrix.h       2010-03-11 01:47:08 +0000
+++ b/libcore/SWFMatrix.h       2010-03-12 23:37:40 +0000
@@ -26,16 +26,18 @@
 #define GNASH_MATRIX_H
 
 #include "dsodefs.h" // for DSOEXPORT
-#include "Range2d.h" // for transforming Range2d<float>
-#include "Point2d.h" // for Point2d
 
-#include <iostream> 
+#include <ostream> 
 #include <boost/cstdint.hpp>
 
 // Forward declarations
 namespace gnash {
     class SWFStream;
     class SWFRect;
+    namespace geometry {
+        class Point2d;
+        template <typename T> class Range2d;
+    }
 }
 
 
@@ -154,36 +156,14 @@
     //
     /// Put the result in *result.
     ///
-    void    transform(point* result, const point& p) const;
+    void    transform(geometry::Point2d* result,
+                      const geometry::Point2d& p) const;
 
     /// Transform Range2d<float> 'r' by our SWFMatrix. 
     //
     /// NULL and WORLD ranges are untouched.
     ///
-    template <typename T>
-    void transform(geometry::Range2d<T>& r) const
-    {
-        T xmin = r.getMinX();
-        T xmax = r.getMaxX();
-        T ymin = r.getMinY();
-        T ymax = r.getMaxY();
-
-        point p0(xmin, ymin);
-        point p1(xmin, ymax);
-        point p2(xmax, ymax);
-        point p3(xmax, ymin);
-
-        transform(p0);
-        transform(p1);
-        transform(p2);
-        transform(p3);
-
-        r.setTo(p0.x, p0.y);
-        r.expandTo(p1.x, p1.y);
-        r.expandTo(p2.x, p2.y);
-        r.expandTo(p3.x, p3.y);
-    }
-
+    void transform(geometry::Range2d<boost::int32_t>& r) const;
 
     void    transform(SWFRect& r) const;
     

=== modified file 'libcore/SWFRect.cpp'
--- a/libcore/SWFRect.cpp       2010-01-11 06:41:38 +0000
+++ b/libcore/SWFRect.cpp       2010-03-12 23:37:40 +0000
@@ -20,6 +20,7 @@
 #include "log.h"
 #include "SWFStream.h"
 #include "SWFMatrix.h"
+#include "Point2d.h"
 #include "GnashNumeric.h" // for flerp, clamp...
 
 #include <sstream> // for ::print and ::toString

=== modified file 'testsuite/libcore.all/MatrixTest.cpp'
--- a/testsuite/libcore.all/MatrixTest.cpp      2010-01-11 06:41:38 +0000
+++ b/testsuite/libcore.all/MatrixTest.cpp      2010-03-12 23:37:40 +0000
@@ -21,6 +21,7 @@
 #endif
 
 #include "SWFMatrix.h"
+#include "Point2d.h"
 #include <iostream>
 #include <sstream>
 #include <cassert>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]