2007-12-19 Alp Toker <alp@atoker.com>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2007 16:55:37 +0000 (16:55 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Dec 2007 16:55:37 +0000 (16:55 +0000)
        Reviewed by Holger Freyther.

        Check the bounding box before doing a full hit test

        * platform/graphics/cairo/PathCairo.cpp:
        (WebCore::Path::contains):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28860 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/cairo/PathCairo.cpp

index 172cfdd1fabd0d81bce535afdbfa8cbfb641c9ab..508bfad7f4d2a939de52e012bddf803a734a1ff9 100644 (file)
@@ -1,3 +1,12 @@
+2007-12-19  Alp Toker  <alp@atoker.com>
+
+        Reviewed by Holger Freyther.
+
+        Check the bounding box before doing a full hit test
+
+        * platform/graphics/cairo/PathCairo.cpp:
+        (WebCore::Path::contains):
+
 2007-12-18  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Geoff.
index 0e2a09a62f65625332cc352916140f431a4c912e..d9ed5ca6831d0448504292a844f3dbde6510b50e 100644 (file)
@@ -185,6 +185,9 @@ FloatRect Path::boundingRect() const
 
 bool Path::contains(const FloatPoint& point, WindRule rule) const
 {
+    if (!boundingRect().contains(point))
+        return false;
+
     cairo_t* cr = platformPath()->m_cr;
     cairo_fill_rule_t cur = cairo_get_fill_rule(cr);
     cairo_set_fill_rule(cr, rule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);