[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

andersca at apple.com andersca at apple.com
Sun Feb 20 22:53:49 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 183ff0959d9f5090de4b07921b6c78a5c16a653d
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 13 02:34:55 2011 +0000

    2011-01-12  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Region improvements
            https://bugs.webkit.org/show_bug.cgi?id=52344
    
            * Platform/Region.cpp:
            (WebKit::Region::Shape::move):
            (WebKit::Region::move):
            Change Region::move to take an IntSize.
    
            * Platform/Region.h:
            (WebKit::intersect):
            (WebKit::subtract):
            (WebKit::move):
            Add convenience functions.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75669 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2d6588c..a6667ad 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,21 @@
+2011-01-12  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Region improvements
+        https://bugs.webkit.org/show_bug.cgi?id=52344
+
+        * Platform/Region.cpp:
+        (WebKit::Region::Shape::move):
+        (WebKit::Region::move):
+        Change Region::move to take an IntSize.
+
+        * Platform/Region.h:
+        (WebKit::intersect):
+        (WebKit::subtract):
+        (WebKit::move):
+        Add convenience functions.
+
 2011-01-12  Ryosuke Niwa  <rniwa at webkit.org>
 
         Unreviewed Qt build fix for r75661
diff --git a/WebKit2/Platform/Region.cpp b/WebKit2/Platform/Region.cpp
index dfe4e09..a1cc24c 100644
--- a/WebKit2/Platform/Region.cpp
+++ b/WebKit2/Platform/Region.cpp
@@ -211,12 +211,12 @@ IntRect Region::Shape::bounds() const
     return IntRect(minX, minY, maxX - minX, maxY - minY);
 }
 
-void Region::Shape::move(int x, int y)
+void Region::Shape::translate(const IntSize& offset)
 {
     for (size_t i = 0; i < m_segments.size(); ++i)
-        m_segments[i] += x;
+        m_segments[i] += offset.width();
     for (size_t i = 0; i < m_spans.size(); ++i)
-        m_spans[i].y += y;
+        m_spans[i].y += offset.height();
 }
 
 void Region::Shape::swap(Shape& other)
@@ -444,10 +444,10 @@ void Region::subtract(const Region& region)
     m_bounds = m_shape.bounds();
 }
 
-void Region::move(int x, int y)
+void Region::translate(const IntSize& offset)
 {
-    m_bounds.move(x, y);
-    m_shape.move(x, y);
+    m_bounds.move(offset);
+    m_shape.translate(offset);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/Platform/Region.h b/WebKit2/Platform/Region.h
index 6179215..b44519f 100644
--- a/WebKit2/Platform/Region.h
+++ b/WebKit2/Platform/Region.h
@@ -47,7 +47,7 @@ public:
     void intersect(const Region&);
     void subtract(const Region&);
 
-    void move(int x, int y);
+    void translate(const WebCore::IntSize&);
 
 #ifndef NDEBUG
     void dump() const;
@@ -84,7 +84,7 @@ private:
         static Shape intersectShapes(const Shape& shape1, const Shape& shape2);
         static Shape subtractShapes(const Shape& shape1, const Shape& shape2);
 
-        void move(int x, int y);
+        void translate(const WebCore::IntSize&);
         void swap(Shape&);
 
 #ifndef NDEBUG
@@ -115,6 +115,30 @@ private:
     Shape m_shape;
 };
 
+static inline Region intersect(const Region& a, const Region& b)
+{
+    Region result(a);
+    result.intersect(b);
+
+    return result;
+}
+    
+static inline Region subtract(const Region& a, const Region& b)
+{
+    Region result(a);
+    result.subtract(b);
+
+    return result;
+}
+
+static inline Region translate(const Region& region, const WebCore::IntSize& offset)
+{
+    Region result(region);
+    result.translate(offset);
+
+    return result;
+}
+
 } // namespace WebKit
 
 #endif // Region_h

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list