Skip to content

RendererSummary

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/scenery/blob/main/js/util/RendererSummary.ts for the most up-to-date information.

Overview

Contains information about what renderers (and a few other flags) are supported for an entire subtree.

We effectively do this by tracking bitmask changes from scenery.js (used for rendering properties in general). In particular, we count how many zeros in the bitmask we have in key places.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class RendererSummary

import { RendererSummary } from 'scenerystack/scenery';

Constructor

new RendererSummary( node : Node )

Instance Methods

summaryChange( oldBitmask : number, newBitmask : number )

Use a bitmask of all 1s to represent 'does not exist' since we count zeros

selfChange()

isSubtreeFullyCompatible( renderer : number ) : boolean

Is the renderer compatible with every single painted node under this subtree? (Can this entire sub-tree be rendered with just this renderer)

@param renderer - Single bit preferred. If multiple bits set, requires ALL painted nodes are compatible with ALL of the bits.

isSubtreeContainingCompatible( renderer : number ) : boolean

Is the renderer compatible with at least one painted node under this subtree?

@param renderer - Single bit preferred. If multiple bits set, will return if a single painted node is compatible with at least one of the bits.

isSingleCanvasSupported() : boolean

isSingleSVGSupported() : boolean

isNotPainted() : boolean

hasNoPDOM() : boolean

areBoundsValid() : boolean

isSubtreeRenderedExclusivelySVG( preferredRenderers : number ) : boolean

Given a bitmask representing a list of ordered preferred renderers, we check to see if all of our nodes can be displayed in a single SVG block, AND that given the preferred renderers, that it will actually happen in our rendering process.

isSubtreeRenderedExclusivelyCanvas( preferredRenderers : number ) : boolean

Given a bitmask representing a list of ordered preferred renderers, we check to see if all of our nodes can be displayed in a single Canvas block, AND that given the preferred renderers, that it will actually happen in our rendering process.

audit()

For debugging purposes

toString() : string

Returns a string form of this object

Static Methods

summaryBitmaskForNodeSelf( node : Node ) : number

Determines which of the summary bits can be set for a specific Node (ignoring children/ancestors). For instance, for bitmaskSingleSVG, we only don't include the flag if THIS node prevents its usage (even though child nodes may prevent it in the renderer summary itself).

bitToString( bit : number ) : string

For debugging purposes

bitmaskToString( bitmask : number ) : string

For debugging purposes

Static Properties

bitmaskAll

Source Code

See the source for RendererSummary.ts in the scenery repository.