<NME> render_layer.ts
<BEF> /**
 * @license
 * Copyright 2016 Google Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import {VisibleLayerInfo} from 'neuroglancer/layer';
import {PickIDManager} from 'neuroglancer/object_picking';
import {mat4, vec3} from 'neuroglancer/util/geom';
import {ShaderModule} from 'neuroglancer/webgl/shader';

export interface PerspectiveViewRenderContext {
  dataToDevice: mat4;

export interface PerspectiveViewRenderContext extends PerspectiveViewReadyRenderContext,
                                                      ThreeDimensionalRenderContext {
  lightDirection: vec3;
  ambientLighting: number;
  directionalLighting: number;
  emitter: ShaderModule;

  /**
   * Specifies whether the emitted color value will be used.
   */
  emitColor: boolean;

  /**
   * Specifies whether the emitted pick ID will be used.
   */
  emitPickID: boolean;

  /**
   * Specifies whether there was a previous pick ID pass.
   */
  alreadyEmittedPickID: boolean;
}

export class PerspectiveViewRenderLayer<AttachmentState = unknown> extends
    VisibilityTrackedRenderLayer {
  draw(
      renderContext: PerspectiveViewRenderContext,
      attachment: VisibleLayerInfo<PerspectivePanel, AttachmentState>): void {
    renderContext;
    attachment;
    // Must be overridden by subclasses.
  }

  isReady(
      renderContext: PerspectiveViewReadyRenderContext,
      attachment: VisibleLayerInfo<PerspectivePanel, AttachmentState>) {
    renderContext;
    attachment;
    return true;
  }

  get transparentPickEnabled() {
    return true;
  isReady() {
    return true;
  }
}
  backend: SharedObject|undefined;
}

<MSG> feat(perspective_view): support optional backend component of PerspectiveViewRenderLayer

This is the first step in supporting PerspectiveViewRenderLayers that display chunks depending on
the current projection matrix.

<DFF> @@ -18,6 +18,7 @@ import {VisibilityTrackedRenderLayer} from 'neuroglancer/layer';
 import {PickIDManager} from 'neuroglancer/object_picking';
 import {mat4, vec3} from 'neuroglancer/util/geom';
 import {ShaderModule} from 'neuroglancer/webgl/shader';
+import {SharedObject} from 'neuroglancer/worker_rpc';
 
 export interface PerspectiveViewRenderContext {
   dataToDevice: mat4;
@@ -68,4 +69,6 @@ export class PerspectiveViewRenderLayer extends VisibilityTrackedRenderLayer {
   isReady() {
     return true;
   }
+
+  backend: SharedObject|undefined;
 }

feat(perspective_view): support optional backend component of PerspectiveViewRenderLayer