1/*
2 * Copyright (C) 2020 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 */
16
17syntax = "proto2";
18
19package perfetto.protos;
20
21message ChromeFrameReporter {
22  enum State {
23    // The frame did not have any updates to present.
24    STATE_NO_UPDATE_DESIRED = 0;
25
26    // The frame presented all the desired updates (i.e. any updates requested
27    // from both the compositor thread and main-threads were handled).
28    STATE_PRESENTED_ALL = 1;
29
30    // The frame was presented with some updates, but also missed some updates
31    // (e.g. missed updates from the main-thread, but included updates from the
32    // compositor thread).
33    STATE_PRESENTED_PARTIAL = 2;
34
35    // The frame was dropped, i.e. some updates were desired for the frame, but
36    // was not presented.
37    STATE_DROPPED = 3;
38  };
39
40  optional State state = 1;
41
42  enum FrameDropReason {
43    REASON_UNSPECIFIED = 0;
44
45    // Frame was dropped by the display-compositor.
46    // The display-compositor may drop a frame some times (e.g. the frame missed
47    // the deadline, or was blocked on surface-sync, etc.)
48    REASON_DISPLAY_COMPOSITOR = 1;
49
50    // Frame was dropped because of the main-thread.
51    // The main-thread may cause a frame to be dropped, e.g. if the main-thread
52    // is running expensive javascript, or doing a lot of layout updates, etc.
53    REASON_MAIN_THREAD = 2;
54
55    // Frame was dropped by the client compositor.
56    // The client compositor can drop some frames too (e.g. attempting to
57    // recover latency, missing the deadline, etc.).
58    REASON_CLIENT_COMPOSITOR = 3;
59  };
60
61  // The reason is set only if |state| is not |STATE_UPDATED_ALL|.
62  optional FrameDropReason reason = 2;
63
64  optional uint64 frame_source = 3;
65  optional uint64 frame_sequence = 4;
66
67  // If this is a droped frame (i.e. if |state| is set to |STATE_DROPPED| or
68  // |STATE_PRESENTED_PARTIAL|), then indicates whether this frame impacts
69  // smoothness.
70  optional bool affects_smoothness = 5;
71
72  enum ScrollState {
73    SCROLL_NONE = 0;
74    SCROLL_MAIN_THREAD = 1;
75    SCROLL_COMPOSITOR_THREAD = 2;
76
77    // Used when it can't be determined wheter a scroll is in progress or not.
78    SCROLL_UNKNOWN = 3;
79  }
80
81  // The type of active scroll
82  optional ScrollState scroll_state = 6;
83
84  // If any main thread animation is active during this frame.
85  optional bool has_main_animation = 7;
86  // If any compositor thread animation is active during this frame.
87  optional bool has_compositor_animation = 8;
88  // If any touch-driven UX (not scroll) is active during this frame.
89  optional bool has_smooth_input_main = 9;
90
91  // Whether the frame contained any missing content (i.e. whether there was
92  // checkerboarding in the frame).
93  optional bool has_missing_content = 10;
94
95  // The id of layer_tree_host that the frame has been produced for.
96  optional uint64 layer_tree_host_id = 11;
97}
98