@postermywall/fabricjs-2 6.4.2-pmw-29 → 6.4.2-pmw-31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -428,7 +428,7 @@
428
428
  }
429
429
  const cache = new Cache();
430
430
 
431
- var version = "6.4.2-pmw-29";
431
+ var version = "6.4.2-pmw-31";
432
432
 
433
433
  // use this syntax so babel plugin see this import here
434
434
  const VERSION = version;
@@ -3465,6 +3465,7 @@
3465
3465
  if (this.destroyed) {
3466
3466
  return;
3467
3467
  }
3468
+ const t1 = performance.now();
3468
3469
  const v = this.viewportTransform,
3469
3470
  path = this.clipPath;
3470
3471
  this.calcViewportBoundaries();
@@ -3475,15 +3476,20 @@
3475
3476
  this.fire('before:render', {
3476
3477
  ctx
3477
3478
  });
3479
+ const t2 = performance.now();
3478
3480
  this._renderBackground(ctx);
3481
+ const t3 = performance.now();
3479
3482
  ctx.save();
3480
3483
  //apply viewport transform once for all rendering process
3481
3484
  ctx.transform(v[0], v[1], v[2], v[3], v[4], v[5]);
3485
+ const t4 = performance.now();
3482
3486
  this._renderObjects(ctx, objects);
3487
+ const t5 = performance.now();
3483
3488
  ctx.restore();
3484
3489
  if (!this.controlsAboveOverlay && !this.skipControlsDrawing) {
3485
3490
  this.drawControls(ctx);
3486
3491
  }
3492
+ const t6 = performance.now();
3487
3493
  if (path) {
3488
3494
  path._set('canvas', this);
3489
3495
  // needed to setup a couple of variables
@@ -3494,10 +3500,13 @@
3494
3500
  });
3495
3501
  this.drawClipPathOnCanvas(ctx, path);
3496
3502
  }
3503
+ const t7 = performance.now();
3497
3504
  this._renderOverlay(ctx);
3505
+ const t8 = performance.now();
3498
3506
  if (this.controlsAboveOverlay && !this.skipControlsDrawing) {
3499
3507
  this.drawControls(ctx);
3500
3508
  }
3509
+ const t9 = performance.now();
3501
3510
  this.fire('after:render', {
3502
3511
  ctx
3503
3512
  });
@@ -3505,6 +3514,24 @@
3505
3514
  this.__cleanupTask();
3506
3515
  this.__cleanupTask = undefined;
3507
3516
  }
3517
+ const t10 = performance.now();
3518
+ const times = {
3519
+ randomStartTime: t2 - t1,
3520
+ renderBackground: t3 - t2,
3521
+ transform: t4 - t3,
3522
+ renderObjects: t5 - t4,
3523
+ drawControls: t6 - t5,
3524
+ pathThingy: t7 - t6,
3525
+ renderOverlay: t8 - t7,
3526
+ drawControlsOverlay: t9 - t8,
3527
+ cleanup: t10 - t9,
3528
+ totalTime: t10 - t1
3529
+ };
3530
+ let logMessage = '';
3531
+ for (const [key, value] of Object.entries(times)) {
3532
+ logMessage += "".concat(key, " ").concat(String(Math.round(value)), "ms ");
3533
+ }
3534
+ console.trace(logMessage);
3508
3535
  }
3509
3536
 
3510
3537
  /**