<?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>54561</bug_id>
          
          <creation_ts>2011-02-16 08:48:25 -0800</creation_ts>
          <short_desc>[chromium] Layout Test fast/canvas/setWidthResetAfterForcedRender.html fails on accelerated 2D canvas</short_desc>
          <delta_ts>2011-02-28 12:45:19 -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>Canvas</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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="Stephen White">senorblanco</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>eric</cc>
    
    <cc>honten</cc>
    
    <cc>jamesr</cc>
    
    <cc>kbr</cc>
    
    <cc>mdelaney7</cc>
    
    <cc>vangelis</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>352105</commentid>
    <comment_count>0</comment_count>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-16 08:48:25 -0800</bug_when>
    <thetext>This layout test should produce a blank rectangle below the text, but produces a green one instead.  It seems that the accelerated path is not clearing the canvas as it should.instead</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352187</commentid>
    <comment_count>1</comment_count>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-16 10:46:11 -0800</bug_when>
    <thetext>Notes for posterity:

This seems to be due to an interaction between the compositor and the accelerated 2D canvas.  If I run DumpRenderTree on this test with only --enable-accelerated-2d-canvas, it gives the correct result.  It&apos;s only when both that flag and --enable-accelerated-compositing are enabled that it fails (green square instead of white).

It seems as if the compositor is not updating the canvas after the DrawingBuffer is reset.  My first attempt was to try to update the compositor via a call to setNeedsStyleRecalc() in HTMLCanvasElement.cpp:

251c251,256
&lt;             if (hadImageBuffer)
---
&gt;             if (hadImageBuffer) {
&gt; #if USE(IOSURFACE_CANVAS_BACKING_STORE) || (ENABLE(ACCELERATED_2D_CANVAS) &amp;&amp; USE(ACCELERATED_COMPOSITING))
&gt;                 // Force a compositor update as well.
&gt;                 if (m_context)
&gt;                     setNeedsStyleRecalc(SyntheticStyleChange);
&gt; #endif
252a258,259
&gt;             }
&gt; 

But this seems to cause the compositor to redraw the entire page.  So the canvas rectangle is white (good), but the rest of the page is full intensity, i.e., not covered by the half-alpha mask which indicates non-repainted areas (bad).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352234</commentid>
    <comment_count>2</comment_count>
      <attachid>82670</attachid>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-16 11:53:50 -0800</bug_when>
    <thetext>Created attachment 82670
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352236</commentid>
    <comment_count>3</comment_count>
      <attachid>82670</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-02-16 11:56:33 -0800</bug_when>
    <thetext>Comment on attachment 82670
Patch

Odd - the repaint() alone should be enough to force a recomposite.  What happens on normal draw calls?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352239</commentid>
    <comment_count>4</comment_count>
      <attachid>82670</attachid>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-16 12:00:08 -0800</bug_when>
    <thetext>Comment on attachment 82670
Patch

Taking r? off this, since I&apos;m not sure it&apos;s the correct solution yet.  Just wanted to put it in context.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352399</commentid>
    <comment_count>5</comment_count>
      <attachid>82707</attachid>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-16 15:22:50 -0800</bug_when>
    <thetext>Created attachment 82707
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352402</commentid>
    <comment_count>6</comment_count>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-16 15:26:10 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; Created an attachment (id=82707) [details]
&gt; Patch

I&apos;m more confident in this fix.  This basically does the same thing that CanvasRenderingContext2D::didDraw() does, by calling contentChanged() on the RenderLayer.  This still leaves the pixel results wrong, since the compositor doesn&apos;t seem to be compatible with repaint tests (it redraws the whole image), but at least the canvas reset is correctly showing up now (white box instead of green).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353034</commentid>
    <comment_count>7</comment_count>
      <attachid>82707</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-02-17 11:09:58 -0800</bug_when>
    <thetext>Comment on attachment 82707
Patch

R=me.

Thought: could we call didDraw(FloatRect(canvas()-&gt;width(), canvas-&gt;height()) ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353043</commentid>
    <comment_count>8</comment_count>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-17 11:19:58 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (From update of attachment 82707 [details])
&gt; R=me.
&gt; 
&gt; Thought: could we call didDraw(FloatRect(canvas()-&gt;width(), canvas-&gt;height()) ?

We probably could, but this might also affect the software path, which I don&apos;t believe needs this change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353228</commentid>
    <comment_count>9</comment_count>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-17 15:57:08 -0800</bug_when>
    <thetext>The commit queue kept failing on unrelated tests, so I landed this manually as http://trac.webkit.org/changeset/78922.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>353248</commentid>
    <comment_count>10</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-02-17 16:55:45 -0800</bug_when>
    <thetext>The cq was waiting for the tree to be green.  It runs &quot;hot&quot; in that it keeps trying until success.  It didn&apos;t ever &quot;fail&quot; this patch or it would have noted so in the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358282</commentid>
    <comment_count>11</comment_count>
    <who name="Naoki Takano">honten</who>
    <bug_when>2011-02-25 16:55:40 -0800</bug_when>
    <thetext>Still the tree info fails but the bug itself looks correct.

So we have to 

(In reply to comment #10)
&gt; The cq was waiting for the tree to be green.  It runs &quot;hot&quot; in that it keeps trying until success.  It didn&apos;t ever &quot;fail&quot; this patch or it would have noted so in the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>358284</commentid>
    <comment_count>12</comment_count>
    <who name="Naoki Takano">honten</who>
    <bug_when>2011-02-25 16:58:14 -0800</bug_when>
    <thetext>Oops, sorry, I miss-operated.

Still the tree info fails but the bug itself looks gone.
 
So we have to correct &quot;expected&quot; tree files.

I guess, not only setWidthResetAfterForcedRender.html, but also other layout test fail because the tree result is unexpected.

(In reply to comment #11)
&gt; 
&gt; (In reply to comment #10)
&gt; &gt; The cq was waiting for the tree to be green.  It runs &quot;hot&quot; in that it keeps trying until success.  It didn&apos;t ever &quot;fail&quot; this patch or it would have noted so in the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>359086</commentid>
    <comment_count>13</comment_count>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2011-02-28 08:44:54 -0800</bug_when>
    <thetext>(In reply to comment #12)
&gt; Oops, sorry, I miss-operated.
&gt; 
&gt; Still the tree info fails but the bug itself looks gone.
&gt; 
&gt; So we have to correct &quot;expected&quot; tree files.
&gt; 
&gt; I guess, not only setWidthResetAfterForcedRender.html, but also other layout test fail because the tree result is unexpected.

Although the results are correct in Chrome (same result in software or hardware), the test is still failing since LayoutTestController does not seem to do the right thing for composited layers.  I think we need a way to make LayoutTestController.display() (or more precisely, WebViewHost::displayRepaintMask) write its results into the composited layer, rather than on top of the framebuffer.

So in this case, we shouldn&apos;t rebaseline (commit a new expected result), since the result is still wrong until LayoutTestController is fixed.

&gt; (In reply to comment #11)
&gt; &gt; 
&gt; &gt; (In reply to comment #10)
&gt; &gt; &gt; The cq was waiting for the tree to be green.  It runs &quot;hot&quot; in that it keeps trying until success.  It didn&apos;t ever &quot;fail&quot; this patch or it would have noted so in the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>359251</commentid>
    <comment_count>14</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2011-02-28 12:45:19 -0800</bug_when>
    <thetext>(In reply to comment #13)
&gt; Although the results are correct in Chrome (same result in software or hardware), the test is still failing since LayoutTestController does not seem to do the right thing for composited layers.  I think we need a way to make LayoutTestController.display() (or more precisely, WebViewHost::displayRepaintMask) write its results into the composited layer, rather than on top of the framebuffer.
&gt; 
&gt; So in this case, we shouldn&apos;t rebaseline (commit a new expected result), since the result is still wrong until LayoutTestController is fixed.

Is there a bug filed about this issue with the LayoutTestController and the compositor? If not, could you file one?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82670</attachid>
            <date>2011-02-16 11:53:50 -0800</date>
            <delta_ts>2011-02-16 15:22:47 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-54561-20110216145348.patch</filename>
            <type>text/plain</type>
            <size>1700</size>
            <attacher name="Stephen White">senorblanco</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDc4NzExKQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl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gU291cmNlL1dlYkNvcmUvaHRtbC9IVE1MQ2FudmFzRWxlbWVudC5jcHAJKHJldmlz
aW9uIDc4NzExKQorKysgU291cmNlL1dlYkNvcmUvaHRtbC9IVE1MQ2FudmFzRWxlbWVudC5jcHAJ
KHdvcmtpbmcgY29weSkKQEAgLTI0OCw4ICsyNDgsMTUgQEAgdm9pZCBIVE1MQ2FudmFzRWxlbWVu
dDo6cmVzZXQoKQogICAgICAgICBpZiAobV9yZW5kZXJlcklzQ2FudmFzKSB7CiAgICAgICAgICAg
ICBpZiAob2xkU2l6ZSAhPSBzaXplKCkpCiAgICAgICAgICAgICAgICAgdG9SZW5kZXJIVE1MQ2Fu
dmFzKHJlbmRlcmVyKS0+Y2FudmFzU2l6ZUNoYW5nZWQoKTsKLSAgICAgICAgICAgIGlmIChoYWRJ
bWFnZUJ1ZmZlcikKKyAgICAgICAgICAgIGlmIChoYWRJbWFnZUJ1ZmZlcikgeworI2lmIFVTRShJ
T1NVUkZBQ0VfQ0FOVkFTX0JBQ0tJTkdfU1RPUkUpIHx8IChFTkFCTEUoQUNDRUxFUkFURURfMkRf
Q0FOVkFTKSAmJiBVU0UoQUNDRUxFUkFURURfQ09NUE9TSVRJTkcpKQorICAgICAgICAgICAgICAg
IC8vIEZvcmNlIGEgY29tcG9zaXRvciB1cGRhdGUgYXMgd2VsbC4KKyAgICAgICAgICAgICAgICBp
ZiAobV9jb250ZXh0KQorICAgICAgICAgICAgICAgICAgICBzZXROZWVkc1N0eWxlUmVjYWxjKFN5
bnRoZXRpY1N0eWxlQ2hhbmdlKTsKKyNlbmRpZgogICAgICAgICAgICAgICAgIHJlbmRlcmVyLT5y
ZXBhaW50KCk7CisgICAgICAgICAgICB9CisKICAgICAgICAgfQogICAgIH0KIAo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82707</attachid>
            <date>2011-02-16 15:22:50 -0800</date>
            <delta_ts>2011-02-17 15:36:18 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-54561-20110216182249.patch</filename>
            <type>text/plain</type>
            <size>2098</size>
            <attacher name="Stephen White">senorblanco</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDc4NzM5KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMjMgQEAKKzIwMTEtMDItMTYgIFN0ZXBoZW4g
V2hpdGUgIDxzZW5vcmJsYW5jb0BjaHJvbWl1bS5vcmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkg
Tk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgTGF5b3V0IFRlc3QgZmFzdC9jYW52YXMvc2V0V2lk
dGhSZXNldEFmdGVyRm9yY2VkUmVuZGVyLmh0bWwgZmFpbHMgb24KKyAgICAgICAgYWNjZWxlcmF0
ZWQgMkQgY2FudmFzIHcvY29tcG9zaXRvciBlbmFibGVkLgorICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NTQ1NjEKKworICAgICAgICBXaGVuIHJlc2V0dGlu
ZyB0aGUgQ2FudmFzUmVuZGVyaW5nQ29udGV4dDJELCB3ZSBhbHNvIG5lZWQgdG8gc2VuZCBhCisg
ICAgICAgIGNvbnRlbnRDaGFuZ2VkKCkgdG8gdGhlIHJlbGV2YW50IFJlbmRlckxheWVyLiAgVGhp
cyBpcyBzaW1pbGFyIHRvIHdoYXQKKyAgICAgICAgaXMgZG9uZSBpbiBkaWREcmF3KCkuCisKKyAg
ICAgICAgQ292ZXJlZCBieSBmYXN0L2NhbnZhcy9zZXRXaWR0aFJlc2V0QW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0M0QgJiYgbV9kcmF3aW5nQnVmZmVyKSB7CiAgICAgICAgICAgICBtX2RyYXdpbmdCdWZmZXIt
PnJlc2V0KEludFNpemUoY2FudmFzKCktPndpZHRoKCksIGNhbnZhcygpLT5oZWlnaHQoKSkpOwog
ICAgICAgICAgICAgYy0+c2V0U2hhcmVkR3JhcGhpY3NDb250ZXh0M0QobV9jb250ZXh0M0QuZ2V0
KCksIG1fZHJhd2luZ0J1ZmZlci5nZXQoKSwgSW50U2l6ZShjYW52YXMoKS0+d2lkdGgoKSwgY2Fu
dmFzKCktPmhlaWdodCgpKSk7CisjaWYgVVNFKEFDQ0VMRVJBVEVEX0NPTVBPU0lUSU5HKQorICAg
ICAgICAgICAgUmVuZGVyQm94KiByZW5kZXJCb3ggPSBjYW52YXMoKS0+cmVuZGVyQm94KCk7Cisg
ICAgICAgICAgICBpZiAocmVuZGVyQm94ICYmIHJlbmRlckJveC0+aGFzTGF5ZXIoKSAmJiByZW5k
ZXJCb3gtPmxheWVyKCktPmhhc0FjY2VsZXJhdGVkQ29tcG9zaXRpbmcoKSkKKyAgICAgICAgICAg
ICAgICByZW5kZXJCb3gtPmxheWVyKCktPmNvbnRlbnRDaGFuZ2VkKFJlbmRlckxheWVyOjpDYW52
YXNDaGFuZ2VkKTsKKyNlbmRpZgogICAgICAgICB9CiAgICAgfQogI2VuZGlmCg==
</data>
<flag name="review"
          id="74397"
          type_id="1"
          status="+"
          setter="jamesr"
    />
          </attachment>
      

    </bug>

</bugzilla>