diff --git a/tools/winscope/src/Overlay.vue b/tools/winscope/src/Overlay.vue index 35fbfe70e..d098dd4fd 100644 --- a/tools/winscope/src/Overlay.vue +++ b/tools/winscope/src/Overlay.vue @@ -111,12 +111,6 @@ icon="public" desc="Consider all timelines for navigation" /> - = 2 + && this.navigationStyle.split('-')[0] === NAVIGATION_STYLE.TARGETED + ) { return this.$store.state .traces[this.navigationStyle.split('-')[1]]; } @@ -481,7 +471,7 @@ export default { return this.timelineFiles.length > 1; }, flickerMode() { - return this.navigationStyle === NAVIGATION_STYLE.FLICKER; + return this.tags.length>0 || this.errors.length>0; }, }, updated() { @@ -633,10 +623,6 @@ export default { navigationStyleFilter = (f) => true; break; - case NAVIGATION_STYLE.FLICKER: - navigationStyleFilter = (f) => true; - break; - case NAVIGATION_STYLE.FOCUSED: navigationStyleFilter = (f) => f.type === this.focusedFile.type; @@ -661,6 +647,43 @@ export default { this.$store.commit('setNavigationFilesFilter', navigationStyleFilter); }, + updateFlickerMode(style) { + if (style === NAVIGATION_STYLE.GLOBAL || + style === NAVIGATION_STYLE.CUSTOM) { + this.tags = this.presentTags; + this.errors = this.presentErrors; + + } else if (style === NAVIGATION_STYLE.FOCUSED) { + if (this.focusedFile.timeline) { + this.tags = this.getTagTimelineComponents(this.presentTags, this.focusedFile); + this.errors = this.getTagTimelineComponents(this.presentErrors, this.focusedFile); + } + } else if ( + style.split('-').length >= 2 && + style.split('-')[0] === NAVIGATION_STYLE.TARGETED + ) { + const file = this.$store.state.traces[style.split('-')[1]]; + if (file.timeline) { + this.tags = this.getTagTimelineComponents(this.presentTags, file); + this.errors = this.getTagTimelineComponents(this.presentErrors, file); + } + //Unexpected navigation type or no timeline present in file + } else { + console.warn('Unexpected timeline or navigation type; no flicker mode available'); + this.tags = []; + this.errors = []; + } + }, + getTagTimelineComponents(items, file) { + if (file.type===FILE_TYPES.SURFACE_FLINGER_TRACE) { + return items.filter(item => item.layerId !== -1); + } + if (file.type===FILE_TYPES.WINDOW_MANAGER_TRACE) { + return items.filter(item => item.taskId !== -1); + } + // if focused file is not one supported by tags/errors + return []; + }, updateVideoOverlayWidth(width) { this.videoOverlayExtraWidth = width; }, diff --git a/tools/winscope/src/Searchbar.vue b/tools/winscope/src/Searchbar.vue index 9178a5873..1f5fa4e64 100644 --- a/tools/winscope/src/Searchbar.vue +++ b/tools/winscope/src/Searchbar.vue @@ -30,8 +30,8 @@