[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

krit at webkit.org krit at webkit.org
Thu Apr 8 02:01:50 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit c24f336f17225582e95f46bb4a1666cbeded0b6e
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 26 22:27:44 2010 +0000

    2010-02-26  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Extend AffineTransform to mapQuad
            https://bugs.webkit.org/show_bug.cgi?id=35444
    
            This makes mapQuad available for AffineTransform. So that platforms
            can make use of it after the switch from TransformationMatrix to
            AffineTransform in GraphicsContext.
    
            * platform/graphics/transforms/AffineTransform.cpp:
            (WebCore::AffineTransform::mapRect): mapRect already did the calculation for mapQuad but gave back the
                                                 boundingBox of the resulting FloatQuad.
            (WebCore::AffineTransform::mapQuad):
            * platform/graphics/transforms/AffineTransform.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55314 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ec1e19e..77f0a36 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-02-26  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Extend AffineTransform to mapQuad
+        https://bugs.webkit.org/show_bug.cgi?id=35444
+
+        This makes mapQuad available for AffineTransform. So that platforms
+        can make use of it after the switch from TransformationMatrix to
+        AffineTransform in GraphicsContext.
+
+        * platform/graphics/transforms/AffineTransform.cpp:
+        (WebCore::AffineTransform::mapRect): mapRect already did the calculation for mapQuad but gave back the
+                                             boundingBox of the resulting FloatQuad.
+        (WebCore::AffineTransform::mapQuad):
+        * platform/graphics/transforms/AffineTransform.h:
+
 2010-02-26  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/platform/graphics/transforms/AffineTransform.cpp b/WebCore/platform/graphics/transforms/AffineTransform.cpp
index d6688d2..be18e07 100644
--- a/WebCore/platform/graphics/transforms/AffineTransform.cpp
+++ b/WebCore/platform/graphics/transforms/AffineTransform.cpp
@@ -314,14 +314,28 @@ FloatRect AffineTransform::mapRect(const FloatRect& rect) const
         return mappedRect;
     }
 
-    FloatQuad q(rect);
+    FloatQuad result;
+    result.setP1(mapPoint(rect.location()));
+    result.setP2(mapPoint(FloatPoint(rect.right(), rect.y())));
+    result.setP3(mapPoint(FloatPoint(rect.right(), rect.bottom())));
+    result.setP4(mapPoint(FloatPoint(rect.x(), rect.bottom())));
+    return result.boundingBox();
+}
+
+FloatQuad AffineTransform::mapQuad(const FloatQuad& q) const
+{
+    if (isIdentityOrTranslation()) {
+        FloatQuad mappedQuad(q);
+        mappedQuad.move(narrowPrecisionToFloat(m_transform[4]), narrowPrecisionToFloat(m_transform[5]));
+        return mappedQuad;
+    }
 
     FloatQuad result;
     result.setP1(mapPoint(q.p1()));
     result.setP2(mapPoint(q.p2()));
     result.setP3(mapPoint(q.p3()));
     result.setP4(mapPoint(q.p4()));
-    return result.boundingBox();
+    return result;
 }
 
 void AffineTransform::blend(const AffineTransform& from, double progress)
diff --git a/WebCore/platform/graphics/transforms/AffineTransform.h b/WebCore/platform/graphics/transforms/AffineTransform.h
index 45a19d7..d89964b 100644
--- a/WebCore/platform/graphics/transforms/AffineTransform.h
+++ b/WebCore/platform/graphics/transforms/AffineTransform.h
@@ -74,6 +74,7 @@ public:
     IntRect mapRect(const IntRect&) const;
 
     FloatRect mapRect(const FloatRect&) const;
+    FloatQuad mapQuad(const FloatQuad&) const;
 
     bool isIdentity() const;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list