Show vsyncs as a colored dividor instead of a full entry in transactionsView
Test: Visual Change-Id: I1b7d384bf9cca3fe89878b835a1ba7002d732ef7
This commit is contained in:
@@ -1,5 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="entry"
|
<div>
|
||||||
|
|
||||||
|
<div v-if="source.type === 'vsyncEvent'" class="vsync">
|
||||||
|
<div class="vsync-dot" />
|
||||||
|
<md-tooltip md-direction="left">
|
||||||
|
VSync
|
||||||
|
</md-tooltip>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else
|
||||||
|
class="entry"
|
||||||
:class="{
|
:class="{
|
||||||
inactive: source.timestamp > currentTimestamp,
|
inactive: source.timestamp > currentTimestamp,
|
||||||
selected: isSelected
|
selected: isSelected
|
||||||
@@ -23,11 +33,13 @@
|
|||||||
v-for="(surface, index) in sufacesAffectedBy(source)"
|
v-for="(surface, index) in sufacesAffectedBy(source)"
|
||||||
v-bind:key="surface.id"
|
v-bind:key="surface.id"
|
||||||
>
|
>
|
||||||
|
<!-- eslint-disable-next-line max-len -->
|
||||||
<span v-if="surface.name" class="surface-name">{{ surface.name }}</span>
|
<span v-if="surface.name" class="surface-name">{{ surface.name }}</span>
|
||||||
<span class="surface-id">
|
<span class="surface-id">
|
||||||
<!-- eslint-disable-next-line max-len -->
|
<!-- eslint-disable-next-line max-len -->
|
||||||
<span v-if="surface.name">(</span>{{surface.id}}<span v-if="surface.name">)</span>
|
<span v-if="surface.name">(</span>{{surface.id}}<span v-if="surface.name">)</span>
|
||||||
</span>
|
</span>
|
||||||
|
<!-- eslint-disable-next-line max-len -->
|
||||||
<span v-if="index + 1 < sufacesAffectedBy(source).length">, </span>
|
<span v-if="index + 1 < sufacesAffectedBy(source).length">, </span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,6 +54,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -170,6 +184,11 @@ export default {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.entry > div {
|
||||||
|
padding: 6px 10px;
|
||||||
|
border-bottom: 1px solid #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
.entry.selected {
|
.entry.selected {
|
||||||
background-color: #365179;
|
background-color: #365179;
|
||||||
color: white;
|
color: white;
|
||||||
@@ -183,11 +202,6 @@ export default {
|
|||||||
background: #f1f1f1;
|
background: #f1f1f1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry > div {
|
|
||||||
padding: 6px 10px;
|
|
||||||
border-bottom: 1px solid #f1f1f1;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
@@ -225,4 +239,31 @@ a {
|
|||||||
.inactive .light {
|
.inactive .light {
|
||||||
color: #b4b4b4
|
color: #b4b4b4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vsync {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vsync-dot:before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: -5px;
|
||||||
|
height: 10px;
|
||||||
|
width: 10px;
|
||||||
|
background-color: rgb(170, 65, 255);
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vsync-dot:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
height: 1px;
|
||||||
|
width: 100%;
|
||||||
|
background-color: rgb(170, 65, 255);
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -169,6 +169,10 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove vsync from being transaction types that can be filtered
|
||||||
|
// We want to always show vsyncs
|
||||||
|
transactionTypes.delete('vsyncEvent');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
transactionTypes: Array.from(transactionTypes),
|
transactionTypes: Array.from(transactionTypes),
|
||||||
properties: Array.from(properties),
|
properties: Array.from(properties),
|
||||||
@@ -197,6 +201,7 @@ export default {
|
|||||||
if (this.selectedTransactionTypes.length > 0) {
|
if (this.selectedTransactionTypes.length > 0) {
|
||||||
filteredData = filteredData.filter(
|
filteredData = filteredData.filter(
|
||||||
this.filterTransactions((transaction) =>
|
this.filterTransactions((transaction) =>
|
||||||
|
transaction.type === 'vsyncEvent' ||
|
||||||
this.selectedTransactionTypes.includes(transaction.type)));
|
this.selectedTransactionTypes.includes(transaction.type)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +252,10 @@ export default {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return filteredData;
|
// We quish vsyncs because otherwise the lazy list will not load enough
|
||||||
|
// elements if there are many vsyncs in a row since vsyncs take up no
|
||||||
|
// space.
|
||||||
|
return this.squishVSyncs(filteredData);
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -435,6 +443,14 @@ export default {
|
|||||||
const expandedId = expandTransactionId(transactionId);
|
const expandedId = expandTransactionId(transactionId);
|
||||||
return `${expandedId.pid}.${expandedId.id}`;
|
return `${expandedId.pid}.${expandedId.id}`;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
squishVSyncs(data) {
|
||||||
|
return data.filter((event, i) => {
|
||||||
|
console.log(event.type, data[i + 1]?.type);
|
||||||
|
return !(event.type === 'vsyncEvent' &&
|
||||||
|
data[i + 1]?.type === 'vsyncEvent');
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
'virtual-list': VirtualList,
|
'virtual-list': VirtualList,
|
||||||
@@ -501,4 +517,8 @@ export default {
|
|||||||
.no-properties span {
|
.no-properties span {
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.transaction-event {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user