<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>41310</bug_id>
          
          <creation_ts>2010-06-28 15:05:10 -0700</creation_ts>
          <short_desc>[Qt] Need to implement GraphicsContextQt::clipConvexPolygon()</short_desc>
          <delta_ts>2010-08-09 21:00:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Beth Dakin">bdakin</reporter>
          <assigned_to name="Ariya Hidayat">ariya.hidayat</assigned_to>
          <cc>abarth</cc>
    
    <cc>ariya.hidayat</cc>
    
    <cc>bdakin</cc>
    
    <cc>benjamin</cc>
    
    <cc>eric</cc>
    
    <cc>hausmann</cc>
    
    <cc>jesus</cc>
    
    <cc>kenneth</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>243929</commentid>
    <comment_count>0</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2010-06-28 15:05:10 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/62035 introduced a new method of drawing border-radius using paths. Right now, this new code is only enabled for some platforms. To enable the new and much improved code for QT, GraphicsContext::clipConvexPolygon() needs to be implemented, and then QT should be added to the list of platforms that set #define HAVE_PATH_BASED_BORDER_RADIUS_DRAWING in RenderObject.h

I would like to note that QT already has a function implemented called GraphicsContext::drawConvexPolygon(). So hopefully it is straightforward to use some of that same logic for clipping instead of drawing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>245248</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-07-01 03:57:55 -0700</bug_when>
    <thetext>Most straightforward way I can see is to put the polygon points into a QPainterPath and clip that one, kind of like before....

Any other suggestions?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>245254</commentid>
    <comment_count>2</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-07-01 04:51:57 -0700</bug_when>
    <thetext>Apparently it is supposed to be clipped with antialiased clipping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>245320</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-07-01 06:54:45 -0700</bug_when>
    <thetext>The most straightforward patch like this didn&apos;t work for me ;(

diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index d1a9318..4a0cadd 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -536,7 +536,10 @@ void GraphicsContext::clipConvexPolygon(size_t numPoints, const FloatPoint* poin
     if (numPoints &lt;= 1)
         return;
     
-    // FIXME: IMPLEMENT!!
+    QPainterPath path(points[0]);
+    for (int i = 1; i &lt; numPoints; ++i)
+        path.lineTo(points[i]);
+    m_data-&gt;p()-&gt;setClipPath(path, Qt::IntersectClip);
 }
 
 QPen GraphicsContext::pen()
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index 33271df..476b5ec 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -38,7 +38,7 @@
 #include &quot;TransformationMatrix.h&quot;
 #include &lt;wtf/UnusedParam.h&gt;
 
-#if PLATFORM(CG)
+#if PLATFORM(CG) || PLATFORM(QT)
 #define HAVE_PATH_BASED_BORDER_RADIUS_DRAWING 1
 #endif</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>245395</commentid>
    <comment_count>4</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2010-07-01 09:48:26 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Apparently it is supposed to be clipped with antialiased clipping.

Hi Kenneth,

I just wanted to let you know, with regard to antialiased clipping, I am actually reconsidering this. We have some corner joint issues because of the antialiased polygon clipping. A great example of the worst case scenario: http://ie.microsoft.com/testdrive/Graphics/IE%20Logo/Default.html

You should do what seems right for your platform, but to warn you, I might be switching CG soon to non-antialiased polygon clipping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>245438</commentid>
    <comment_count>5</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-07-01 11:20:12 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #2)
&gt; &gt; Apparently it is supposed to be clipped with antialiased clipping.
&gt; 
&gt; Hi Kenneth,
&gt; 
&gt; I just wanted to let you know, with regard to antialiased clipping, I am actually reconsidering this. We have some corner joint issues because of the antialiased polygon clipping. A great example of the worst case scenario: http://ie.microsoft.com/testdrive/Graphics/IE%20Logo/Default.html
&gt; 
&gt; You should do what seems right for your platform, but to warn you, I might be switching CG soon to non-antialiased polygon clipping.

Thanks for the heads-up!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262052</commentid>
    <comment_count>6</comment_count>
    <who name="Ariya Hidayat">ariya.hidayat</who>
    <bug_when>2010-08-09 02:58:15 -0700</bug_when>
    <thetext>Last time I checked, Qt does not support anti-aliased clipping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262062</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-08-09 03:34:02 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Last time I checked, Qt does not support anti-aliased clipping.

Raster, OpenGL and to some extent OpenVG do support anti-aliased clipping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262138</commentid>
    <comment_count>8</comment_count>
    <who name="Ariya Hidayat">ariya.hidayat</who>
    <bug_when>2010-08-09 08:14:53 -0700</bug_when>
    <thetext>&gt; Raster, OpenGL and to some extent OpenVG do support anti-aliased clipping.

Ah, my bad. This sounds good!

Anyway, I can work on this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262369</commentid>
    <comment_count>9</comment_count>
      <attachid>63946</attachid>
    <who name="Ariya Hidayat">ariya.hidayat</who>
    <bug_when>2010-08-09 15:50:01 -0700</bug_when>
    <thetext>Created attachment 63946
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262371</commentid>
    <comment_count>10</comment_count>
    <who name="Ariya Hidayat">ariya.hidayat</who>
    <bug_when>2010-08-09 15:52:05 -0700</bug_when>
    <thetext>It&apos;s hard to automatically test this (with pixel test), since our border radius is pretty broken. I had to visually inspect some of the good ones.

Seems that fixing border radius is now in my TODO...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262398</commentid>
    <comment_count>11</comment_count>
      <attachid>63946</attachid>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-08-09 16:34:27 -0700</bug_when>
    <thetext>Comment on attachment 63946
Patch

Looks fine to me! Great to have you back Ariya!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262413</commentid>
    <comment_count>12</comment_count>
      <attachid>63946</attachid>
    <who name="Ariya Hidayat">ariya.hidayat</who>
    <bug_when>2010-08-09 17:00:16 -0700</bug_when>
    <thetext>Comment on attachment 63946
Patch

Clearing flags on attachment: 63946

Committed r65017: &lt;http://trac.webkit.org/changeset/65017&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262414</commentid>
    <comment_count>13</comment_count>
    <who name="Ariya Hidayat">ariya.hidayat</who>
    <bug_when>2010-08-09 17:00:26 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>262480</commentid>
    <comment_count>14</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-08-09 21:00:43 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/65017 might have broken Leopard Intel Debug (Tests)
The following changes are on the blame list:
http://trac.webkit.org/changeset/65017
http://trac.webkit.org/changeset/65018</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>63946</attachid>
            <date>2010-08-09 15:50:01 -0700</date>
            <delta_ts>2010-08-09 17:00:16 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-41310-20100809154845.patch</filename>
            <type>text/plain</type>
            <size>1969</size>
            <attacher name="Ariya Hidayat">ariya.hidayat</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
MGEwYjdjZDIyNWIwYWU0YjVlZGEyODEyNDU4N2FkZGQ3MDJjNTk1ZS4uNWI5NTEzZmMyNTExYWQ5
YjEzMzcxNWU0ZTYxMTVlZjIzZDJmZTg2ZSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cK
KysrIGIvV2ViQ29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNiBAQAorMjAxMC0wOC0wOSAgQXJp
eWEgSGlkYXlhdCAgPGFyaXlhQHNlbmNoYS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9C
T0RZIChPT1BTISkuCisKKyAgICAgICAgW1F0XSBOZWVkIHRvIGltcGxlbWVudCBHcmFwaGljc0Nv
bnRleHRRdDo6Y2xpcENvbnZleFBvbHlnb24oKQorICAgICA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