<?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>159608</bug_id>
          
          <creation_ts>2016-07-10 03:52:43 -0700</creation_ts>
          <short_desc>preserveDrawingBuffer=true wrongly double-buffers on current iOS h/w</short_desc>
          <delta_ts>2020-05-08 16:03:37 -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>WebGL</component>
          <version>Other</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 9.2</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>183151</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Reuben Scratton">reuben.scratton</reporter>
          <assigned_to name="Dean Jackson">dino</assigned_to>
          <cc>dino</cc>
    
    <cc>gman</cc>
    
    <cc>kbr</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1209531</commentid>
    <comment_count>0</comment_count>
    <who name="Reuben Scratton">reuben.scratton</who>
    <bug_when>2016-07-10 03:52:43 -0700</bug_when>
    <thetext>[F.A.O. Dean Jackson]

Using preserveDrawingBuffer=true on iOS wrongly expects that rendering is done to two alternating backbuffers, i.e. normal double-buffering. As far as I can tell other WebGL implementations treat preserveDrawingBuffer=true as rendering to a single backbuffer which is then copied to the front buffer rather than swapped. 

Here is a simple demo of preserveDrawingBuffer=true written by Gregg Tavares:

http://greggman.com/downloads/examples/webgl/lessons/resources/webgl-preservedrawingbuffer-true.html

This demo looks fine on all desktop browsers and Android but flickers dreadfully on mobile Safari on iOS 9.x and 8.x because of the unexpected double-buffering.

I reported the issue to Gregg and he advised me to report it here, marked for the attention of Dean.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1210334</commentid>
    <comment_count>1</comment_count>
      <attachid>283491</attachid>
    <who name="Gregg Tavares">gman</who>
    <bug_when>2016-07-12 23:12:52 -0700</bug_when>
    <thetext>Created attachment 283491
webgl preservedrawingbuffer issue ios safari demonstration

Can also go here

https://jsfiddle.net/greggman/boffbn3k/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1210336</commentid>
    <comment_count>2</comment_count>
    <who name="Gregg Tavares">gman</who>
    <bug_when>2016-07-12 23:18:12 -0700</bug_when>
    <thetext>I don&apos;t remember if I&apos;m supposed to report this stuff but I also filed it as an apple bug 27317599

Also the conformance test fails on iOS

https://www.khronos.org/registry/webgl/sdk/tests/conformance/context/context-attribute-preserve-drawing-buffer.html?webglVersion=1&amp;quiet=0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1220601</commentid>
    <comment_count>3</comment_count>
    <who name="Reuben Scratton">reuben.scratton</who>
    <bug_when>2016-08-16 15:21:57 -0700</bug_when>
    <thetext>*crickets*</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1221422</commentid>
    <comment_count>4</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2016-08-19 12:13:54 -0700</bug_when>
    <thetext>&lt;rdar://problem/27317599&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650767</commentid>
    <comment_count>5</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-05-08 14:31:17 -0700</bug_when>
    <thetext>This bug might be fixed with the fix for Bug 183151, or it might have been fixed since it was filed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650814</commentid>
    <comment_count>6</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2020-05-08 16:01:44 -0700</bug_when>
    <thetext>This doesn&apos;t reproduce on current tip-of-tree iOS, but I think that&apos;s because we&apos;re now using the same compositing/back-buffer approach as macOS (now that both are using ANGLE).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1650816</commentid>
    <comment_count>7</comment_count>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2020-05-08 16:03:30 -0700</bug_when>
    <thetext>Great. Thanks Dean for confirming. It looked to me like the antialias:true path for preserveDrawingBuffer:true was working correctly, and that&apos;s what this test case uses. Closing as WontFix - no longer reproducible.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>283491</attachid>
            <date>2016-07-12 23:12:52 -0700</date>
            <delta_ts>2016-07-12 23:12:52 -0700</delta_ts>
            <desc>webgl preservedrawingbuffer issue ios safari demonstration</desc>
            <filename>safari-webgl-preservedrawingbuffer-issue.html</filename>
            <type>text/html</type>
            <size>956</size>
            <attacher name="Gregg Tavares">gman</attacher>
            
              <data encoding="base64">PHN0eWxlPgpib2R5IHsgbWFyZ2luOiAwOyB9CmNhbnZhcyB7IHdpZHRoOiAxMDB2dzsgaGVpZ2h0
OiAxMDB2aDsgfQo8L3N0eWxlPgo8Ym9keT4KPGNhbnZhcz48L2NhbnZhcz4KPC9ib2R5Pgo8c2Ny
aXB0Pgp2YXIgY2FudmFzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiY2FudmFzIik7CnZhciBn
bCA9IGNhbnZhcy5nZXRDb250ZXh0KCJ3ZWJnbCIsIHsgcHJlc2VydmVEcmF3aW5nQnVmZmVyOiB0
cnVlIH0pOwoKZnVuY3Rpb24gcihtYXgpIHsKICByZXR1cm4gTWF0aC5yYW5kb20oKSAqIG1heCB8
IDA7Cn0KCmZ1bmN0aW9uIHJmKCkgewogIHJldHVybiBNYXRoLnJhbmRvbSgpICogMC41ICsgMC41
Owp9CgpmdW5jdGlvbiByZXNpemUoZ2wpIHsKICB2YXI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