Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebGLRenderingDebugger

WebGLRenderingDebugger

It attaches inspector to WebGLRenderingContext instance.
Each of inspectors may want to invoke there task in WebGLRenderingContext's method.
This class controlls method wrapping and restoring.

NOTE: This is a debugging tool therefore its behavior may affect to performance.

Hierarchy

  • WebGLRenderingDebugger

Index

Constructors

constructor

Properties

Private context

context: any

Although no typings, it expects WebGLRenderingContext instance.

Private inspectors

inspectors: object

Instances of Inspector.
index is one of InspectorIds.

Type declaration

Private invokations

invokations: object

A container for invoking tasks of inspectors.
Each array of tasks is related to wrapping method name.

Type declaration

  • [property: string]: object
    • [inspector: string]: Function[]

Private invokationsInspectorKeyCache

invokationsInspectorKeyCache: object

Key cache to avoid collecting keys in invoked method.
TODO: Assure atomicity with invokations.

Type declaration

  • [property: string]: string[]

Private preservations

preservations: object

Original WebGLRenderingContext instance method container.

Type declaration

  • [property: string]: Function

Static Inspectors

Inspectors: object = InspectorIds

public API to provide InspectorIds to user.

Type declaration

  • DRAW_CALLS: string
  • POLYGON: string

Methods

attach

  • attach(inspectorId: string): void
  • Attaches inspector to WebGLRenderingContext instance.

    Parameters

    • inspectorId: string

    Returns void

Private attachInspector

  • attachInspector(targetProperty: string, inspectorId: string, task: Function[]): void
  • Attaches inspector tasks to perticular property on WebGLRenderingContext instance.

    Parameters

    • targetProperty: string
    • inspectorId: string
    • task: Function[]

    Returns void

detach

  • detach(inspectorId: string): void
  • Detaches inspector from WebGLRenderingContext instance.

    Parameters

    • inspectorId: string

    Returns void

Private detachInspector

  • detachInspector(targetProperty: string, inspectorId: string): void
  • Detaches inspector tasks from perticular property on WebGLRenderingContext instance.

    Parameters

    • targetProperty: string
    • inspectorId: string

    Returns void

getAttachedInstpector

  • getAttachedInstpector<T>(name: string): T

Private replaceContextMethod

  • replaceContextMethod(targetProperty: string): void
  • Replacing WebGLRenderingContext method to invoke inspector's tasks

    Parameters

    • targetProperty: string

    Returns void

Private restorePropertyIfNeeded

  • restorePropertyIfNeeded(targetProperty: string): void
  • Restore WebGLRenderingContext instance's property to its original one
    if invokations's target property does not have any property.

    Parameters

    • targetProperty: string

    Returns void

Static createInspector

  • createInspector(inspectorId: string): Inspector | null

Generated using TypeDoc