Title: [104609] trunk/Source/WebCore
Revision
104609
Author
r...@google.com
Date
2012-01-10 11:50:40 -0800 (Tue, 10 Jan 2012)

Log Message

[skia] not all convex paths are convex, so recompute convexity for the problematic ones
https://bugs.webkit.org/show_bug.cgi?id=75960

Reviewed by Stephen White.

No new tests.
See related chrome issue
http://code.google.com/p/chromium/issues/detail?id=108605

* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::setPathFromConvexPoints):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (104608 => 104609)


--- trunk/Source/WebCore/ChangeLog	2012-01-10 19:47:28 UTC (rev 104608)
+++ trunk/Source/WebCore/ChangeLog	2012-01-10 19:50:40 UTC (rev 104609)
@@ -1,3 +1,17 @@
+2012-01-10  Mike Reed  <r...@google.com>
+
+        [skia] not all convex paths are convex, so recompute convexity for the problematic ones
+        https://bugs.webkit.org/show_bug.cgi?id=75960
+
+        Reviewed by Stephen White.
+
+        No new tests.
+        See related chrome issue
+        http://code.google.com/p/chromium/issues/detail?id=108605
+
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+        (WebCore::setPathFromConvexPoints):
+
 2012-01-10  Gavin Barraclough  <barraclo...@apple.com>
 
         Do not allow Array length to be set if it is non-configurable

Modified: trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp (104608 => 104609)


--- trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp	2012-01-10 19:47:28 UTC (rev 104608)
+++ trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp	2012-01-10 19:50:40 UTC (rev 104609)
@@ -440,7 +440,17 @@
         path->lineTo(WebCoreFloatToSkScalar(points[i].x()),
                      WebCoreFloatToSkScalar(points[i].y()));
     }
-    path->setIsConvex(true);
+
+    /*  The code used to just blindly call this
+            path->setIsConvex(true);
+        But webkit can sometimes send us non-convex 4-point values, so we mark the path's
+        convexity as unknown, so it will get computed by skia at draw time.
+        See crbug.com 108605
+    */
+    SkPath::Convexity convexity = SkPath::kConvex_Convexity;
+    if (numPoints == 4)
+        convexity = SkPath::kUnknown_Convexity;
+    path->setConvexity(convexity);
 }
 
 void GraphicsContext::drawConvexPolygon(size_t numPoints,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to