<?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>23882</bug_id>
          
          <creation_ts>2009-02-10 16:44:52 -0800</creation_ts>
          <short_desc>GraphicsContextSkia draws round rects as solid rects</short_desc>
          <delta_ts>2009-02-11 14:01:24 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Scott Violet">sky</reporter>
          <assigned_to name="Scott Violet">sky</assigned_to>
          <cc>brettw</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>109215</commentid>
    <comment_count>0</comment_count>
    <who name="Scott Violet">sky</who>
    <bug_when>2009-02-10 16:44:52 -0800</bug_when>
    <thetext>This can be seen with the test LayoutTests/fast/css/shadow-multiple.html .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109301</commentid>
    <comment_count>1</comment_count>
    <who name="Scott Violet">sky</who>
    <bug_when>2009-02-11 08:15:26 -0800</bug_when>
    <thetext>Once this line is fixed, the layout test LayoutTests/fast/box-shadow/basic-shadows.html starts failing. This is because we need to check if the width/height of the rounded rect is greater than the width/height of the rounded rect. If it is, then we should just draw a rect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109309</commentid>
    <comment_count>2</comment_count>
      <attachid>27563</attachid>
    <who name="Scott Violet">sky</who>
    <bug_when>2009-02-11 09:13:31 -0800</bug_when>
    <thetext>Created attachment 27563
Fix for 23882</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109315</commentid>
    <comment_count>3</comment_count>
    <who name="Brett Wilson (Google)">brettw</who>
    <bug_when>2009-02-11 09:45:46 -0800</bug_when>
    <thetext>&gt; if the total radius along a given axis is greater than the size of
&gt; the axis to draw, a solid rect should be drawn.

I assume this is the behavior of CG? It seems weird that it would do this for the entire rect if just a single corner is &quot;too smooth.&quot; What does the Skia output look like in this case without your change? It&apos;s possible this is an aspect of CG we don&apos;t want to emulate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109316</commentid>
    <comment_count>4</comment_count>
    <who name="Scott Violet">sky</who>
    <bug_when>2009-02-11 09:54:04 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; &gt; if the total radius along a given axis is greater than the size of
&gt; &gt; the axis to draw, a solid rect should be drawn.
&gt; 
&gt; I assume this is the behavior of CG?

Yes. This behavior can be seen with the layout test LayoutTests/fast/box-shadow/border-radius-big.html .

&gt; It seems weird that it would do this for
&gt; the entire rect if just a single corner is &quot;too smooth.&quot; What does the Skia
&gt; output look like in this case without your change?

Experimentation shows it does this for the whole rect, not just the corner(s).

&gt; It&apos;s possible this is an aspect of CG we don&apos;t want to emulate.

I don&apos;t have a strong feeling here. This is an edge case that I can&apos;t imagine comes up much. But I do tend to think Skia should match CG as close as possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109322</commentid>
    <comment_count>5</comment_count>
      <attachid>27563</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-02-11 10:37:16 -0800</bug_when>
    <thetext>Comment on attachment 27563
Fix for 23882

This block still doesn&apos;t make sense to me, even after reading the bug:

+    if (topLeft.width() + topRight.width() &gt; rect.width() ||
+        bottomLeft.width() + bottomRight.width() &gt; rect.width() ||
+        topLeft.height() + bottomLeft.height() &gt; rect.height() ||
+        topRight.height() + bottomRight.height() &gt; rect.height()) {
+        // If the width/height along an axis is &gt; than the width/height of the
+        // rectangle, just draw a rect.
+        fillRect(rect, color);
+        return;
+    }

i.e. What behavior does that change?  Why are we changing it (to match CG&apos;s behavior it seems).  What is &quot;width/height long an axis&quot;
Seems we need a better comment there to make more sense to the casual reader (who knows less about our graphics code than even I do).

Otherwise this change looks great.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109330</commentid>
    <comment_count>6</comment_count>
    <who name="Scott Violet">sky</who>
    <bug_when>2009-02-11 11:06:09 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (From update of attachment 27563 [review])
&gt; This block still doesn&apos;t make sense to me, even after reading the bug:
&gt; 
&gt; +    if (topLeft.width() + topRight.width() &gt; rect.width() ||
&gt; +        bottomLeft.width() + bottomRight.width() &gt; rect.width() ||
&gt; +        topLeft.height() + bottomLeft.height() &gt; rect.height() ||
&gt; +        topRight.height() + bottomRight.height() &gt; rect.height()) {
&gt; +        // If the width/height along an axis is &gt; than the width/height of the
&gt; +        // rectangle, just draw a rect.
&gt; +        fillRect(rect, color);
&gt; +        return;
&gt; +    }
&gt; 
&gt; i.e. What behavior does that change?

This effectively gives us the old behavior (of always filling a rect) if the sum of the radii along an axis are bigger than the size of the rect. This method (fillRoundedRect) is invoked to draw the shadow. The method that draws the background uses Path::createRoundedRectangle to create the path for the background. Path::createRoundedRectangle creates a rectangle under the same conditions:

    if (width &lt; topLeftRadius.width() + topRightRadius.width()
            || width &lt; bottomLeftRadius.width() + bottomRightRadius.width()
            || height &lt; topLeftRadius.height() + bottomLeftRadius.height()
            || height &lt; topRightRadius.height() + bottomRightRadius.height())
        // If all the radii cannot be accommodated, return a rect.
        return createRectangle(rectangle);

If fillRoundedRect isn&apos;t updated like this it means we draw a round shadow for a solid background.

&gt; Why are we changing it (to match CG&apos;s
&gt; behavior it seems).  What is &quot;width/height long an axis&quot;
&gt; Seems we need a better comment there to make more sense to the casual reader
&gt; (who knows less about our graphics code than even I do).

My comment is wrong. I&apos;ll update it (along with a style change) and attach a new patch.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109333</commentid>
    <comment_count>7</comment_count>
      <attachid>27566</attachid>
    <who name="Scott Violet">sky</who>
    <bug_when>2009-02-11 11:13:19 -0800</bug_when>
    <thetext>Created attachment 27566
Fix for 23882

Improves comment and changes style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109365</commentid>
    <comment_count>8</comment_count>
      <attachid>27566</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-02-11 13:41:08 -0800</bug_when>
    <thetext>Comment on attachment 27566
Fix for 23882

Looks good. will land.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109367</commentid>
    <comment_count>9</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-02-11 14:01:24 -0800</bug_when>
    <thetext>Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
Committed r40869
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>27563</attachid>
            <date>2009-02-11 09:13:31 -0800</date>
            <delta_ts>2009-02-11 11:13:19 -0800</delta_ts>
            <desc>Fix for 23882</desc>
            <filename>23882.patch</filename>
            <type>text/plain</type>
            <size>2325</size>
            <attacher name="Scott Violet">sky</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA0MDgzOCkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsM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yA+IHRoYW4gdGhlIHdpZHRoL2hlaWdo
dCBvZiB0aGUKKyAgICAgICAgLy8gcmVjdGFuZ2xlLCBqdXN0IGRyYXcgYSByZWN0LgorICAgICAg
ICBmaWxsUmVjdChyZWN0LCBjb2xvcik7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKICAgICBT
a1BhdGggcGF0aDsKICAgICBhZGRDb3JuZXJBcmMoJnBhdGgsIHIsIHRvcFJpZ2h0LCAyNzApOwog
ICAgIGFkZENvcm5lckFyYygmcGF0aCwgciwgYm90dG9tUmlnaHQsIDApOwpAQCAtNzg2LDcgKzc5
Niw2IEBAIHZvaWQgR3JhcGhpY3NDb250ZXh0OjpmaWxsUm91bmRlZFJlY3QoY28KICAgICBTa1Bh
aW50IHBhaW50OwogICAgIHBsYXRmb3JtQ29udGV4dCgpLT5zZXR1cFBhaW50Rm9yRmlsbGluZygm
cGFpbnQpOwogICAgIHBsYXRmb3JtQ29udGV4dCgpLT5jYW52YXMoKS0+ZHJhd1BhdGgocGF0aCwg
cGFpbnQpOwotICAgIHJldHVybiBmaWxsUmVjdChyZWN0LCBjb2xvcik7CiB9CiAKIFRyYW5zZm9y
bWF0aW9uTWF0cml4IEdyYXBoaWNzQ29udGV4dDo6Z2V0Q1RNKCkgY29uc3QK
</data>
<flag name="review"
          id="13355"
          type_id="1"
          status="-"
          setter="eric"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>27566</attachid>
            <date>2009-02-11 11:13:19 -0800</date>
            <delta_ts>2009-02-11 13:41:08 -0800</delta_ts>
            <desc>Fix for 23882</desc>
            <filename>23882.patch</filename>
            <type>text/plain</type>
            <size>2414</size>
            <attacher name="Scott Violet">sky</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvc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Ym90dG9tUmlnaHQuaGVpZ2h0KCkgPiByZWN0LmhlaWdodCgpKSB7Cisg
ICAgICAgIC8vIE5vdCBhbGwgdGhlIHJhZGlpIGZpdCwgcmV0dXJuIGEgcmVjdC4gVGhpcyBtYXRj
aGVzIHRoZSBiZWhhdmlvciBvZgorICAgICAgICAvLyBQYXRoOjpjcmVhdGVSb3VuZGVkUmVjdGFu
Z2xlLiBXaXRob3V0IHRoaXMgd2UgYXR0ZW1wdCB0byBkcmF3IGEgcm91bmQKKyAgICAgICAgLy8g
c2hhZG93IGZvciBhIHNxdWFyZSBib3guCisgICAgICAgIGZpbGxSZWN0KHJlY3QsIGNvbG9yKTsK
KyAgICAgICAgcmV0dXJuOworICAgIH0KKwogICAgIFNrUGF0aCBwYXRoOwogICAgIGFkZENvcm5l
ckFyYygmcGF0aCwgciwgdG9wUmlnaHQsIDI3MCk7CiAgICAgYWRkQ29ybmVyQXJjKCZwYXRoLCBy
LCBib3R0b21SaWdodCwgMCk7CkBAIC03ODYsNyArNzk3LDYgQEAgdm9pZCBHcmFwaGljc0NvbnRl
eHQ6OmZpbGxSb3VuZGVkUmVjdChjbwogICAgIFNrUGFpbnQgcGFpbnQ7CiAgICAgcGxhdGZvcm1D
b250ZXh0KCktPnNldHVwUGFpbnRGb3JGaWxsaW5nKCZwYWludCk7CiAgICAgcGxhdGZvcm1Db250
ZXh0KCktPmNhbnZhcygpLT5kcmF3UGF0aChwYXRoLCBwYWludCk7Ci0gICAgcmV0dXJuIGZpbGxS
ZWN0KHJlY3QsIGNvbG9yKTsKIH0KIAogVHJhbnNmb3JtYXRpb25NYXRyaXggR3JhcGhpY3NDb250
ZXh0OjpnZXRDVE0oKSBjb25zdAo=
</data>
<flag name="review"
          id="13358"
          type_id="1"
          status="+"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>