Bug 1041166 - Rename `lastDrawCallScreenshot` to `animationFrameEndScreenshot` in canvas.js, r=past
authorVictor Porof <vporof@mozilla.com>
Tue, 22 Jul 2014 12:43:24 -0400
changeset 195537 fb21d6d2fdfa4b9cec9d48221a6fb1033d1d6117
parent 195536 5242ae7a8eb0a36e3491281704e53a94be47c2d1
child 195538 3d091524a1b8b81722ef94b1bab23d70cf2e5a02
push id27185
push userkwierso@gmail.com
push dateWed, 23 Jul 2014 01:05:43 +0000
treeherdermozilla-central@5683746bac22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs1041166
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1041166 - Rename `lastDrawCallScreenshot` to `animationFrameEndScreenshot` in canvas.js, r=past
toolkit/devtools/server/actors/canvas.js
--- a/toolkit/devtools/server/actors/canvas.js
+++ b/toolkit/devtools/server/actors/canvas.js
@@ -112,27 +112,27 @@ let FrameSnapshotActor = protocol.ActorC
    *        An array of "function-call" actor instances.
    * @param object screenshot
    *        A single "snapshot-image" type instance.
    */
   initialize: function(conn, { canvas, calls, screenshot }) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this._contentCanvas = canvas;
     this._functionCalls = calls;
-    this._lastDrawCallScreenshot = screenshot;
+    this._animationFrameEndScreenshot = screenshot;
   },
 
   /**
    * Gets as much data about this snapshot without computing anything costly.
    */
   getOverview: method(function() {
     return {
       calls: this._functionCalls,
       thumbnails: this._functionCalls.map(e => e._thumbnail).filter(e => !!e),
-      screenshot: this._lastDrawCallScreenshot
+      screenshot: this._animationFrameEndScreenshot
     };
   }, {
     response: { overview: RetVal("snapshot-overview") }
   }),
 
   /**
    * Gets a screenshot of the canvas's contents after the specified
    * function was called.
@@ -182,40 +182,40 @@ let FrameSnapshotActor = protocol.ActorC
 });
 
 /**
  * The corresponding Front object for the FrameSnapshotActor.
  */
 let FrameSnapshotFront = protocol.FrontClass(FrameSnapshotActor, {
   initialize: function(client, form) {
     protocol.Front.prototype.initialize.call(this, client, form);
-    this._lastDrawCallScreenshot = null;
+    this._animationFrameEndScreenshot = null;
     this._cachedScreenshots = new WeakMap();
   },
 
   /**
-   * This implementation caches the last draw call screenshot to optimize
+   * This implementation caches the animation frame end screenshot to optimize
    * frontend requests to `generateScreenshotFor`.
    */
   getOverview: custom(function() {
     return this._getOverview().then(data => {
-      this._lastDrawCallScreenshot = data.screenshot;
+      this._animationFrameEndScreenshot = data.screenshot;
       return data;
     });
   }, {
     impl: "_getOverview"
   }),
 
   /**
    * This implementation saves a roundtrip to the backend if the screenshot
    * was already generated and retrieved once.
    */
   generateScreenshotFor: custom(function(functionCall) {
     if (CanvasFront.ANIMATION_GENERATORS.has(functionCall.name)) {
-      return promise.resolve(this._lastDrawCallScreenshot);
+      return promise.resolve(this._animationFrameEndScreenshot);
     }
     let cachedScreenshot = this._cachedScreenshots.get(functionCall);
     if (cachedScreenshot) {
       return cachedScreenshot;
     }
     let screenshot = this._generateScreenshotFor(functionCall);
     this._cachedScreenshots.set(functionCall, screenshot);
     return screenshot;
@@ -366,30 +366,30 @@ let CanvasActor = exports.CanvasActor = 
 
     // Since the animation frame finished, get a hold of the (already retrieved)
     // canvas pixels to conveniently create a screenshot of the final rendering.
     let index = this._lastDrawCallIndex;
     let width = this._lastContentCanvasWidth;
     let height = this._lastContentCanvasHeight;
     let flipped = !!this._lastThumbnailFlipped; // undefined -> false
     let pixels = ContextUtils.getPixelStorage()["32bit"];
-    let lastDrawCallScreenshot = {
+    let animationFrameEndScreenshot = {
       index: index,
       width: width,
       height: height,
       flipped: flipped,
       pixels: pixels.subarray(0, width * height)
     };
 
     // Wrap the function calls and screenshot in a FrameSnapshotActor instance,
     // which will resolve the promise returned by `recordAnimationFrame`.
     let frameSnapshot = new FrameSnapshotActor(this.conn, {
       canvas: this._lastDrawCallCanvas,
       calls: functionCalls,
-      screenshot: lastDrawCallScreenshot
+      screenshot: animationFrameEndScreenshot
     });
 
     this._currentAnimationFrameSnapshot.resolve(frameSnapshot);
     this._currentAnimationFrameSnapshot = null;
     this._animationStarted = false;
   },
 
   /**