B2G/gecko/browser/devtools/tilt/TiltVisualizer.jsm
/**
   * Draws the visualization mesh and highlight quad.
   */
Draws the visualization mesh and highlight quad.
Draws the visualization mesh and highlight quad .
function TVP__drawVisualization()
  {
    let renderer = this._renderer;
    let transforms = this.transforms;
    let w = renderer.width;
    let h = renderer.height;
    let ih = renderer.initialHeight;
    if (!this._meshStacks || !this._meshWireframe) {
      return;
    }
    renderer.clear();
    renderer.perspective();
    let ortho = mat4.ortho(0, w, h, 0, -1000, 1000);
    if (!this._isExecutingDestruction) {
      let f = this._time / INTRO_TRANSITION_DURATION;
      renderer.lerp(renderer.projMatrix, ortho, f, 8);
    } else {
      let f = this._time / OUTRO_TRANSITION_DURATION;
      renderer.lerp(renderer.projMatrix, ortho, 1 - f, 8);
    }
    renderer.translate(w * 0.5, ih * 0.5, -INITIAL_Z_TRANSLATION);
    renderer.translate(transforms.translation[0], 0,
                       transforms.translation[2]);
    renderer.transform(quat4.toMat4(transforms.rotation));
    renderer.translate(transforms.offset[0],
                       transforms.offset[1] + transforms.translation[1], 0);
    renderer.scale(transforms.zoom, transforms.zoom);
    renderer.strokeWeight(2);
    renderer.depthTest(true);
    this._drawMeshStacks();
    this._drawMeshWireframe();
    this._drawHighlight();
    if (this._time < INTRO_TRANSITION_DURATION ||
        this._time < OUTRO_TRANSITION_DURATION) {
      this._redraw = true;
    }
    this._time += this._delta;
  }
function TVP__drawVisualization ( ) { let renderer = this . _renderer ; let transforms = this . transforms ; let w = renderer . width ; let h = renderer . height ; let ih = renderer . initialHeight ; if ( ! this . _meshStacks || ! this . _meshWireframe ) { return ; } renderer . clear ( ) ; renderer . perspective ( ) ; let ortho = mat4 . ortho ( 0 , w , h , 0 , - 1000 , 1000 ) ; if ( ! this . _isExecutingDestruction ) { let f = this . _time / INTRO_TRANSITION_DURATION ; renderer . lerp ( renderer . projMatrix , ortho , f , 8 ) ; } else { let f = this . _time / OUTRO_TRANSITION_DURATION ; renderer . lerp ( renderer . projMatrix , ortho , 1 - f , 8 ) ; } renderer . translate ( w * 0.5 , ih * 0.5 , - INITIAL_Z_TRANSLATION ) ; renderer . translate ( transforms . translation [ 0 ] , 0 , transforms . translation [ 2 ] ) ; renderer . transform ( quat4 . toMat4 ( transforms . rotation ) ) ; renderer . translate ( transforms . offset [ 0 ] , transforms . offset [ 1 ] + transforms . translation [ 1 ] , 0 ) ; renderer . scale ( transforms . zoom , transforms . zoom ) ; renderer . strokeWeight ( 2 ) ; renderer . depthTest ( true ) ; this . _drawMeshStacks ( ) ; this . _drawMeshWireframe ( ) ; this . _drawHighlight ( ) ; if ( this . _time < INTRO_TRANSITION_DURATION || this . _time < OUTRO_TRANSITION_DURATION ) { this . _redraw = true ; } this . _time += this . _delta ; }
Draws the visualization mesh and highlight quad.
Draws the visualization mesh and highlight quad .
// if the mesh wasn't created yet, don't continue rendering // clear the context to an opaque black background // apply a transition transformation using an ortho and perspective matrix // apply the preliminary transformations to the model view // calculate the camera matrix using the rotation and translation // offset the visualization mesh to center // draw the visualization mesh // make sure the initial transition is drawn until finished