Module element_pictures
Expand description
Pictures a renderer copies on the GPU from where the page shows them.
In a browser a video’s pictures are decoded by the page’s media element.
Reading each one back to draw it as RGBA costs the page’s one thread a
colour conversion and a copy of every pixel per picture: more than a
frame’s time for a 1080p video on a software GPU. Instead the widget
draws an image with no pixels of its own, a new one per picture, and
shows which element holds its pixels; before rendering a frame, the
page’s renderer takes them and copies each element’s picture into a
texture the image draws from. A new picture so changes only the pixels
under the video: nothing is measured or laid out again.
Off the web nothing is shown here: the media engine hands out no element pictures there.
Structs§
- Element
Picture - A picture to copy from
element(the page’s video element, awasm_bindgen::JsValue) into the pixelsimagedraws from.