question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Changing browser tab clear drawing buffer.

See original GitHub issue

jsfiddle example here.

Quick preview: pixiBug

Steps to reproduce

  • Initial state: Screenshot 2021-01-14 at 18 59 14

  • 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);
Screenshot 2021-01-14 at 19 01 43 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.

Screenshot 2021-01-14 at 19 04 08

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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bigtimebuddycommented, Jan 14, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found