<?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>38528</bug_id>
          
          <creation_ts>2010-05-04 10:17:10 -0700</creation_ts>
          <short_desc>[Qt] WebGL viewport does not show up on N900</short_desc>
          <delta_ts>2010-06-17 01:20:15 -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>WebKit Qt</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</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>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jarkko Sakkinen">jarkko.j.sakkinen</reporter>
          <assigned_to name="Jarkko Sakkinen">jarkko.j.sakkinen</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>hausmann</cc>
    
    <cc>jesus</cc>
    
    <cc>kbr</cc>
    
    <cc>laszlo.gombos</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>220642</commentid>
    <comment_count>0</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-04 10:17:10 -0700</bug_when>
    <thetext>WebGL viewport does not show up anymore on N900 when tested with QtLauncher.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220985</commentid>
    <comment_count>1</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-05 00:20:53 -0700</bug_when>
    <thetext>Issue here is simple. Higher-level WebGL code does not handle precision arguments yet (I suppose) and WebGL applications do not usually define precisions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220988</commentid>
    <comment_count>2</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-05 00:27:55 -0700</bug_when>
    <thetext>Verified that there is no code that handles shader precisions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220990</commentid>
    <comment_count>3</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-05 00:31:47 -0700</bug_when>
    <thetext>https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/WebGL-spec.html#4.4

Issue here is that most of the WebGL pages do not respect that at all :) Shaders are not ES GLSL compatible. They don&apos;t define precision arguments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220992</commentid>
    <comment_count>4</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-05 00:33:41 -0700</bug_when>
    <thetext>QGLContext::drawTexture functions do not work in Maemo version. Tweaked qgl.cpp a little bit:

diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 644a737..da61e61 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2706,7 +2706,7 @@ void QGLContext::drawTexture(const QRectF &amp;target, QMacCompatGLuint textureId, Q
 void QGLContext::drawTexture(const QPointF &amp;point, GLuint textureId, GLenum textureTarget)
 {
     // this would be ok on OpenGL ES 2.0, but currently we don&apos;t have a define for that
-#ifdef QT_OPENGL_ES
+#if !defined(QT_OPENGL_ES_2) &amp;&amp; defined(QT_OPENGL_ES)
     Q_UNUSED(point);
     Q_UNUSED(textureId);
     Q_UNUSED(textureTarget);


Let&apos;s how that helps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220996</commentid>
    <comment_count>5</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-05 00:51:20 -0700</bug_when>
    <thetext>Kenneth, Simon says that you have some ideas on handling the precision argument in shader code. Can you elaborate a bit what you have in mind? :)

I think I&apos;ll add the following work-around to Qt backend:
- QtWebKit is compiled for a desktop system: define precision arguments as empty macros so that shaders still compile (similar idea as in http://doc.qt.nokia.com/4.6-snapshot/qglshaderprogram.html)
- QtWebKit is compiled for a mobile device: define default precisions and append to the beginning of shader code.

When something more higher-level comes out this workaround can be dropped. Simon, I don&apos;t find that too hackish, what do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221043</commentid>
    <comment_count>6</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-05 03:43:19 -0700</bug_when>
    <thetext>Added new bugreport to Qt Jira: http://bugreports.qt.nokia.com/browse/QTBUG-10420</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221133</commentid>
    <comment_count>7</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-05 09:04:53 -0700</bug_when>
    <thetext>See my comment on Qt Jira. I think point version of drawTexture() is really impossible to make work ES 2.0 but I don&apos;t actually can&apos;t figure out why rect version is only available for ES versions less than 2.0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221142</commentid>
    <comment_count>8</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-05 09:27:39 -0700</bug_when>
    <thetext>Ok that first &quot;patch snippet&quot; was completely crap but now I have patch candidate for rect version, let&apos;s see if it works :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>221144</commentid>
    <comment_count>9</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2010-05-05 09:31:29 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Kenneth, Simon says that you have some ideas on handling the precision argument
&gt; in shader code. Can you elaborate a bit what you have in mind? :)

In the context of the ANGLE project ( http://code.google.com/p/angleproject/ ) a GLSL ES -&gt; GLSL translator is being developed. Once this is complete, we hope to work with all browser vendors developing WebGL on the desktop to integrate it simultaneously, because as you&apos;ve discovered, none of the shaders in the WebGL content currently on the web are GLSL ES compliant.

&gt; I think I&apos;ll add the following work-around to Qt backend:
&gt; - QtWebKit is compiled for a desktop system: define precision arguments as
&gt; empty macros so that shaders still compile (similar idea as in
&gt; http://doc.qt.nokia.com/4.6-snapshot/qglshaderprogram.html)
&gt; - QtWebKit is compiled for a mobile device: define default precisions and
&gt; append to the beginning of shader code.
&gt; 
&gt; When something more higher-level comes out this workaround can be dropped.
&gt; Simon, I don&apos;t find that too hackish, what do you think?

This sounds like the best short-term workaround.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>223795</commentid>
    <comment_count>10</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-11 00:24:32 -0700</bug_when>
    <thetext>drawTexture() issue is now fixed by Qt people: http://bugreports.qt.nokia.com/browse/QTBUG-10420. Great :) I&apos;m submitting soon patch with workaround for shaders.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>224579</commentid>
    <comment_count>11</comment_count>
    <who name="Jesus Sanchez-Palencia">jesus</who>
    <bug_when>2010-05-12 06:57:42 -0700</bug_when>
    <thetext>Please remember to block the 2.0 release meta-bug if you want this to be cherry-picked when the patch is ready.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225721</commentid>
    <comment_count>12</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-14 02:00:47 -0700</bug_when>
    <thetext>Still waiting for the drawTexture() fix to arrive to Qt public repositories.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225739</commentid>
    <comment_count>13</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-05-14 03:42:10 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; Still waiting for the drawTexture() fix to arrive to Qt public repositories.

Sounds like we should also make WebGL only available when compiling against Qt 4.7?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>225744</commentid>
    <comment_count>14</comment_count>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-14 03:59:54 -0700</bug_when>
    <thetext>Depends. If we want to keep readPixels as a fallback for 4.6 then we can support both. I don&apos;t really have an opinnion on this, I&apos;ll let others to decide this :) 

Simon, have you already created bug for dropping readPixels? We already discussed about readPixels support but does everyone else share the opinnion that WebGL should be only supported with GL viewport? 

drawTexture() can be used for both cases (AC enabled/disabled) when GL viewport is active. I have already fix for this in my gitorious repository and I&apos;m planning to add that change to this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>228361</commentid>
    <comment_count>15</comment_count>
      <attachid>56592</attachid>
    <who name="Jarkko Sakkinen">jarkko.j.sakkinen</who>
    <bug_when>2010-05-20 07:01:49 -0700</bug_when>
    <thetext>Created attachment 56592
Fixes shader issues with OGLES2, improves drawTexture usage a bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>239190</commentid>
    <comment_count>16</comment_count>
      <attachid>56592</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-06-16 19:55:20 -0700</bug_when>
    <thetext>Comment on attachment 56592
Fixes shader issues with OGLES2, improves drawTexture usage a bit.

Clearing flags on attachment: 56592

Committed r61301: &lt;http://trac.webkit.org/changeset/61301&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>239191</commentid>
    <comment_count>17</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-06-16 19:55:26 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>239280</commentid>
    <comment_count>18</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-06-17 01:20:15 -0700</bug_when>
    <thetext>WebGL is not part of the QtWebKit 2.0 release, so removing from the blocker bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>56592</attachid>
            <date>2010-05-20 07:01:49 -0700</date>
            <delta_ts>2010-06-16 19:55:20 -0700</delta_ts>
            <desc>Fixes shader issues with OGLES2, improves drawTexture usage a bit.</desc>
            <filename>38528-1.patch</filename>
            <type>text/plain</type>
            <size>3688</size>
            <attacher name="Jarkko Sakkinen">jarkko.j.sakkinen</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
ZWRiZmI3Ni4uMmEzOGRiOSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwyMCBAQAorMjAxMC0wNS0yMCAgSmFya2tvIFNha2tp
bmVuICA8amFya2tvLmouc2Fra2luZW5AZ21haWwuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5
IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIFtRdF0gV2ViR0wgdmlld3BvcnQgZG9lcyBub3Qg
c2hvdyB1cCBvbiBOOTAwICAKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19i
dWcuY2dpP2lkPTM4NTI4CisKKyAgICAgICAgV2l0aCBPR0xFUzIgYWRkIGRlZmF1bHQgcHJlY2lz
aW9uIHRvIHRoZSBzaGFkZXIgY29kZS4KKyAgICAgICAgVXNlIEdMc2l6ZWlwdHIgYW5kIEdMaW50
cHRyIHdpdGggT0dMRVMyLgorICAgICAgICBDYWxsIHBhaW50KCkgaW4gYmVnaW5QYWludCgpIHNv
IHRoYXQgZHJhd1RleHR1cmUoKSBpcyB1c2VkIAorICAgICAgICB3aGVuZXZlciBwb3NzaWJsZS4K
KworICAgICAgICAqIHBsYXRmb3JtL2dyYXBoaWNzL3F0L0dyYXBoaWNzQ29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zb3IobG9uZyB4
LCBsb25nIHksIHVuc2lnbmVkIGxvbmcgd2lkdGgsIHVuc2lnbmVkIGxvCiB2b2lkIEdyYXBoaWNz
Q29udGV4dDNEOjpzaGFkZXJTb3VyY2UoV2ViR0xTaGFkZXIqIHNoYWRlciwgY29uc3QgU3RyaW5n
JiBzb3VyY2UpCiB7CiAgICAgQVNTRVJUKHNoYWRlcik7Ci0gICAgCisKICAgICBtX2ludGVybmFs
LT5tX2dsV2lkZ2V0LT5tYWtlQ3VycmVudCgpOwogCi0gICAgQ1N0cmluZyBzb3VyY2VDUyA9IHNv
dXJjZS51dGY4KCk7CisgICAgU3RyaW5nIHByZWZpeGVkU291cmNlOworCisjaWYgZGVmaW5lZCAo
UVRfT1BFTkdMX0VTXzIpCisgICAgcHJlZml4ZWRTb3VyY2UuYXBwZW5kKCJwcmVjaXNpb24gbWVk
aXVtcCBmbG9hdDtcbiIpOworI2VuZGlmCisKKyAgICBwcmVmaXhlZFNvdXJjZS5hcHBlbmQoc291
cmNlKTsKKworICAgIENTdHJpbmcgc291cmNlQ1MgPSBwcmVmaXhlZFNvdXJjZS51dGY4KCk7CiAg
ICAgY29uc3QgY2hhciogZGF0YSA9IHNvdXJjZUNTLmRhdGEoKTsKLSAgICBpbnQgbGVuZ3RoID0g
c291cmNlLmxlbmd0aCgpOworICAgIGludCBsZW5ndGggPSBwcmVmaXhlZFNvdXJjZS5sZW5ndGgo
KTsKICAgICBtX2ludGVybmFsLT5zaGFkZXJTb3VyY2UoKEdMdWludCkgc2hhZGVyLT5vYmplY3Qo
KSwgLyogY291bnQgKi8gMSwgJmRhdGEsICZsZW5ndGgpOwogfQogCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>