1/* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16import {PropertiesTreeNode} from 'viewers/common/ui_tree_utils'; 17 18class UiData { 19 constructor( 20 public allVSyncIds: string[], 21 public allPids: string[], 22 public allUids: string[], 23 public allTypes: string[], 24 public allLayerAndDisplayIds: string[], 25 public allTransactionIds: string[], 26 public entries: UiDataEntry[], 27 public currentEntryIndex: undefined | number, 28 public selectedEntryIndex: undefined | number, 29 public scrollToIndex: undefined | number, 30 public currentPropertiesTree: undefined | PropertiesTreeNode 31 ) {} 32 33 static EMPTY = new UiData([], [], [], [], [], [], [], undefined, undefined, undefined, undefined); 34} 35 36class UiDataEntry { 37 constructor( 38 public originalIndexInTraceEntry: number, 39 public time: string, 40 public vsyncId: number, 41 public pid: string, 42 public uid: string, 43 public type: string, 44 public layerOrDisplayId: string, 45 public transactionId: string, 46 public what: string, 47 public propertiesTree?: PropertiesTreeNode 48 ) {} 49} 50 51class UiDataEntryType { 52 static DISPLAY_ADDED = 'DISPLAY_ADDED'; 53 static DISPLAY_REMOVED = 'DISPLAY_REMOVED'; 54 static DISPLAY_CHANGED = 'DISPLAY_CHANGED'; 55 static LAYER_ADDED = 'LAYER_ADDED'; 56 static LAYER_DESTROYED = 'LAYER_DESTROYED'; 57 static LAYER_CHANGED = 'LAYER_CHANGED'; 58 static LAYER_HANDLE_DESTROYED = 'LAYER_HANDLE_DESTROYED'; 59 static NO_OP = 'NO_OP'; 60} 61 62export {UiData, UiDataEntry, UiDataEntryType}; 63