|
@@ -87,18 +87,19 @@
|
|
}) {
|
|
}) {
|
|
super(settings);
|
|
super(settings);
|
|
|
|
|
|
- this._drawCallsOpaqueCounter = new PerfCounter();
|
|
|
|
- this._drawCallsAlphaTestCounter = new PerfCounter();
|
|
|
|
- this._drawCallsTransparentCounter = new PerfCounter();
|
|
|
|
- this._groupRenderCounter = new PerfCounter();
|
|
|
|
- this._updateTransparentDataCounter = new PerfCounter();
|
|
|
|
- this._cachedGroupRenderCounter = new PerfCounter();
|
|
|
|
- this._updateCachedStateCounter = new PerfCounter();
|
|
|
|
- this._updateLayoutCounter = new PerfCounter();
|
|
|
|
- this._updatePositioningCounter = new PerfCounter();
|
|
|
|
- this._updateLocalTransformCounter = new PerfCounter();
|
|
|
|
- this._updateGlobalTransformCounter = new PerfCounter();
|
|
|
|
- this._boundingInfoRecomputeCounter = new PerfCounter();
|
|
|
|
|
|
+ this._drawCallsOpaqueCounter = new PerfCounter();
|
|
|
|
+ this._drawCallsAlphaTestCounter = new PerfCounter();
|
|
|
|
+ this._drawCallsTransparentCounter = new PerfCounter();
|
|
|
|
+ this._groupRenderCounter = new PerfCounter();
|
|
|
|
+ this._updateTransparentDataCounter = new PerfCounter();
|
|
|
|
+ this._cachedGroupRenderCounter = new PerfCounter();
|
|
|
|
+ this._updateCachedStateCounter = new PerfCounter();
|
|
|
|
+ this._updateLayoutCounter = new PerfCounter();
|
|
|
|
+ this._updatePositioningCounter = new PerfCounter();
|
|
|
|
+ this._updateLocalTransformCounter = new PerfCounter();
|
|
|
|
+ this._updateGlobalTransformCounter = new PerfCounter();
|
|
|
|
+ this._boundingInfoRecomputeCounter = new PerfCounter();
|
|
|
|
+ this._layoutBoundingInfoUpdateCounter = new PerfCounter();
|
|
|
|
|
|
this._cachedCanvasGroup = null;
|
|
this._cachedCanvasGroup = null;
|
|
|
|
|
|
@@ -276,6 +277,10 @@
|
|
return this._boundingInfoRecomputeCounter;
|
|
return this._boundingInfoRecomputeCounter;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public get layoutBoundingInfoUpdateCounter(): PerfCounter {
|
|
|
|
+ return this._layoutBoundingInfoUpdateCounter;
|
|
|
|
+ }
|
|
|
|
+
|
|
public static get instances() : Array<Canvas2D> {
|
|
public static get instances() : Array<Canvas2D> {
|
|
return Canvas2D._INSTANCES;
|
|
return Canvas2D._INSTANCES;
|
|
}
|
|
}
|
|
@@ -1134,6 +1139,7 @@
|
|
this._updateLocalTransformCounter.fetchNewFrame();
|
|
this._updateLocalTransformCounter.fetchNewFrame();
|
|
this._updateGlobalTransformCounter.fetchNewFrame();
|
|
this._updateGlobalTransformCounter.fetchNewFrame();
|
|
this._boundingInfoRecomputeCounter.fetchNewFrame();
|
|
this._boundingInfoRecomputeCounter.fetchNewFrame();
|
|
|
|
+ this._layoutBoundingInfoUpdateCounter.fetchNewFrame();
|
|
}
|
|
}
|
|
|
|
|
|
private _fetchPerfMetrics() {
|
|
private _fetchPerfMetrics() {
|
|
@@ -1149,6 +1155,7 @@
|
|
this._updateLocalTransformCounter.addCount(0, true);
|
|
this._updateLocalTransformCounter.addCount(0, true);
|
|
this._updateGlobalTransformCounter.addCount(0, true);
|
|
this._updateGlobalTransformCounter.addCount(0, true);
|
|
this._boundingInfoRecomputeCounter.addCount(0, true);
|
|
this._boundingInfoRecomputeCounter.addCount(0, true);
|
|
|
|
+ this._layoutBoundingInfoUpdateCounter.addCount(0, true);
|
|
}
|
|
}
|
|
|
|
|
|
private _updateProfileCanvas() {
|
|
private _updateProfileCanvas() {
|
|
@@ -1170,7 +1177,8 @@
|
|
` - Update Positioning: ${this.updatePositioningCounter.current}, (avg:${format(this.updatePositioningCounter.lastSecAverage)}, t:${format(this.updatePositioningCounter.total)})\n` +
|
|
` - Update Positioning: ${this.updatePositioningCounter.current}, (avg:${format(this.updatePositioningCounter.lastSecAverage)}, t:${format(this.updatePositioningCounter.total)})\n` +
|
|
` - Update Local Trans: ${this.updateLocalTransformCounter.current}, (avg:${format(this.updateLocalTransformCounter.lastSecAverage)}, t:${format(this.updateLocalTransformCounter.total)})\n` +
|
|
` - Update Local Trans: ${this.updateLocalTransformCounter.current}, (avg:${format(this.updateLocalTransformCounter.lastSecAverage)}, t:${format(this.updateLocalTransformCounter.total)})\n` +
|
|
` - Update Global Trans: ${this.updateGlobalTransformCounter.current}, (avg:${format(this.updateGlobalTransformCounter.lastSecAverage)}, t:${format(this.updateGlobalTransformCounter.total)})\n` +
|
|
` - Update Global Trans: ${this.updateGlobalTransformCounter.current}, (avg:${format(this.updateGlobalTransformCounter.lastSecAverage)}, t:${format(this.updateGlobalTransformCounter.total)})\n` +
|
|
- ` - BoundingInfo Recompute: ${this.boundingInfoRecomputeCounter.current}, (avg:${format(this.boundingInfoRecomputeCounter.lastSecAverage)}, t:${format(this.boundingInfoRecomputeCounter.total)})`;
|
|
|
|
|
|
+ ` - BoundingInfo Recompute: ${this.boundingInfoRecomputeCounter.current}, (avg:${format(this.boundingInfoRecomputeCounter.lastSecAverage)}, t:${format(this.boundingInfoRecomputeCounter.total)})\n` +
|
|
|
|
+ ` - LayoutBoundingInfo Recompute: ${this.layoutBoundingInfoUpdateCounter.current}, (avg:${format(this.layoutBoundingInfoUpdateCounter.lastSecAverage)}, t:${format(this.layoutBoundingInfoUpdateCounter.total)})` ;
|
|
this._profileInfoText.text = p;
|
|
this._profileInfoText.text = p;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1189,35 +1197,57 @@
|
|
}
|
|
}
|
|
|
|
|
|
public _addGroupRenderCount(count: number) {
|
|
public _addGroupRenderCount(count: number) {
|
|
- this._groupRenderCounter.addCount(count, false);
|
|
|
|
|
|
+ if (this._groupRenderCounter) {
|
|
|
|
+ this._groupRenderCounter.addCount(count, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public _addUpdateTransparentDataCount(count: number) {
|
|
public _addUpdateTransparentDataCount(count: number) {
|
|
- this._updateTransparentDataCounter.addCount(count, false);
|
|
|
|
|
|
+ if (this._updateTransparentDataCounter) {
|
|
|
|
+ this._updateTransparentDataCounter.addCount(count, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public addCachedGroupRenderCounter(count: number) {
|
|
public addCachedGroupRenderCounter(count: number) {
|
|
- this._cachedGroupRenderCounter.addCount(count, false);
|
|
|
|
|
|
+ if (this._cachedGroupRenderCounter) {
|
|
|
|
+ this._cachedGroupRenderCounter.addCount(count, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public addUpdateCachedStateCounter(count: number) {
|
|
public addUpdateCachedStateCounter(count: number) {
|
|
- this._updateCachedStateCounter.addCount(count, false);
|
|
|
|
|
|
+ if (this._updateCachedStateCounter) {
|
|
|
|
+ this._updateCachedStateCounter.addCount(count, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public addUpdateLayoutCounter(count: number) {
|
|
public addUpdateLayoutCounter(count: number) {
|
|
- this._updateLayoutCounter.addCount(count, false);
|
|
|
|
|
|
+ if (this._updateLayoutCounter) {
|
|
|
|
+ this._updateLayoutCounter.addCount(count, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public addUpdatePositioningCounter(count: number) {
|
|
public addUpdatePositioningCounter(count: number) {
|
|
- this._updatePositioningCounter.addCount(count, false);
|
|
|
|
|
|
+ if (this._updatePositioningCounter) {
|
|
|
|
+ this._updatePositioningCounter.addCount(count, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public addupdateLocalTransformCounter(count: number) {
|
|
public addupdateLocalTransformCounter(count: number) {
|
|
- this._updateLocalTransformCounter.addCount(count, false);
|
|
|
|
|
|
+ if (this._updateLocalTransformCounter) {
|
|
|
|
+ this._updateLocalTransformCounter.addCount(count, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public addUpdateGlobalTransformCounter(count: number) {
|
|
public addUpdateGlobalTransformCounter(count: number) {
|
|
- this._updateGlobalTransformCounter.addCount(count, false);
|
|
|
|
|
|
+ if (this._updateGlobalTransformCounter) {
|
|
|
|
+ this._updateGlobalTransformCounter.addCount(count, false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public addLayoutBoundingInfoUpdateCounter(count: number) {
|
|
|
|
+ if (this._layoutBoundingInfoUpdateCounter) {
|
|
|
|
+ this._layoutBoundingInfoUpdateCounter.addCount(count, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private _renderObservable: Observable<Canvas2D>;
|
|
private _renderObservable: Observable<Canvas2D>;
|
|
@@ -1264,18 +1294,19 @@
|
|
|
|
|
|
public _renderingSize: Size;
|
|
public _renderingSize: Size;
|
|
|
|
|
|
- private _drawCallsOpaqueCounter : PerfCounter;
|
|
|
|
- private _drawCallsAlphaTestCounter : PerfCounter;
|
|
|
|
- private _drawCallsTransparentCounter : PerfCounter;
|
|
|
|
- private _groupRenderCounter : PerfCounter;
|
|
|
|
- private _updateTransparentDataCounter: PerfCounter;
|
|
|
|
- private _cachedGroupRenderCounter : PerfCounter;
|
|
|
|
- private _updateCachedStateCounter : PerfCounter;
|
|
|
|
- private _updateLayoutCounter : PerfCounter;
|
|
|
|
- private _updatePositioningCounter : PerfCounter;
|
|
|
|
- private _updateGlobalTransformCounter: PerfCounter;
|
|
|
|
- private _updateLocalTransformCounter : PerfCounter;
|
|
|
|
- private _boundingInfoRecomputeCounter: PerfCounter;
|
|
|
|
|
|
+ private _drawCallsOpaqueCounter : PerfCounter;
|
|
|
|
+ private _drawCallsAlphaTestCounter : PerfCounter;
|
|
|
|
+ private _drawCallsTransparentCounter : PerfCounter;
|
|
|
|
+ private _groupRenderCounter : PerfCounter;
|
|
|
|
+ private _updateTransparentDataCounter : PerfCounter;
|
|
|
|
+ private _cachedGroupRenderCounter : PerfCounter;
|
|
|
|
+ private _updateCachedStateCounter : PerfCounter;
|
|
|
|
+ private _updateLayoutCounter : PerfCounter;
|
|
|
|
+ private _updatePositioningCounter : PerfCounter;
|
|
|
|
+ private _updateGlobalTransformCounter : PerfCounter;
|
|
|
|
+ private _updateLocalTransformCounter : PerfCounter;
|
|
|
|
+ private _boundingInfoRecomputeCounter : PerfCounter;
|
|
|
|
+ private _layoutBoundingInfoUpdateCounter : PerfCounter;
|
|
|
|
|
|
private _profilingCanvas: Canvas2D;
|
|
private _profilingCanvas: Canvas2D;
|
|
private _profileInfoText: Text2D;
|
|
private _profileInfoText: Text2D;
|
|
@@ -1447,7 +1478,6 @@
|
|
|
|
|
|
// If the canvas fit the rendering size and it changed, update
|
|
// If the canvas fit the rendering size and it changed, update
|
|
if (renderingSizeChanged && this._fitRenderingDevice) {
|
|
if (renderingSizeChanged && this._fitRenderingDevice) {
|
|
- this.actualSize = this._renderingSize.clone();
|
|
|
|
this.size = this._renderingSize.clone();
|
|
this.size = this._renderingSize.clone();
|
|
if (this._background) {
|
|
if (this._background) {
|
|
this._background.size = this.size;
|
|
this._background.size = this.size;
|
|
@@ -1466,7 +1496,6 @@
|
|
scale = this._renderingSize.height / this._designSize.height;
|
|
scale = this._renderingSize.height / this._designSize.height;
|
|
}
|
|
}
|
|
this.size = this._designSize.clone();
|
|
this.size = this._designSize.clone();
|
|
- this.actualSize = this._designSize.clone();
|
|
|
|
this.scale = scale;
|
|
this.scale = scale;
|
|
}
|
|
}
|
|
|
|
|