| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>WebGL Scissor with context of preserveDrawingBuffer=true</title> | 4 <title>WebGL Scissor with context of preserveDrawingBuffer=true</title> |
| 5 <style type="text/css"> | 5 <style type="text/css"> |
| 6 .nomargin { | 6 .nomargin { |
| 7 margin: 0px auto; | 7 margin: 0px auto; |
| 8 } | 8 } |
| 9 </style> | 9 </style> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } catch (e) {} | 31 } catch (e) {} |
| 32 return gl; | 32 return gl; |
| 33 } | 33 } |
| 34 | 34 |
| 35 function scissorAndClear() { | 35 function scissorAndClear() { |
| 36 gl.scissor(0, 0, 10, 10); | 36 gl.scissor(0, 0, 10, 10); |
| 37 gl.enable(gl.SCISSOR_TEST); | 37 gl.enable(gl.SCISSOR_TEST); |
| 38 gl.clearColor(0, 1, 0, 1); | 38 gl.clearColor(0, 1, 0, 1); |
| 39 gl.clear(gl.COLOR_BUFFER_BIT); | 39 gl.clear(gl.COLOR_BUFFER_BIT); |
| 40 | 40 |
| 41 domAutomationController.setAutomationId(1); | 41 deferredAck(); |
| 42 domAutomationController.send("SUCCESS"); | |
| 43 } | 42 } |
| 43 |
| 44 var swapsBeforeAck = 15; |
| 45 function deferredAck() |
| 46 { |
| 47 if (swapsBeforeAck == 0) { |
| 48 domAutomationController.setAutomationId(1); |
| 49 domAutomationController.send("SUCCESS"); |
| 50 } else { |
| 51 --swapsBeforeAck; |
| 52 window.requestAnimationFrame(deferredAck); |
| 53 } |
| 54 } |
| 55 |
| 44 </script> | 56 </script> |
| 45 </head> | 57 </head> |
| 46 <body onload="run()"> | 58 <body onload="run()"> |
| 47 <div style="position:absolute; top:0px; left:0px"> | 59 <div style="position:absolute; top:0px; left:0px"> |
| 48 <canvas id="c" width="200" height="200" class="nomargin"></canvas> | 60 <canvas id="c" width="200" height="200" class="nomargin"></canvas> |
| 49 </div> | 61 </div> |
| 50 </body> | 62 </body> |
| 51 </html> | 63 </html> |
| OLD | NEW |