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 e9a02e800..bfc3da839 100644 --- a/tools/winscope-ng/src/common/trace/flickerlib/layers/Layer.ts +++ b/tools/winscope-ng/src/common/trace/flickerlib/layers/Layer.ts @@ -19,7 +19,7 @@ import { Layer, LayerProperties, Rect, toActiveBuffer, toColor, toRect, toRectF, import { shortenName } from '../mixin' import Transform from './Transform' -Layer.fromProto = function (proto: any): Layer { +Layer.fromProto = function (proto: any, excludesCompositionState = false): Layer { const visibleRegion = toRegion(proto.visibleRegion) const activeBuffer = toActiveBuffer(proto.activeBuffer) const bounds = toRectF(proto.bounds) @@ -45,11 +45,11 @@ Layer.fromProto = function (proto: any): Layer { const properties = new LayerProperties( visibleRegion, - activeBuffer, + activeBuffer, /* flags */ proto.flags, - bounds, - color, - /* isOpaque */ proto.isOpaque, + bounds, + color, + /* isOpaque */ proto.isOpaque, /* shadowRadius */ proto.shadowRadius, /* cornerRadius */ proto.cornerRadius, /* type */ proto.type ?? ``, @@ -70,13 +70,14 @@ Layer.fromProto = function (proto: any): Layer { requestedColor, cornerRadiusCrop, inputTransform, - inputRegion + inputRegion, + excludesCompositionState ); const entry = new Layer( - /* name */ proto.name ?? ``, + /* name */ proto.name ?? ``, /* id */ proto.id, - /*parentId */ proto.parent, + /*parentId */ proto.parent, /* z */ proto.z, /* currFrame */ proto.currFrame, properties diff --git a/tools/winscope-ng/src/common/trace/flickerlib/layers/LayerTraceEntry.ts b/tools/winscope-ng/src/common/trace/flickerlib/layers/LayerTraceEntry.ts index 649daf8af..fd60f3901 100644 --- a/tools/winscope-ng/src/common/trace/flickerlib/layers/LayerTraceEntry.ts +++ b/tools/winscope-ng/src/common/trace/flickerlib/layers/LayerTraceEntry.ts @@ -28,9 +28,10 @@ LayerTraceEntry.fromProto = function ( hwcBlob: string, where = "", realToElapsedTimeOffsetNs: bigint|undefined = undefined, - useElapsedTime = false + useElapsedTime = false, + excludesCompositionState = false ): LayerTraceEntry { - const layers = protos.map(it => Layer.fromProto(it)); + const layers = protos.map(it => Layer.fromProto(it, excludesCompositionState)); const displays = (displayProtos || []).map(it => newDisplay(it)); const builder = new LayerTraceEntryBuilder( `${elapsedTimestamp}`, diff --git a/tools/winscope-ng/src/parsers/parser_surface_flinger.ts b/tools/winscope-ng/src/parsers/parser_surface_flinger.ts index 359c9a7ea..2920c4978 100644 --- a/tools/winscope-ng/src/parsers/parser_surface_flinger.ts +++ b/tools/winscope-ng/src/parsers/parser_surface_flinger.ts @@ -37,8 +37,8 @@ class ParserSurfaceFlinger extends Parser { const decoded = LayersTraceFileProto.decode(buffer); if (Object.prototype.hasOwnProperty.call(decoded, "realToElapsedTimeOffsetNanos")) { this.realToElapsedTimeOffsetNs = BigInt(decoded.realToElapsedTimeOffsetNanos); - } - else { + } else { + console.warn("Missing realToElapsedTimeOffsetNanos property on SF trace proto"); this.realToElapsedTimeOffsetNs = undefined; } return decoded.entry; @@ -68,7 +68,8 @@ class ParserSurfaceFlinger extends Parser { entryProto.hwcBlob, entryProto.where, this.realToElapsedTimeOffsetNs, - timestampType === TimestampType.ELAPSED /*useElapsedTime*/ + timestampType === TimestampType.ELAPSED /*useElapsedTime*/, + entryProto.excludesCompositionState ?? false ); }