Compatibilize winscope with new flicker layer ctor

Bug: 236847856
Test: yarn run test
Change-Id: I5c361393668344554ed8d11db57101fe0fd25a16
This commit is contained in:
Nataniel Borges
2022-08-04 19:04:12 +00:00
parent 99a2ff31bc
commit f0a4ca4b88
4 changed files with 57 additions and 44 deletions

View File

@@ -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,

View File

@@ -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);

View File

@@ -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,

View File

@@ -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
}