New issue
Advanced search Search tips

Issue 668802 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Feature



Sign in to add a comment

WebGL scissor does not limit repaint area

Reported by iofg2...@gmail.com, Nov 26 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2933.0 Safari/537.36

Steps to reproduce the problem:
1. Open https://codepen.io/seanchas116/pen/bBreMG
2. Enable Paint Flashing in DevTools

What is the expected behavior?
Browser only repaints scissor rectangle of WebGL canvas

What went wrong?
Browser repaints whole WebGL canvas rectangle

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 57.0.2933.0  Channel: canary
OS Version: OS X 10.12.1
Flash Version: Shockwave Flash 24.0 r0

Along with this, I think double buffer copying also could be optimized using scissor box when preserveDrawingBuffer == true.
These optimizations would be great when canvas size is very large (e.g., 4K fullscreen) and you only need to update canvas partially.
(I'm suffering performance problem in painting app built with WebGL where viewport canvas size may be very large and only partial area where user painted with brush needs to be updated)
 

Comment 1 by kbr@chromium.org, Nov 28 2016

Cc: erikc...@chromium.org ccameron@chromium.org
Labels: -Type-Bug -Pri-2 Pri-3 Type-Feature
Status: Available (was: Unconfirmed)
The potential optimization described here is very difficult to implement correctly and is at odds with other work that has been done to optimize WebGL's display path. On macOS, WebGL-rendered canvases are drawn to the screen via Core Animation, which doesn't have any provisions for updating a sub-rectangle of an IOSurface-backed layer.

To implement this optimization it would be necessary to accumulate the scissor rectangles for all calls which affect the WebGL-rendered canvas in a given frame (draws, clears) and push the union of them through the compositing pipeline -- again, at odds with the direct display of WebGL-rendered canvases using the OS compositor, which has been shown to reduce copies and save power.

The basic assumption when using WebGL is that the underlying machine has the GPU horsepower to display at least a full-screen canvas with one or two passes of overdraw at the display's refresh rate. If this is true, then it should be possible to implement some optimization in the application -- like tiling of the backing store of the painting application into multiple smaller textures -- so that drawing operations can affect a reasonably small texture region, and re-display of the entire window can be fast, by blitting those tiles to the back buffer appropriately. The WebGL-rendered canvas should never be larger than the display -- the application should implement scrolling within a larger viewport itself.

Downgrading this to P3 and marking as a feature request. I don't anticipate we will implement this request in the near future.

Project Member

Comment 2 by sheriffbot@chromium.org, Nov 29 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 3 by kbr@chromium.org, Nov 29 2017

Labels: -Hotlist-Recharge-Cold
Status: Available (was: Untriaged)
Project Member

Comment 4 by sheriffbot@chromium.org, Nov 30

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)
Leaving open, but this still seems like a P3 feature at best.

Sign in to add a comment