Changing browser tab clear drawing buffer.
See original GitHub issueQuick preview:
Steps to reproduce
-
Initial state:
-
Click on “Draw from canvas 1 to canvas 2”. This uses 2d context of canvas 2 to
drawImage
:
const ctx = canvas2.getContext("2d");
ctx.drawImage(canvas1, 0, 0);
Note: it works only if `preserveDrawingBuffer` is set to `true` on the canvas1 PIXI.Renderer.
-
Change tab.
-
Come back.
-
Click again on “Draw from canvas 1 to canvas 2”. The red square disappear.
Expected Behavior
The red square must not disappear.
Current Behavior
The red square disappears.
Chrome ONLY.
Does not work on:
Chrome 87. (Windows 10, Linux UBUNTU 20.04, MacOS 10.15.7) PIXI v5.X v6.X
Changing window on Windows and MacOS also leads to the issue.
Works on:
Firefox (Windows 10, Linux UBUNTU 20.04, MacOS 10.15.7.) PIXI v5.X v6.X
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
WebGL 2 When to clear the drawing buffer? - Stack Overflow
While testing I've observed that in WebGL 2 this answer remains true - you have to set preserveDrawingBuffer to true . Is this...
Read more >Clearing with colors - Web APIs - MDN Web Docs - Mozilla
First, we set the clear color to green, using the method clearColor() . This only changes some internal state of WebGL, but does...
Read more >WebGL2 Tips
The issue is that for performance and compatibility reasons, by default the browser will clear a WebGL canvas's drawing buffer after you've drawn...
Read more >How to: Reduce Graphics Flicker with Double Buffering for ...
When double buffering is enabled, all paint operations are first rendered to a memory buffer instead of the drawing surface on the screen....
Read more >Performance features reference - Chrome Developers
Click the Performance tab in DevTools. ... to clear that recording from the Performance panel. ... Your browser can't play this video.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks! https://bugs.chromium.org/p/chromium/issues/detail?id=1166789
Good bug!
Here’s a webgl example without PIXI: https://jsfiddle.net/bigtimebuddy/s418rk6y/
This seems like a browser bug (not PixiJS) and you might want to report to Chrome/Chromium.