1<!-- Copyright (C) 2020 The Android Open Source Project
2
3     Licensed under the Apache License, Version 2.0 (the "License");
4     you may not use this file except in compliance with the License.
5     You may obtain a copy of the License at
6
7          http://www.apache.org/licenses/LICENSE-2.0
8
9     Unless required by applicable law or agreed to in writing, software
10     distributed under the License is distributed on an "AS IS" BASIS,
11     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12     See the License for the specific language governing permissions and
13     limitations under the License.
14-->
15
16<template>
17  <TraceView
18    :store="store"
19    :file="file"
20    :summarizer="summarizer"
21    :presentTags="presentTags"
22    :presentErrors="presentErrors"
23  />
24</template>
25
26<script>
27import TraceView from '@/TraceView.vue';
28
29export default {
30  name: 'SurfaceFlingerTraceView',
31  props: ['store', 'file', 'presentTags', 'presentErrors'],
32  components: {
33    TraceView,
34  },
35  methods: {
36    summarizer(layer) {
37      const summary = [];
38
39      if (layer?.visibilityReason) {
40        summary.push({key: 'Invisible due to', value: layer.visibilityReason});
41      }
42
43      if (layer?.occludedBy?.length > 0) {
44        summary.push({key: 'Occluded by', value: layer.occludedBy.map(it => it.id).join(', ')});
45      }
46
47      if (layer?.partiallyOccludedBy?.length > 0) {
48        summary.push({
49          key: 'Partially occluded by',
50          value: layer.partiallyOccludedBy.map(it => it.id).join(', '),
51        });
52      }
53
54      if (layer?.coveredBy?.length > 0) {
55        summary.push({key: 'Covered by', value: layer.coveredBy.map(it => it.id).join(', ')});
56      }
57
58      return summary;
59    },
60  },
61};
62</script>
63