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 {ChangeDetectionStrategy, Component, Input} from '@angular/core'; 17import {TRACE_INFO} from 'app/trace_info'; 18import {PersistentStore} from 'common/persistent_store'; 19import {TraceType} from 'trace/trace_type'; 20import {UiData} from './ui_data'; 21 22@Component({ 23 selector: 'viewer-surface-flinger', 24 changeDetection: ChangeDetectionStrategy.OnPush, 25 template: ` 26 <div class="card-grid"> 27 <rects-view 28 class="rects-view" 29 title="Layers" 30 [rects]="inputData?.rects ?? []" 31 [highlightedItems]="inputData?.highlightedItems ?? []" 32 [displayIds]="inputData?.displayIds ?? []"></rects-view> 33 <mat-divider [vertical]="true"></mat-divider> 34 <hierarchy-view 35 class="hierarchy-view" 36 [tree]="inputData?.tree ?? null" 37 [dependencies]="inputData?.dependencies ?? []" 38 [highlightedItems]="inputData?.highlightedItems ?? []" 39 [pinnedItems]="inputData?.pinnedItems ?? []" 40 [store]="store" 41 [userOptions]="inputData?.hierarchyUserOptions ?? {}"></hierarchy-view> 42 <mat-divider [vertical]="true"></mat-divider> 43 <properties-view 44 class="properties-view" 45 [userOptions]="inputData?.propertiesUserOptions ?? {}" 46 [propertiesTree]="inputData?.propertiesTree ?? {}" 47 [selectedFlickerItem]="inputData?.selectedLayer ?? {}" 48 [displayPropertyGroups]="inputData?.displayPropertyGroups" 49 [isProtoDump]="true"></properties-view> 50 </div> 51 `, 52 styles: [ 53 ` 54 .rects-view, 55 .hierarchy-view, 56 .properties-view { 57 flex: 1; 58 padding: 16px; 59 display: flex; 60 flex-direction: column; 61 overflow: auto; 62 } 63 `, 64 ], 65}) 66export class ViewerSurfaceFlingerComponent { 67 @Input() inputData?: UiData; 68 @Input() store: PersistentStore = new PersistentStore(); 69 @Input() active = false; 70 TRACE_INFO = TRACE_INFO; 71 TraceType = TraceType; 72} 73