WebGLInspector Class
A utility and helper class designed to work with StageGL to help investigate and test performance or display problems. It contains logging functions to analyze behaviour and performance testing utilities.
Constructor
Methods
_initializeWebGL
()
protected
dispProps
-
prepend
-
item
Utility function for use with {{#crossLink "logDepth"))((/crossLink}}. Logs an item's position and registration. Useful to see if something is being forced off screen or has an integer position.
Parameters:
-
prepend
StringThe string to show before the item, usually formatting for a tree view.
-
item
DisplayObjectThe item we're currently logging about.
log
-
[stage=this._stage]
Perform all of the logging reports at once.
Parameters:
-
[stage=this._stage]
StageGL optionalThe stage to log information for.
logContextInfo
-
gl
Examine the context and provide information about its capabilities.
Parameters:
-
gl
WebGLRenderingContextThe WebGL context to inspect.
logDepth
-
[children=this._stage.children]
-
prepend
-
customLog
Recursively walk the entire display tree, log the attached items, and display it in a tree view.
Parameters:
-
[children=this._stage.children]
Array optionalThe children array to walk through.
-
prepend
StringWhat to prepend to this output from this point onwards.
-
customLog
FunctionWhich logging function to use, mainly for filtering or formatting output. Fallback hierarchy is customLog -> alternateOutput -> console.log.
logTextureFill
-
[stage=this._stage]
Simulate renders and watch what happens for textures moving around between draw calls. A texture moving between slots means it was removed and then re-added to draw calls. Performance may be better if it was allowed to stay in place.
Parameters:
-
[stage=this._stage]
StageGL optionalThe stage to log information for.
toggleGPUDraw
-
[stage=this._stage]
-
enabled
Replace the stage's Draw command with an empty draw command. This is useful for testing performance, and ignoring rendering.
Properties
alternateOutput
Console
protected
static
Alternate output for debugging situations where "console" is not available, i.e. Mobile or remote debugging. Expects object with a "log" function that takes any number of params.
Default: null