[Webkit-unassigned] [Bug 41311] Skia: Need to implement GraphicsContext::clipConvexPolygon()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 29 16:13:07 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=41311





--- Comment #5 from Adam Langley <agl at chromium.org>  2010-06-29 16:13:06 PST ---
The patch is pretty trivial (see below). I'll do the ChangeLog and layout tests song-and-dance tomorrow.

We still suck at some rounded corners. However, I spent an few hours today convincing myself (again) that it's just not possible to do a good job with our layer-based clipping. (At least, not without using a lot of memory.)




Index: platform/graphics/skia/GraphicsContextSkia.cpp
===================================================================
--- platform/graphics/skia/GraphicsContextSkia.cpp      (revision 62103)
+++ platform/graphics/skia/GraphicsContextSkia.cpp      (working copy)
@@ -485,8 +485,13 @@

     if (numPoints <= 1)
         return;
-    
-    // FIXME: IMPLEMENT!!
+
+    SkPath path;
+    path.moveTo(points[0].x(), points[0].y());
+    for (size_t i = 1; i < numPoints; i++)
+        path.lineTo(points[i].x(), points[i].y());
+    path.setFillType(SkPath::kInverseWinding_FillType);
+    platformContext()->clipPathAntiAliased(path);
 }

 // This method is only used to draw the little circles used in lists.
Index: rendering/RenderObject.h
===================================================================
--- rendering/RenderObject.h    (revision 62103)
+++ rendering/RenderObject.h    (working copy)
@@ -37,7 +37,7 @@
 #include "TransformationMatrix.h"
 #include <wtf/UnusedParam.h>

-#if PLATFORM(CG)
+#if PLATFORM(CG) || PLATFORM(CHROMIUM)
 #define HAVE_PATH_BASED_BORDER_RADIUS_DRAWING 1
 #endif

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list