A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/XRCompositionLayer/needsRedraw below:

XRCompositionLayer: needsRedraw property - Web APIs

XRCompositionLayer: needsRedraw property

Limited availability

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The read-only needsRedraw property of the XRCompositionLayer interface is a boolean signaling that the layer should be re-rendered in the next frame.

The need for redrawing can occur when the underlying resources of a layer are lost due to textures that might have been freed by the compositor under the hood. This might happen when the device falls asleep or when the browser switches context (to an operating system dialog or similar) and then comes back.

Redrawing is not a problem for layers which are updated with every frame. However, for layers updated infrequently, or for static layers (where you can only draw once after creation or after a redraw event), the layer's content might be lost and need to be redrawn. If the layer's resources are lost, the needsRedraw property will be true and a redraw event is fired on the layer.

Value

A boolean. true indicates a rerendering is needed in the next frame, false indicates no re-rendering is needed.

Examples Redrawing layers

Use the needsRedraw property to check if a layer needs to be redrawn and then redraw it.

function onXRFrame(time, frame) {
  // …

  if (quadLayer.needsRedraw) {
    // redraw the layer
  }
}
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4