<?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>54299</bug_id>
          
          <creation_ts>2011-02-11 11:28:06 -0800</creation_ts>
          <short_desc>need makeContextCurrent() called in prepareForSoftwareDraw()</short_desc>
          <delta_ts>2011-02-11 15:22:46 -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>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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mike Reed">reed</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>jamesr</cc>
    
    <cc>kbr</cc>
    
    <cc>mdelaney7</cc>
    
    <cc>reed</cc>
    
    <cc>vangelis</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>349868</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-11 11:28:06 -0800</bug_when>
    <thetext>when skia is backed by a gpu, we need to ensure that the current gl context is always set before we render.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349873</commentid>
    <comment_count>1</comment_count>
      <attachid>82154</attachid>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-11 11:33:12 -0800</bug_when>
    <thetext>Created attachment 82154
fix for 54299 -- call makeContextCurrent() in prepareForSoftwareDraw() when Skia is backed by the GPU</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349881</commentid>
    <comment_count>2</comment_count>
      <attachid>82157</attachid>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-11 11:39:24 -0800</bug_when>
    <thetext>Created attachment 82157
fix weird loss of comments in ChangeLog</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349887</commentid>
    <comment_count>3</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-02-11 11:44:54 -0800</bug_when>
    <thetext>I don&apos;t totally understand this patch - why doesn&apos;t the code issuing the GL calls (in this case skia) take care of setting the current context?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349937</commentid>
    <comment_count>4</comment_count>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-11 12:50:08 -0800</bug_when>
    <thetext>The library explicitly relies on its client to take care of that, since creation of management of clients is platform dependent, and clients of ganesh also can use the gpu directly (ganesh is just there to translate 2D into gpu calls).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>349949</commentid>
    <comment_count>5</comment_count>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-11 13:01:21 -0800</bug_when>
    <thetext>As a 2nd note, the existing GraphicsContext3DOpenGL.cpp issues this call before every gl... call. This patch follows the same logical pattern, but happens to be a bit more efficient, in that we only issue the call before each high-level 2D primitive, which may turn into may gl... calls.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350028</commentid>
    <comment_count>6</comment_count>
      <attachid>82157</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-02-11 14:19:30 -0800</bug_when>
    <thetext>Comment on attachment 82157
fix weird loss of comments in ChangeLog

Makes sense.  I think the confusing part is that prepareForSoftwareDraw() is misnamed - what it really means in this context is prepareForSkiaDraw(), as opposed to the h/w drawing backend.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350046</commentid>
    <comment_count>7</comment_count>
      <attachid>82157</attachid>
    <who name="Vangelis Kokkevis">vangelis</who>
    <bug_when>2011-02-11 14:36:13 -0800</bug_when>
    <thetext>Comment on attachment 82157
fix weird loss of comments in ChangeLog

I think we need to make the same change to ::prepareForHardwareDraw() as well.  In addition we need to replace:
#if ENABLE(SKIA_GPU) by #if ENABLE(ACCELERATED_2D_CANVAS) &amp;&amp; ENABLE(SKIA_GPU)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350061</commentid>
    <comment_count>8</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-02-11 14:50:57 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (From update of attachment 82157 [details])
&gt; I think we need to make the same change to ::prepareForHardwareDraw() as well.  In addition we need to replace:
&gt; #if ENABLE(SKIA_GPU) by #if ENABLE(ACCELERATED_2D_CANVAS) &amp;&amp; ENABLE(SKIA_GPU)

prepareForHardwareDraw() is never reached in the skia GPU path</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350074</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-11 15:04:12 -0800</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 82157:

http/tests/websocket/tests/alert-in-event-handler.html bug 54316 (author: abarth@webkit.org)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350076</commentid>
    <comment_count>10</comment_count>
      <attachid>82157</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-11 15:05:42 -0800</bug_when>
    <thetext>Comment on attachment 82157
fix weird loss of comments in ChangeLog

Clearing flags on attachment: 82157

Committed r78377: &lt;http://trac.webkit.org/changeset/78377&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350077</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-11 15:05:47 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350089</commentid>
    <comment_count>12</comment_count>
    <who name="Vangelis Kokkevis">vangelis</who>
    <bug_when>2011-02-11 15:22:46 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; (From update of attachment 82157 [details] [details])
&gt; &gt; I think we need to make the same change to ::prepareForHardwareDraw() as well.  In addition we need to replace:
&gt; &gt; #if ENABLE(SKIA_GPU) by #if ENABLE(ACCELERATED_2D_CANVAS) &amp;&amp; ENABLE(SKIA_GPU)
&gt; 
&gt; prepareForHardwareDraw() is never reached in the skia GPU path

Good point! But then we have another problem... prepareForSoftwareDraw() isn&apos;t called before every call that renders via platformContext()-&gt;canvas() which means that there are calls  (e.g. GraphicsContext::clearRect()) which won&apos;t set the current GL context correctly.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82154</attachid>
            <date>2011-02-11 11:33:12 -0800</date>
            <delta_ts>2011-02-11 11:39:24 -0800</delta_ts>
            <desc>fix for 54299 -- call makeContextCurrent() in prepareForSoftwareDraw() when Skia is backed by the GPU</desc>
            <filename>prepare.txt</filename>
            <type>text/plain</type>
            <size>1290</size>
            <attacher name="Mike Reed">reed</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA3ODM1MSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTQgQEAKKzIwMTEtMDItMTEgIE1pa2UgUmVlZCAgPHJlZWRAZ29vZ2xlLmNvbT4K
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBOZWVkIGEg
c2hvcnQgZGVz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29udGV4dCgpLT5tYWtlQ29udGV4dEN1cnJlbnQoKTsKKyNl
bmRpZgogICAgICAgICByZXR1cm47CisgICAgfQogCiAgICAgaWYgKG1fYmFja2luZ1N0b3JlU3Rh
dGUgPT0gSGFyZHdhcmUpIHsKICAgICAgICAgLy8gRGVwZW5kaW5nIG9uIHRoZSBibGVuZCBtb2Rl
IHdlIG5lZWQgdG8gZG8gb25lIG9mIGEgZmV3IHRoaW5nczoK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82157</attachid>
            <date>2011-02-11 11:39:24 -0800</date>
            <delta_ts>2011-02-11 15:05:42 -0800</delta_ts>
            <desc>fix weird loss of comments in ChangeLog</desc>
            <filename>prepare.txt</filename>
            <type>text/plain</type>
            <size>1464</size>
            <attacher name="Mike Reed">reed</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA3ODM1MSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTUgQEAKKzIwMTEtMDItMTEgIE1pa2UgUmVlZCAgPHJlZWRAZ29vZ2xlLmNvbT4K
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBOZWVkIG1h
a2VDb250ZXh0Q3VycmVudCgpIGNhbGxlZCBpbiBwcmVwYXJlRm9yU29mdHdhcmVEcmF3KCksIGlu
IHRoZSBjYXNlIHRoYXQgc2tpYSdzIGJhY2tlbmQKKyAgICAgICAgaXMgdGhlIGdwdS4gVGhpcyBt
YXRjaGVzIHRoZSBwYXR0ZXJuIGluIEdyYXBoaWNzQ29udGV4dDNET3BlbkdMLmNwcAorCisgICAg
ICA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wdUNhbnZhcy0+Y29udGV4dCgpLT5tYWtlQ29udGV4dEN1cnJlbnQoKTsK
KyNlbmRpZgogICAgICAgICByZXR1cm47CisgICAgfQogCiAgICAgaWYgKG1fYmFja2luZ1N0b3Jl
U3RhdGUgPT0gSGFyZHdhcmUpIHsKICAgICAgICAgLy8gRGVwZW5kaW5nIG9uIHRoZSBibGVuZCBt
b2RlIHdlIG5lZWQgdG8gZG8gb25lIG9mIGEgZmV3IHRoaW5nczoK
</data>

          </attachment>
      

    </bug>

</bugzilla>