5#include "flutter/lib/ui/window/viewport_metrics.h"
7#include "flutter/fml/logging.h"
14 double p_physical_width,
15 double p_physical_height,
16 double p_physical_touch_slop,
18 : device_pixel_ratio(p_device_pixel_ratio),
19 physical_width(p_physical_width),
20 physical_height(p_physical_height),
21 physical_touch_slop(p_physical_touch_slop),
22 display_id(p_display_id) {}
25 double p_device_pixel_ratio,
26 double p_physical_width,
27 double p_physical_height,
28 double p_physical_padding_top,
29 double p_physical_padding_right,
30 double p_physical_padding_bottom,
31 double p_physical_padding_left,
32 double p_physical_view_inset_top,
33 double p_physical_view_inset_right,
34 double p_physical_view_inset_bottom,
35 double p_physical_view_inset_left,
36 double p_physical_system_gesture_inset_top,
37 double p_physical_system_gesture_inset_right,
38 double p_physical_system_gesture_inset_bottom,
39 double p_physical_system_gesture_inset_left,
40 double p_physical_touch_slop,
41 const std::vector<double>& p_physical_display_features_bounds,
42 const std::vector<int>& p_physical_display_features_type,
43 const std::vector<int>& p_physical_display_features_state,
45 : device_pixel_ratio(p_device_pixel_ratio),
46 physical_width(p_physical_width),
47 physical_height(p_physical_height),
48 physical_padding_top(p_physical_padding_top),
49 physical_padding_right(p_physical_padding_right),
50 physical_padding_bottom(p_physical_padding_bottom),
51 physical_padding_left(p_physical_padding_left),
52 physical_view_inset_top(p_physical_view_inset_top),
53 physical_view_inset_right(p_physical_view_inset_right),
54 physical_view_inset_bottom(p_physical_view_inset_bottom),
55 physical_view_inset_left(p_physical_view_inset_left),
56 physical_system_gesture_inset_top(p_physical_system_gesture_inset_top),
57 physical_system_gesture_inset_right(
58 p_physical_system_gesture_inset_right),
59 physical_system_gesture_inset_bottom(
60 p_physical_system_gesture_inset_bottom),
61 physical_system_gesture_inset_left(p_physical_system_gesture_inset_left),
62 physical_touch_slop(p_physical_touch_slop),
63 physical_display_features_bounds(p_physical_display_features_bounds),
64 physical_display_features_type(p_physical_display_features_type),
65 physical_display_features_state(p_physical_display_features_state),
66 display_id(p_display_id) {}
69 return a.device_pixel_ratio ==
b.device_pixel_ratio &&
70 a.physical_width ==
b.physical_width &&
71 a.physical_height ==
b.physical_height &&
72 a.physical_padding_top ==
b.physical_padding_top &&
73 a.physical_padding_right ==
b.physical_padding_right &&
74 a.physical_padding_bottom ==
b.physical_padding_bottom &&
75 a.physical_padding_left ==
b.physical_padding_left &&
76 a.physical_view_inset_top ==
b.physical_view_inset_top &&
77 a.physical_view_inset_right ==
b.physical_view_inset_right &&
78 a.physical_view_inset_bottom ==
b.physical_view_inset_bottom &&
79 a.physical_view_inset_left ==
b.physical_view_inset_left &&
80 a.physical_system_gesture_inset_top ==
81 b.physical_system_gesture_inset_top &&
82 a.physical_system_gesture_inset_right ==
83 b.physical_system_gesture_inset_right &&
84 a.physical_system_gesture_inset_bottom ==
85 b.physical_system_gesture_inset_bottom &&
86 a.physical_system_gesture_inset_left ==
87 b.physical_system_gesture_inset_left &&
88 a.physical_touch_slop ==
b.physical_touch_slop &&
89 a.physical_display_features_bounds ==
90 b.physical_display_features_bounds &&
91 a.physical_display_features_type ==
b.physical_display_features_type &&
92 a.physical_display_features_state ==
93 b.physical_display_features_state &&
94 a.display_id ==
b.display_id;
98 os <<
"DPR: " <<
a.device_pixel_ratio <<
" " <<
"Size: [" <<
a.physical_width
99 <<
"W " <<
a.physical_height <<
"H] " <<
"Padding: ["
100 <<
a.physical_padding_top <<
"T " <<
a.physical_padding_right <<
"R "
101 <<
a.physical_padding_bottom <<
"B " <<
a.physical_padding_left <<
"L] "
102 <<
"Insets: [" <<
a.physical_view_inset_top <<
"T "
103 <<
a.physical_view_inset_right <<
"R " <<
a.physical_view_inset_bottom
104 <<
"B " <<
a.physical_view_inset_left <<
"L] " <<
"Gesture Insets: ["
105 <<
a.physical_system_gesture_inset_top <<
"T "
106 <<
a.physical_system_gesture_inset_right <<
"R "
107 <<
a.physical_system_gesture_inset_bottom <<
"B "
108 <<
a.physical_system_gesture_inset_left <<
"L] "
109 <<
"Display Features: " <<
a.physical_display_features_type.size() <<
" "
110 <<
"Display ID: " <<
a.display_id;
std::ostream & operator<<(std::ostream &os, const ViewportMetrics &a)
bool operator==(const ViewportMetrics &a, const ViewportMetrics &b)