[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

senorblanco at chromium.org senorblanco at chromium.org
Thu Oct 29 20:45:55 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 0d2e4573146e670eb315734a3c7d059a573b9fc0
Author: senorblanco at chromium.org <senorblanco at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 16 06:46:27 2009 +0000

    Fix for Chromium/skia's implementation of canvas's isPointInPath().
    https://bugs.webkit.org/show_bug.cgi?id=30402
    
    Reviewed by David Levin.
    
    Covered by LayoutTests/fast/canvas/pointInPath.html.
    
    * platform/graphics/skia/SkiaUtils.cpp:
    (WebCore::SkPathContainsPoint):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49673 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9bd029b..b233e96 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-15  Stephen White  <senorblanco at chromium.org>
+
+        Reviewed by David Levin.
+
+        Fix for Chromium/skia's implementation of canvas's isPointInPath().
+        https://bugs.webkit.org/show_bug.cgi?id=30402
+
+        Covered by LayoutTests/fast/canvas/pointInPath.html.
+
+        * platform/graphics/skia/SkiaUtils.cpp:
+        (WebCore::SkPathContainsPoint):
+
 2009-10-15  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/skia/SkiaUtils.cpp b/WebCore/platform/graphics/skia/SkiaUtils.cpp
index 45ede5f..d54246d 100644
--- a/WebCore/platform/graphics/skia/SkiaUtils.cpp
+++ b/WebCore/platform/graphics/skia/SkiaUtils.cpp
@@ -152,8 +152,13 @@ bool SkPathContainsPoint(SkPath* originalPath, const FloatPoint& point, SkPath::
 
     SkRect bounds = originalPath->getBounds();
 
-    // We can immediately return false if the point is outside the bounding rect
-    if (!bounds.contains(SkFloatToScalar(point.x()), SkFloatToScalar(point.y())))
+    // We can immediately return false if the point is outside the bounding
+    // rect.  We don't use bounds.contains() here, since it would exclude
+    // points on the right and bottom edges of the bounding rect, and we want
+    // to include them.
+    SkScalar fX = SkFloatToScalar(point.x());
+    SkScalar fY = SkFloatToScalar(point.y());
+    if (fX < bounds.fLeft || fX > bounds.fRight || fY < bounds.fTop || fY > bounds.fBottom)
         return false;
 
     originalPath->setFillType(ft);
@@ -177,7 +182,7 @@ bool SkPathContainsPoint(SkPath* originalPath, const FloatPoint& point, SkPath::
 
     int x = static_cast<int>(floorf(point.x() / scale));
     int y = static_cast<int>(floorf(point.y() / scale));
-    clip.setRect(x, y, x + 1, y + 1);
+    clip.setRect(x - 1, y - 1, x + 1, y + 1);
 
     bool contains = rgn.setPath(*path, clip);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list