<?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>54023</bug_id>
          
          <creation_ts>2011-02-08 11:16:58 -0800</creation_ts>
          <short_desc>[chromium] Three texture-related webgl tests failing in DEBUG due to skia change</short_desc>
          <delta_ts>2011-02-17 09:08:02 -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>WebGL</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</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="Zhenyao Mo">zmo</reporter>
          <assigned_to name="Mike Reed">reed</assigned_to>
          <cc>abarth</cc>
    
    <cc>commit-queue</cc>
    
    <cc>enne</cc>
    
    <cc>eric</cc>
    
    <cc>hbono</cc>
    
    <cc>kbr</cc>
    
    <cc>reed</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>347552</commentid>
    <comment_count>0</comment_count>
    <who name="Zhenyao Mo">zmo</who>
    <bug_when>2011-02-08 11:16:58 -0800</bug_when>
    <thetext>Put them to test expectations for now (http://trac.webkit.org/changeset/77959)

Need to investigate.

fast/canvas/webgl/gl-teximage.html
fast/canvas/webgl/tex-image-with-format-and-type.html
fast/canvas/webgl/texture-transparent-pixels-initialized.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>347553</commentid>
    <comment_count>1</comment_count>
    <who name="Zhenyao Mo">zmo</who>
    <bug_when>2011-02-08 11:18:47 -0800</bug_when>
    <thetext>This happened after http://crrev.com/74103 by hbono@chromium.org</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>347564</commentid>
    <comment_count>2</comment_count>
    <who name="Zhenyao Mo">zmo</who>
    <bug_when>2011-02-08 11:34:46 -0800</bug_when>
    <thetext>Sorry blamed the wrong guy and wrong CL.  It is skia in r74130. Cc&apos;ed reed@chromium.org</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>347695</commentid>
    <comment_count>3</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2011-02-08 14:40:29 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Sorry blamed the wrong guy and wrong CL.  It is skia in r74130. Cc&apos;ed reed@chromium.org

That sounds like the wrong revision.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>347698</commentid>
    <comment_count>4</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2011-02-08 14:41:35 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Sorry blamed the wrong guy and wrong CL.  It is skia in r74130. Cc&apos;ed reed@chromium.org
&gt; 
&gt; That sounds like the wrong revision.

To be clear, that&apos;s Chromium revision 74130.
http://src.chromium.org/viewvc/chrome?view=rev&amp;revision=74130</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350873</commentid>
    <comment_count>5</comment_count>
    <who name="Zhenyao Mo">zmo</who>
    <bug_when>2011-02-14 14:09:42 -0800</bug_when>
    <thetext>[31664:31664:2059838021045:FATAL:SkColorPriv.h(216)] third_party/skia/include/core/SkColorPriv.h:216: failed assertion &quot;r &lt;= a&quot;

Backtrace:
	base::debug::StackTrace::StackTrace() [0x127580e]
	logging::LogMessage::~LogMessage() [0x128a4e2]
	SkDebugf_FileLine() [0x15724ff]
	SkPackARGB32() [0x269036d]
	WebCore::ImageFrame::setRGBA() [0x2692d5e]
	WebCore::ImageFrame::setRGBA() [0x2692bee]
	WebCore::PNGImageDecoder::rowAvailable() [0x269d71d]
	WebCore::rowAvailable() [0x269c9fa]
	0x7f90db042383
	0x7f90db04287c
	0x7f90db042af3
	0x7f90db043c6b
	WebCore::PNGImageReader::decode() [0x269dbab]
	WebCore::PNGImageDecoder::decode() [0x269d88c]
	WebCore::PNGImageDecoder::frameBufferAtIndex() [0x269ccfd]
	WebCore::ImageSource::frameIsCompleteAtIndex() [0x2683591]
	WebCore::GraphicsContext3D::getImageData() [0x26e6bcd]
	WebCore::GraphicsContext3D::extractImageData() [0x26449da]
	WebCore::WebGLRenderingContext::texImage2DImpl() [0x2395969]
	WebCore::WebGLRenderingContext::texImage2D() [0x2395f6f]
	WebCore::WebGLRenderingContextInternal::texImage2D3Callback() [0x24c2d1c]
	WebCore::WebGLRenderingContextInternal::texImage2DCallback() [0x24c38df]
	v8::internal::HandleApiCallHelper&lt;&gt;() [0x18b47c3]
	v8::internal::Builtin_Impl_HandleApiCall() [0x18b2280]
	v8::internal::Builtin_HandleApiCall() [0x18b2259]
	0x7f90af5ce24a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350887</commentid>
    <comment_count>6</comment_count>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-14 14:27:34 -0800</bug_when>
    <thetext>In debug mode (SK_DEBUG defined for Skia), SkPackARGB32() will assert that the specified color is, in fact, legal premultiplied. i.e.

a &gt;= r
a &gt;= g
a &gt;= b

I presume that this is the assert that is firing in the stack-trace.

The call site is (I think) this:


        inline void setRGBA(PixelData* dest, unsigned r, unsigned g, unsigned b, unsigned a)
        {
            if (m_premultiplyAlpha &amp;&amp; !a)
                *dest = 0;
            else {
                if (m_premultiplyAlpha &amp;&amp; a &lt; 255) {
                    float alphaPercent = a / 255.0f;
                    r = static_cast&lt;unsigned&gt;(r * alphaPercent);
                    g = static_cast&lt;unsigned&gt;(g * alphaPercent);
                    b = static_cast&lt;unsigned&gt;(b * alphaPercent);
                }
#if PLATFORM(SKIA)
                *dest = SkPackARGB32(a, r, g, b);
#else
                *dest = (a &lt;&lt; 24 | r &lt;&lt; 16 | g &lt;&lt; 8 | b);
#endif
            }
        }

The caller will apply the alpha before calling, but only if m_premultiplyAlpha is true. I don&apos;t know when this is not true (maybe it is always true), but if that is ever false, then we will skip the multiplies, which could make the assert fire.

Another cause could be that one of a,r,g,b is just out of range (doubtful), since SkPackARGB32() also asserts that each one is &lt;= 0xFF</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>350892</commentid>
    <comment_count>7</comment_count>
    <who name="Zhenyao Mo">zmo</who>
    <bug_when>2011-02-14 14:37:25 -0800</bug_when>
    <thetext>Yes in WebGL sometimes we have m_premultiplyAlpha == false.  It is a spec requirement.

So how should we fix this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>351259</commentid>
    <comment_count>8</comment_count>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-15 07:54:02 -0800</bug_when>
    <thetext>I am testing a roll to Skia 796, which has a version of that macro that skips the premultiply check. When that lands, I will create a webkit patch to use it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>351327</commentid>
    <comment_count>9</comment_count>
    <who name="Zhenyao Mo">zmo</who>
    <bug_when>2011-02-15 09:05:48 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; I am testing a roll to Skia 796, which has a version of that macro that skips the premultiply check. When that lands, I will create a webkit patch to use it.

Great!  Thank you!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352015</commentid>
    <comment_count>10</comment_count>
      <attachid>82622</attachid>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-16 06:11:31 -0800</bug_when>
    <thetext>Created attachment 82622
call non-asserting version of SkPackARGB32</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352016</commentid>
    <comment_count>11</comment_count>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-16 06:12:01 -0800</bug_when>
    <thetext>(more notes on patch)

The standard way to create a 32bit pixel in skia is to call SkPackARGB32(a,r,g,b). This puts the components in the correct (compile-time) order, and also (in the Debug build) asserts that the components are legal for premultiplied. i.e. r &lt;= a, g &lt;= a, b &lt;= a. This test makes sense for Skia in general, as it only supports premultiplied bitmaps today. However, WebGL is using the same decoder and bitmap to store images that will be passed directly to opengl, and opengl supports premultiplied and non-premultiplied.

This change calls a new version of the pack macro: SkPackARGB32NoCheck(a,r,g,b) which skips the asserts on the component values (since any values can be valid for opengl).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352018</commentid>
    <comment_count>12</comment_count>
    <who name="Mike Reed">reed</who>
    <bug_when>2011-02-16 06:12:33 -0800</bug_when>
    <thetext>*** Bug 54550 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352131</commentid>
    <comment_count>13</comment_count>
    <who name="Zhenyao Mo">zmo</who>
    <bug_when>2011-02-16 09:22:11 -0800</bug_when>
    <thetext>Looks good.  Thanks for the quick fix.

When this lands, I will remove the three tests out of test_expectations.txt.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352257</commentid>
    <comment_count>14</comment_count>
      <attachid>82622</attachid>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2011-02-16 12:29:55 -0800</bug_when>
    <thetext>Comment on attachment 82622
call non-asserting version of SkPackARGB32

Looks fine. I patched my workspace locally to still call SkPackARGB32 if m_premultiplyAlpha is true, but it&apos;s another if-test in an inner loop that isn&apos;t really necessary. r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352259</commentid>
    <comment_count>15</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2011-02-16 12:35:03 -0800</bug_when>
    <thetext>BTW, is the chromium_rev in Source/WebKit/chromium/DEPS at or later than the revision where you incorporated the Skia roll? If not, that is going to need to be updated. I have an unfortunate feeling that the commit queue won&apos;t catch this error, so please file another bug ASAP updating DEPS if not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352473</commentid>
    <comment_count>16</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-16 17:07:53 -0800</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 82622:

animations/suspend-resume-animation-events.html bug 51002 (author: cmarrin@apple.com)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352474</commentid>
    <comment_count>17</comment_count>
      <attachid>82622</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-16 17:09:11 -0800</bug_when>
    <thetext>Comment on attachment 82622
call non-asserting version of SkPackARGB32

Clearing flags on attachment: 82622

Committed r78753: &lt;http://trac.webkit.org/changeset/78753&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352475</commentid>
    <comment_count>18</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-02-16 17:09:17 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352523</commentid>
    <comment_count>19</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-02-16 18:50:17 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/78753 might have broken GTK Linux 64-bit Debug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>352952</commentid>
    <comment_count>20</comment_count>
    <who name="Zhenyao Mo">zmo</who>
    <bug_when>2011-02-17 09:08:02 -0800</bug_when>
    <thetext>Updated the test expectations for these three tests.

Committed r78836: &lt;http://trac.webkit.org/changeset/78836&gt;

Note that fast/canvas/webgl/tex-image-with-format-and-type.html still fail from time to time in Linux Debug, but I think that&apos;s another issue.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>82622</attachid>
            <date>2011-02-16 06:11:31 -0800</date>
            <delta_ts>2011-02-16 17:09:11 -0800</delta_ts>
            <desc>call non-asserting version of SkPackARGB32</desc>
            <filename>packargb.diff</filename>
            <type>text/plain</type>
            <size>2028</size>
            <attacher name="Mike Reed">reed</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA3ODcwMSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTkgQEAKKzIwMTEtMDItMTYgIE1pa2UgUmVlZCAgPHJlZWRAZ29vZ2xlLmNvbT4K
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBVc2Ugbm9u
LWFzc2VydGluZyBwYWNrIGZ1bmN0aW9uIGZvciBkZWNvZGluZyBpbWFnZXMsIHNpbmNlIHdlYmds
IG1heSB3YW50CisgICAgICAgIGEgbm9uLXByZW11bHRpcGxpZWQgdmVyc2lvbiBvZiB0aGUgaW1h
Z2UuCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD01NDAy
MworCisgICAgICAgIE5vIG5ldyB0ZXN0cy4KKyAgICAgICAgZmFzdC9jYW52YXMvd2ViZ2wvZ2wt
dGV4aW1hZ2UuaHRtbAorICAgICAgICBmYXN0L2NhbnZhcy93ZWJnbC90ZXgtaW1hZ2Utd2l0aC1m
b3JtYXQtYW5kLXR5cGUuaHRtbAorICAgICAgICBmYXN0L2NhbnZhcy93ZWJnbC90ZXh0dXJlLXRy
YW5zcGFyZW50LXBpeGVscy1pbml0aWFsaXplZC5odG1sCisKKyAgICAgICAgKiBwbGF0Zm9ybS9p
bWFnZS1kZWNvZGVycy9JbWFnZURlY29kZXIuaDoKKyAgICAgICAgKFdlYkNvcmU6OkltYWdlRnJh
bWU6O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YWNlIFdlYkNvcmUgewogICAgICAgICAgICAgICAgICAgICBiID0gc3RhdGljX2Nhc3Q8dW5zaWdu
ZWQ+KGIgKiBhbHBoYVBlcmNlbnQpOwogICAgICAgICAgICAgICAgIH0KICNpZiBQTEFURk9STShT
S0lBKQotICAgICAgICAgICAgICAgICpkZXN0ID0gU2tQYWNrQVJHQjMyKGEsIHIsIGcsIGIpOwor
ICAgICAgICAgICAgICAgIC8vIHdlIGFyZSBzdXJlIHRvIGNhbGwgdGhlIE5vQ2hlY2sgdmVyc2lv
biwgc2luY2Ugd2UgbWF5CisgICAgICAgICAgICAgICAgLy8gZGVsaWJlcmF0ZWx5IHBhc3Mgbm9u
LXByZW11bHRpcGxpZWQgdmFsdWVzLCBhbmQgd2UgZG9uJ3Qgd2FudAorICAgICAgICAgICAgICAg
IC8vIGFuIGFzc2VydC4KKyAgICAgICAgICAgICAgICAqZGVzdCA9IFNrUGFja0FSR0IzMk5vQ2hl
Y2soYSwgciwgZywgYik7CiAjZWxzZQogICAgICAgICAgICAgICAgICpkZXN0ID0gKGEgPDwgMjQg
fCByIDw8IDE2IHwgZyA8PCA4IHwgYik7CiAjZW5kaWYK
</data>

          </attachment>
      

    </bug>

</bugzilla>