diff --git a/tools/winscope/adb_proxy/winscope_proxy.py b/tools/winscope/adb_proxy/winscope_proxy.py index 3f0646721..9a703a3df 100755 --- a/tools/winscope/adb_proxy/winscope_proxy.py +++ b/tools/winscope/adb_proxy/winscope_proxy.py @@ -132,7 +132,6 @@ class TraceTarget: self.trace_start = trace_start self.trace_stop = trace_stop - # Order of files matters as they will be expected in that order and decoded in that order TRACE_TARGETS = { "window_trace": TraceTarget( @@ -155,9 +154,14 @@ TRACE_TARGETS = { f'screenrecord --bit-rate 8M /data/local/tmp/screen.mp4 >/dev/null 2>&1 &\necho "ScreenRecorder started."', 'pkill -l SIGINT screenrecord >/dev/null 2>&1' ), - "transaction": TraceTarget( + "transactions": TraceTarget( + WinscopeFileMatcher(WINSCOPE_DIR, "transactions_trace", "transactions"), + 'su root service call SurfaceFlinger 1041 i32 1\necho "SF transactions recording started."', + 'su root service call SurfaceFlinger 1041 i32 0 >/dev/null 2>&1' + ), + "transactions_legacy": TraceTarget( [ - WinscopeFileMatcher(WINSCOPE_DIR, "transaction_trace", "transactions"), + WinscopeFileMatcher(WINSCOPE_DIR, "transaction_trace", "transactions_legacy"), FileMatcher(WINSCOPE_DIR, f'transaction_merges_*', "transaction_merges"), ], 'su root service call SurfaceFlinger 1020 i32 1\necho "SF transactions recording started."', diff --git a/tools/winscope/spec/traces/ExpectedTraces.js b/tools/winscope/spec/traces/ExpectedTraces.js index 1f01de07e..04a815434 100644 --- a/tools/winscope/spec/traces/ExpectedTraces.js +++ b/tools/winscope/spec/traces/ExpectedTraces.js @@ -1,7 +1,7 @@ -import { Buffer, RectF, Transform, Matrix, Color, Rect, Region } from '../../src/flickerlib/common.js'; +import { ActiveBuffer, RectF, Transform, Matrix33, Color, Rect, Region } from '../../src/flickerlib/common.js'; import { VISIBLE_CHIP } from '../../src/flickerlib/treeview/Chips'; -const standardTransform = new Transform(0, new Matrix(1, 0, 0, 0, 1, 0)); +const standardTransform = new Transform(0, new Matrix33(1, 0, 0, 0, 1, 0)); const standardRect = new Rect(0, 0, 0, 0); const standardColor = new Color(0, 0, 0, 1); const standardCrop = new Rect(0, 0, -1, -1); @@ -23,13 +23,13 @@ const expectedEmptyRegionLayer = { z: -1, zOrderRelativeOf: null, parentId: 579, - activeBuffer: new Buffer(1440, 2614, 1472, 1), + activeBuffer: new ActiveBuffer(1440, 2614, 1472, 1), bufferTransform: standardTransform, color: new Color(0, 0, 0, 0.0069580078125), crop: standardCrop, hwcFrame: standardRect, screenBounds: new RectF(37, 43, 146, 152), - transform: new Transform(0, new Matrix(1, 0, 37.37078094482422, 0, 1, -3.5995326042175293)), + transform: new Transform(0, new Matrix33(1, 0, 37.37078094482422, 0, 1, -3.5995326042175293)), visibleRegion: new Region([new Rect(37, 43, 146, 152)]), }; const emptyRegionProto = { @@ -114,7 +114,7 @@ const expectedInvalidLayerVisibilityLayer = { zOrderRelativeOf: null, parentId: 1535, stableId: "BufferLayer 1536 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity#2", - activeBuffer: new Buffer(1440, 2880, 1472, 1), + activeBuffer: new ActiveBuffer(1440, 2880, 1472, 1), bufferTransform: standardTransform, color: new Color(-1, -1, -1, 0), hwcFrame: standardRect, @@ -202,13 +202,13 @@ const expectedOrphanLayersLayer = { zOrderRelativeOf: null, parentId: 1011, stableId: "BufferLayer 1012 SurfaceView - com.android.chrome/com.google.android.apps.chrome.Main#0", - activeBuffer: new Buffer(1440, 2614, 1472, 1), + activeBuffer: new ActiveBuffer(1440, 2614, 1472, 1), bufferTransform: standardTransform, color: standardColor, crop: standardCrop, hwcFrame: standardRect, screenBounds: new RectF(0, 98, 1440, 2712), - transform: new Transform(0, new Matrix(1, 0, 0, 0, 1, 98)), + transform: new Transform(0, new Matrix33(1, 0, 0, 0, 1, 98)), visibleRegion: new Region([new Rect(0, 98, 1440, 2712)]), }; const expectedOrphanLayersProto = { @@ -294,7 +294,7 @@ const expectedRootLayer = { zOrderRelativeOf: null, parentId: 12541, stableId: "BufferQueueLayer 12545 com.android.server.wm.flicker.testapp/com.android.server.wm.flicker.testapp.SimpleActivity#0", - activeBuffer: new Buffer(1440, 2960, 1472, 1), + activeBuffer: new ActiveBuffer(1440, 2960, 1472, 1), chips: [VISIBLE_CHIP], bufferTransform: standardTransform, color: standardColor, @@ -398,7 +398,7 @@ const expectedRootAospLayer = { z: 0, zOrderRelativeOf: null, parentId: 41, - activeBuffer: new Buffer(1440, 2880, 1472, 1), + activeBuffer: new ActiveBuffer(1440, 2880, 1472, 1), bufferTransform: standardTransform, chips: [VISIBLE_CHIP], color: standardColor, diff --git a/tools/winscope/src/DataAdb.vue b/tools/winscope/src/DataAdb.vue index caf7a99e5..0b1eb8bcf 100644 --- a/tools/winscope/src/DataAdb.vue +++ b/tools/winscope/src/DataAdb.vue @@ -188,8 +188,8 @@ const TRACES = { 'layers_trace': { name: 'Surface Flinger', }, - 'transaction': { - name: 'Transactions', + 'transactions': { + name: 'Transaction', }, 'proto_log': { name: 'ProtoLog', @@ -269,6 +269,7 @@ const proxyFileTypeAdapter = { 'wl_dump': FILE_TYPES.WAYLAND_DUMP, 'screen_recording': FILE_TYPES.SCREEN_RECORDING, 'transactions': FILE_TYPES.TRANSACTIONS_TRACE, + 'transactions_legacy': FILE_TYPES.TRANSACTIONS_TRACE_LEGACY, 'proto_log': FILE_TYPES.PROTO_LOG, 'system_ui_trace': FILE_TYPES.SYSTEM_UI, 'launcher_trace': FILE_TYPES.LAUNCHER, diff --git a/tools/winscope/src/DataView.vue b/tools/winscope/src/DataView.vue index a353e039d..d185f407b 100644 --- a/tools/winscope/src/DataView.vue +++ b/tools/winscope/src/DataView.vue @@ -57,8 +57,8 @@ :presentErrors="presentErrors" ref="view" /> - @@ -87,7 +87,7 @@ import TraceView from '@/TraceView.vue'; import AccessibilityTraceView from '@/AccessibilityTraceView.vue'; import WindowManagerTraceView from '@/WindowManagerTraceView.vue'; import SurfaceFlingerTraceView from '@/SurfaceFlingerTraceView.vue'; -import TransactionsView from '@/TransactionsView.vue'; +import TransactionsViewLegacy from '@/TransactionsViewLegacy.vue'; import LogView from '@/LogView.vue'; import FileType from '@/mixins/FileType.js'; import FlatCard from '@/components/FlatCard.vue'; @@ -181,7 +181,7 @@ export default { mixins: [FileType], components: { 'traceview': TraceView, - 'transactionsview': TransactionsView, + 'transactionsviewlegacy': TransactionsViewLegacy, 'logview': LogView, 'flat-card': FlatCard, AccessibilityTraceView, diff --git a/tools/winscope/src/TransactionEntry.vue b/tools/winscope/src/TransactionEntryLegacy.vue similarity index 99% rename from tools/winscope/src/TransactionEntry.vue rename to tools/winscope/src/TransactionEntryLegacy.vue index ba27e0215..08c6af9cd 100644 --- a/tools/winscope/src/TransactionEntry.vue +++ b/tools/winscope/src/TransactionEntryLegacy.vue @@ -69,7 +69,7 @@ import { shortenName } from './flickerlib/mixin' export default { - name: 'transaction-entry', + name: 'transaction-entry-legacy', props: { index: { type: Number, diff --git a/tools/winscope/src/TransactionsView.vue b/tools/winscope/src/TransactionsViewLegacy.vue similarity index 98% rename from tools/winscope/src/TransactionsView.vue rename to tools/winscope/src/TransactionsViewLegacy.vue index 80b8827ac..782a58f03 100644 --- a/tools/winscope/src/TransactionsView.vue +++ b/tools/winscope/src/TransactionsViewLegacy.vue @@ -152,14 +152,17 @@