Compatibilize winscope with new flicker layer ctor
Bug: 236847856
Test: yarn run test
Change-Id: I5c361393668344554ed8d11db57101fe0fd25a16
diff --git a/tools/winscope-ng/src/common/trace/flickerlib/common.js b/tools/winscope-ng/src/common/trace/flickerlib/common.js
index 698454f..899f6f2 100644
--- a/tools/winscope-ng/src/common/trace/flickerlib/common.js
+++ b/tools/winscope-ng/src/common/trace/flickerlib/common.js
@@ -56,6 +56,8 @@
// SF
const Layer = require('flicker').com.android.server.wm.traces.common.
layers.Layer;
+const LayerProperties = require('flicker').com.android.server.wm.traces.common.
+ layers.LayerProperties;
const BaseLayerTraceEntry = require('flicker').com.android.server.wm.traces.common.
layers.BaseLayerTraceEntry;
const LayerTraceEntry = require('flicker').com.android.server.wm.traces.common.
@@ -264,6 +266,7 @@
// SF
BaseLayerTraceEntry,
Layer,
+ LayerProperties,
LayerTraceEntry,
LayerTraceEntryBuilder,
LayersTrace,
diff --git a/tools/winscope-ng/src/common/trace/flickerlib/layers/Layer.ts b/tools/winscope-ng/src/common/trace/flickerlib/layers/Layer.ts
index c0bdb29..f27a35e 100644
--- a/tools/winscope-ng/src/common/trace/flickerlib/layers/Layer.ts
+++ b/tools/winscope-ng/src/common/trace/flickerlib/layers/Layer.ts
@@ -15,7 +15,7 @@
*/
-import { Layer, Rect, toActiveBuffer, toColor, toRect, toRectF, toRegion } from "../common"
+import { Layer, LayerProperties, Rect, toActiveBuffer, toColor, toRect, toRectF, toRegion } from "../common"
import { shortenName } from '../mixin'
import { RELATIVE_Z_CHIP, GPU_CHIP, HWC_CHIP } from '../treeview/Chips'
import Transform from './Transform'
@@ -44,39 +44,43 @@
crop = toRect(proto.crop)
};
- const entry = new Layer(
- proto.name ?? ``,
- proto.id,
- proto.parent,
- proto.z,
+ const properties = new LayerProperties(
visibleRegion,
- activeBuffer,
- proto.flags,
- bounds,
- color,
- proto.isOpaque,
- proto.shadowRadius,
- proto.cornerRadius,
- proto.type ?? ``,
+ activeBuffer,
+ /* flags */ proto.flags,
+ bounds,
+ color,
+ /* isOpaque */ proto.isOpaque,
+ /* shadowRadius */ proto.shadowRadius,
+ /* cornerRadius */ proto.cornerRadius,
+ /* type */ proto.type ?? ``,
screenBounds,
transform,
sourceBounds,
- proto.currFrame,
- proto.effectiveScalingMode,
+ /* effectiveScalingMode */ proto.effectiveScalingMode,
bufferTransform,
- proto.hwcCompositionType,
+ /* hwcCompositionType */ proto.hwcCompositionType,
hwcCrop,
hwcFrame,
- proto.backgroundBlurRadius,
+ /* backgroundBlurRadius */ proto.backgroundBlurRadius,
crop,
- proto.isRelativeOf,
- proto.zOrderRelativeOf,
- proto.layerStack,
+ /* isRelativeOf */ proto.isRelativeOf,
+ /* zOrderRelativeOfId */ proto.zOrderRelativeOf,
+ /* stackId */ proto.layerStack,
requestedTransform,
requestedColor,
cornerRadiusCrop,
inputTransform,
- inputRegion,
+ inputRegion
+ );
+
+ const entry = new Layer(
+ /* name */ proto.name ?? ``,
+ /* id */ proto.id,
+ /*parentId */ proto.parent,
+ /* z */ proto.z,
+ /* currFrame */ proto.currFrame,
+ properties
);
addAttributes(entry, proto);
diff --git a/tools/winscope/src/flickerlib/common.js b/tools/winscope/src/flickerlib/common.js
index 5633cad..1aa255c 100644
--- a/tools/winscope/src/flickerlib/common.js
+++ b/tools/winscope/src/flickerlib/common.js
@@ -57,6 +57,8 @@
// SF
const Layer = require('flicker').com.android.server.wm.traces.common.
layers.Layer;
+const LayerProperties = require('flicker').com.android.server.wm.traces.common.
+ layers.LayerProperties;
const BaseLayerTraceEntry = require('flicker').com.android.server.wm.traces.common.
layers.BaseLayerTraceEntry;
const LayerTraceEntry = require('flicker').com.android.server.wm.traces.common.
@@ -277,6 +279,7 @@
// SF
BaseLayerTraceEntry,
Layer,
+ LayerProperties,
LayerTraceEntry,
LayerTraceEntryBuilder,
LayersTrace,
diff --git a/tools/winscope/src/flickerlib/layers/Layer.ts b/tools/winscope/src/flickerlib/layers/Layer.ts
index 79b8087..19ba180 100644
--- a/tools/winscope/src/flickerlib/layers/Layer.ts
+++ b/tools/winscope/src/flickerlib/layers/Layer.ts
@@ -15,7 +15,7 @@
*/
-import { Layer, Rect, toActiveBuffer, toColor, toRect, toRectF, toRegion } from "../common"
+import { Layer, LayerProperties, Rect, toActiveBuffer, toColor, toRect, toRectF, toRegion } from "../common"
import { shortenName } from '../mixin'
import { RELATIVE_Z_CHIP, GPU_CHIP, HWC_CHIP } from '../treeview/Chips'
import Transform from './Transform'
@@ -44,41 +44,44 @@
crop = toRect(proto.crop)
};
- const entry = new Layer(
- proto.name ?? ``,
- proto.id,
- proto.parent,
- proto.z,
+ const properties = new LayerProperties(
visibleRegion,
- activeBuffer,
- proto.flags,
- bounds,
- color,
- proto.isOpaque,
- proto.shadowRadius,
- proto.cornerRadius,
- proto.type ?? ``,
+ activeBuffer,
+ /* flags */ proto.flags,
+ bounds,
+ color,
+ /* isOpaque */ proto.isOpaque,
+ /* shadowRadius */ proto.shadowRadius,
+ /* cornerRadius */ proto.cornerRadius,
+ /* type */ proto.type ?? ``,
screenBounds,
transform,
sourceBounds,
- proto.currFrame,
- proto.effectiveScalingMode,
+ /* effectiveScalingMode */ proto.effectiveScalingMode,
bufferTransform,
- proto.hwcCompositionType,
+ /* hwcCompositionType */ proto.hwcCompositionType,
hwcCrop,
hwcFrame,
- proto.backgroundBlurRadius,
+ /* backgroundBlurRadius */ proto.backgroundBlurRadius,
crop,
- proto.isRelativeOf,
- proto.zOrderRelativeOf,
- proto.layerStack,
+ /* isRelativeOf */ proto.isRelativeOf,
+ /* zOrderRelativeOfId */ proto.zOrderRelativeOf,
+ /* stackId */ proto.layerStack,
requestedTransform,
requestedColor,
cornerRadiusCrop,
inputTransform,
- inputRegion,
+ inputRegion
);
+ const entry = new Layer(
+ /* name */ proto.name ?? ``,
+ /* id */ proto.id,
+ /*parentId */ proto.parent,
+ /* z */ proto.z,
+ /* currFrame */ proto.currFrame,
+ properties
+ );
addAttributes(entry, proto);
return entry
}