diff --git a/tools/winscope-ng/src/common/trace/flickerlib/common.js b/tools/winscope-ng/src/common/trace/flickerlib/common.js index 698454f8d..899f6f258 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 @@ const WindowToken = require('flicker').com.android.server.wm.traces.common. // 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 @@ export { // 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 c0bdb29f2..f27a35efe 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 @@ Layer.fromProto = function (proto: any): Layer { 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 5633cad33..1aa255c86 100644 --- a/tools/winscope/src/flickerlib/common.js +++ b/tools/winscope/src/flickerlib/common.js @@ -57,6 +57,8 @@ const WINDOW_MANAGER_KIND = 'WindowManagerState'; // 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 @@ export { // 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 79b80879f..19ba180a7 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 @@ Layer.fromProto = function (proto: any): Layer { 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 }