<?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>62318</bug_id>
          
          <creation_ts>2011-06-08 13:59:25 -0700</creation_ts>
          <short_desc>Avoid always binding FBO 0 implicitly when deleting FBO in DrawingBuffer code because it invalidates Ganesh&apos;s cache of the current FBO.</short_desc>
          <delta_ts>2011-06-08 16:25:54 -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>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brian Salomon">bsalomon</reporter>
          <assigned_to name="Brian Salomon">bsalomon</assigned_to>
          <cc>jamesr</cc>
    
    <cc>reed</cc>
    
    <cc>senorblanco</cc>
    
    <cc>vangelis</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>417485</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Salomon">bsalomon</who>
    <bug_when>2011-06-08 13:59:25 -0700</bug_when>
    <thetext>Don&apos;t bind aframebuffer before deleting it in DrawingBuffer::clear()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417564</commentid>
    <comment_count>1</comment_count>
      <attachid>96487</attachid>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-06-08 14:52:18 -0700</bug_when>
    <thetext>Created attachment 96487
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417572</commentid>
    <comment_count>2</comment_count>
      <attachid>96487</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-06-08 14:57:29 -0700</bug_when>
    <thetext>Comment on attachment 96487
Patch

Could you expand on how this leads to a crash?  Binding before deleting is weird, but it shouldn&apos;t be harmful unless there is a bug somewhere else.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417577</commentid>
    <comment_count>3</comment_count>
    <who name="Brian Salomon">bsalomon</who>
    <bug_when>2011-06-08 15:02:20 -0700</bug_when>
    <thetext>Deleting the bound FBO implicitly binds FBO 0. This confuses Ganesh which thinks it knows the currently bound FBO. 

This isn&apos;t a fix-all for coordinating GL state changes between DrawingBuffer and Ganesh. But it is a simple low risk change that fixes a M13 blocker.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417578</commentid>
    <comment_count>4</comment_count>
      <attachid>96487</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-06-08 15:04:02 -0700</bug_when>
    <thetext>Comment on attachment 96487
Patch

I think you need to do the same thing on line 87.

Are you sure that this codepath is never hit with the drawingbuffer&apos;s m_fbo already bound?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417581</commentid>
    <comment_count>5</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-06-08 15:06:58 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Deleting the bound FBO implicitly binds FBO 0. This confuses Ganesh which thinks it knows the currently bound FBO. 
&gt; 
&gt; This isn&apos;t a fix-all for coordinating GL state changes between DrawingBuffer and Ganesh. But it is a simple low risk change that fixes a M13 blocker.

OK, so it sounds like the real bug here is that DrawingBuffer::clear() changes the currently bound framebuffer, and it shouldn&apos;t?  Could you update the bug title + ChangeLog text to indicate that&apos;s what is going on?

It seems pretty fragile to depend on this function not changing the current framebuffer binding...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417588</commentid>
    <comment_count>6</comment_count>
      <attachid>96491</attachid>
    <who name="Brian Salomon">bsalomon</who>
    <bug_when>2011-06-08 15:17:15 -0700</bug_when>
    <thetext>Created attachment 96491
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417592</commentid>
    <comment_count>7</comment_count>
    <who name="Brian Salomon">bsalomon</who>
    <bug_when>2011-06-08 15:22:04 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt;(From update of attachment 96487 [details])
&gt;I think you need to do the same thing on line 87.

Done in the latest patch.

&gt;Are you sure that this codepath is never hit with the drawingbuffer&apos;s m_fbo &gt;already bound?

In that case we&apos;re actually OK. The Gr object that wraps the DrawingBuffer&apos;s FBO is destroyed which causes Gr to invalidate its cache of the currently bound FBO.


(In reply to comment #5)
&gt; OK, so it sounds like the real bug here is that DrawingBuffer::clear() changes the currently bound framebuffer, and it shouldn&apos;t?  Could you update the bug title + ChangeLog text to indicate that&apos;s what is going on?
&gt; 

Yup, done in the latest patch.

&gt; It seems pretty fragile to depend on this function not changing the current framebuffer binding...

I agree it is fragile. There will be a more robust fix for M14+.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417610</commentid>
    <comment_count>8</comment_count>
      <attachid>96491</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-06-08 15:35:12 -0700</bug_when>
    <thetext>Comment on attachment 96491
Patch

Seems OK</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417618</commentid>
    <comment_count>9</comment_count>
    <who name="Brian Salomon">bsalomon</who>
    <bug_when>2011-06-08 15:40:47 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (From update of attachment 96491 [details])
&gt; Seems OK

Thanks! I forgot to set commit:? after I uploaded.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417670</commentid>
    <comment_count>10</comment_count>
      <attachid>96491</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-06-08 16:25:50 -0700</bug_when>
    <thetext>Comment on attachment 96491
Patch

Clearing flags on attachment: 96491

Committed r88403: &lt;http://trac.webkit.org/changeset/88403&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>417671</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-06-08 16:25:54 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>96487</attachid>
            <date>2011-06-08 14:52:18 -0700</date>
            <delta_ts>2011-06-08 15:17:09 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-62318-20110608175216.patch</filename>
            <type>text/plain</type>
            <size>1311</size>
            <attacher name="Mike Reed">reed</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDg4MzkxKQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTggQEAKKzIwMTEtMDYtMDggIE1pa2UgUmVl
ZCAgPHJlZWRAZ29vZ2xlLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMh
KS4KKworICAgICAgICBEb24ndCBiaW5kIGEgZnJhbWVidWZmZXIgYmVmb3JlIGRlbGV0aW5nIGl0
IGluIERyYXdpbmdCdWZmZXI6OmNsZWFyKCkKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5v
cmcvc2hvd19idWcuY2dpP2lkPTYyMzE4CisKKyAgICAgICAgTm8gbmV3IHRlc3RzLgorICAgICAg
ICBDaHJvbWl1bS1vbmx5IGNyYXNoCisgICAgICAgIEZ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8pOwogICAgIG1fZmJvID0gMDsKIH0K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>96491</attachid>
            <date>2011-06-08 15:17:15 -0700</date>
            <delta_ts>2011-06-08 16:25:50 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-62318-20110608181713.patch</filename>
            <type>text/plain</type>
            <size>1551</size>
            <attacher name="Brian Salomon">bsalomon</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDg4Mzk1KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTcgQEAKKzIwMTEtMDYtMDggIEJyaWFuIFNh
bG9tb24gIDxic2Fsb21vbkBnb29nbGUuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIEF2b2lkIGFsd2F5cyBiaW5kaW5nIEZCTyAwIGltcGxpY2l0
bHkgd2hlbiBkZWxldGluZyBGQk8gaW4gRHJhd2luZ0J1ZmZlciBjb2RlIGJlY2F1c2UgaXQgaW52
YWxpZGF0ZXMgR2FuZXNoJ3MgY2FjaGUgb2YgdGhlIGN1cnJlbnQgRkJPLgorICAgICAgICBodHRw
czovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NjIzMTgKKworICAgICAgICBDaHJv
bWl1bS1vbmx5IGNyYXNoCisgICAgICAgIEZhaWx1cmVzIHRha2VzIG11bHRpcGxlIHNlY29uZHMg
dG8gb2NjdXIsIHJlbHlpbmcgb24gSlMgZ2FyYmFnZS1jb2xsZWN0aW9uIHRvIG9jY3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+YmluZEZyYW1lYnVmZmVyKEdyYXBoaWNzQ29udGV4dDNEOjpGUkFNRUJVRkZFUiwg
bV9mYm8pOwogICAgIG1fY29udGV4dC0+ZGVsZXRlRnJhbWVidWZmZXIobV9mYm8pOwogICAgIG1f
ZmJvID0gMDsKIH0K
</data>

          </attachment>
      

    </bug>

</bugzilla>