<?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>163439</bug_id>
          
          <creation_ts>2016-10-14 01:58:47 -0700</creation_ts>
          <short_desc>[Cairo] REGRESSION(r206481): GraphicsContext3D::ImageExtractor fails to extract images</short_desc>
          <delta_ts>2026-01-12 09:05:09 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Zan Dobersek">zan</reporter>
          <assigned_to name="Zan Dobersek">zan</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>kondapallykalyan</cc>
    
    <cc>sabouhallawa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1240173</commentid>
    <comment_count>0</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-10-14 01:58:47 -0700</bug_when>
    <thetext>[Cairo] GraphicsContext3D::ImageExtractor fails to extract images</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240178</commentid>
    <comment_count>1</comment_count>
      <attachid>291597</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-10-14 02:04:31 -0700</bug_when>
    <thetext>Created attachment 291597
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240180</commentid>
    <comment_count>2</comment_count>
      <attachid>291597</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2016-10-14 02:06:56 -0700</bug_when>
    <thetext>Comment on attachment 291597
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=291597&amp;action=review

&gt; Source/WebCore/ChangeLog:14
&gt; +        In the Cairo implementation of GraphicsContext3D::ImageExtractor,
&gt; +        don&apos;t check for frame completeness at index 0. This information
&gt; +        is now cached only after the frame for that index is decoded and
&gt; +        marked as completed, which is done after this check.
&gt; +
&gt; +        Becuase of this the current check forces extractImage() to return
&gt; +        early and abort WebGL texture uploads from image sources.

If this a recent regression after the image decoder refactorings? it would be great to mention a revision in the commit message, so that I&apos;ll know in the future that I don&apos;t need this in any stable branch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240185</commentid>
    <comment_count>3</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-10-14 02:13:39 -0700</bug_when>
    <thetext>It was probably introduced in r206481.
https://trac.webkit.org/changeset/206481</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240187</commentid>
    <comment_count>4</comment_count>
      <attachid>291600</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-10-14 02:16:55 -0700</bug_when>
    <thetext>Created attachment 291600
Patch for landing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240189</commentid>
    <comment_count>5</comment_count>
      <attachid>291600</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-10-14 02:20:34 -0700</bug_when>
    <thetext>Comment on attachment 291600
Patch for landing

Clearing flags on attachment: 291600

Committed r207332: &lt;http://trac.webkit.org/changeset/207332&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240190</commentid>
    <comment_count>6</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-10-14 02:20:42 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240315</commentid>
    <comment_count>7</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-10-14 09:58:02 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; It was probably introduced in r206481.
&gt; https://trac.webkit.org/changeset/206481

Yes this is true. In this change I made frameIsCompleteAtIndex() reads whatever in the cache without having to ask the decoder about the completeness of the frame and without trying to cache a new frame.

The reason for this change is this information is mainly useful to the ImageFrameCache. It can be sued to decide whether we can use the current frame or we need to try recaching a new one. For other places of the code like GraphicsContext3D::ImageExtractor, it should not matter whether the frame is complete or not. The completeness of a frame represents whether the frame image can fully or partially displayed. And we need to display it even if it is partially decoded.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240318</commentid>
    <comment_count>8</comment_count>
      <attachid>291597</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-10-14 10:00:11 -0700</bug_when>
    <thetext>Comment on attachment 291597
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=291597&amp;action=review

&gt; Source/WebCore/ChangeLog:11
&gt; +        marked as completed, which is done after this check.

What are the repro steps of this bug? Can&apos;t we include a test case in this patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240319</commentid>
    <comment_count>9</comment_count>
      <attachid>291597</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-10-14 10:11:32 -0700</bug_when>
    <thetext>Comment on attachment 291597
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=291597&amp;action=review

&gt; Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp:226
&gt; -        if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndex(0))
&gt; +        if (!decoder.frameCount())

The function GraphicsContext3D::ImageExtractor::extractImage() in WebCore/platform/graphics/cg/GraphicsContext3D.cpp does not have the check decoder.frameIsCompleteAtIndex(). 

But the function GraphicsContext3D::ImageExtractor::extractImage() in WebCore/platform/graphics/efl/GraphicsContext3D.cpp does have the check decoder.frameIsCompleteAtIndex(). 

        if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndex(0))
            return false;

I think we need to apply the same fix there as well. Maybe we need to move some of the code of this function to the cross platform file: WebCore/platform/graphics/GraphicsContext3D.cpp to avoid repeating the code and avoid fixing the same bug in different places.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1240321</commentid>
    <comment_count>10</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2016-10-14 10:15:41 -0700</bug_when>
    <thetext>Reopening the bug to apply the same fix to the elf port and to add a test if possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241358</commentid>
    <comment_count>11</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-10-18 00:05:07 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Comment on attachment 291597 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=291597&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:11
&gt; &gt; +        marked as completed, which is done after this check.
&gt; 
&gt; What are the repro steps of this bug? Can&apos;t we include a test case in this
&gt; patch?

This is reproducible by running any WebGL example that does texture uploads from an image source (specifically image, canvas or video elements). There&apos;s plenty of tests for that, but the EFL and GTK+ ports probably didn&apos;t catch them because they either don&apos;t run those tests, or don&apos;t compare pixel results from these tests.

This problem should have stored a relevant error on the GraphicsContext3D object, but I suppose again the ports don&apos;t run a test which would propagate this problem into a test failure.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>291597</attachid>
            <date>2016-10-14 02:04:31 -0700</date>
            <delta_ts>2016-10-14 02:16:49 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-163439-20161014020103.patch</filename>
            <type>text/plain</type>
            <size>2035</size>
            <att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XBoaWNzL2Nh
aXJvL0dyYXBoaWNzQ29udGV4dDNEQ2Fpcm8uY3BwCisrKyBiL1NvdXJjZS9XZWJDb3JlL3BsYXRm
b3JtL2dyYXBoaWNzL2NhaXJvL0dyYXBoaWNzQ29udGV4dDNEQ2Fpcm8uY3BwCkBAIC0yMjMsNyAr
MjIzLDcgQEAgYm9vbCBHcmFwaGljc0NvbnRleHQzRDo6SW1hZ2VFeHRyYWN0b3I6OmV4dHJhY3RJ
bWFnZShib29sIHByZW11bHRpcGx5QWxwaGEsIGJvb2wKIAogICAgIGlmIChtX2ltYWdlLT5kYXRh
KCkpIHsKICAgICAgICAgZGVjb2Rlci5zZXREYXRhKG1faW1hZ2UtPmRhdGEoKSwgdHJ1ZSk7Ci0g
ICAgICAgIGlmICghZGVjb2Rlci5mcmFtZUNvdW50KCkgfHwgIWRlY29kZXIuZnJhbWVJc0NvbXBs
ZXRlQXRJbmRleCgwKSkKKyAgICAgICAgaWYgKCFkZWNvZGVyLmZyYW1lQ291bnQoKSkKICAgICAg
ICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgbV9pbWFnZVN1cmZhY2UgPSBkZWNvZGVyLmNy
ZWF0ZUZyYW1lSW1hZ2VBdEluZGV4KDApOwogICAgIH0gZWxzZSB7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>291600</attachid>
            <date>2016-10-14 02:16:55 -0700</date>
            <delta_ts>2016-10-14 02:16:55 -0700</delta_ts>
            <desc>Patch for landing</desc>
            <filename>bug-163439-20161014021327.patch</filename>
            <type>text/plain</type>
            <size>2108</size>
            <attacher name="Zan Dobersek">zan</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjA3MzMxCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggOWJhN2Y2Y2Yy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