28TEST(DisplayListAccumulationRect, TwoPoints) {
32 bool should_be_empty,
bool should_overlap,
33 const std::string& label) {
39 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
41 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
50 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
52 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
57 test(10.0f, 10.0f, 10.0f, 10.0f,
DlRect::MakeLTRB(10.0f, 10.0f, 10.0f, 10.0f),
59 test(10.0f, 10.0f, 20.0f, 10.0f,
DlRect::MakeLTRB(10.0f, 10.0f, 20.0f, 10.0f),
60 true,
false,
"Horizontal");
61 test(10.0f, 10.0f, 10.0f, 20.0f,
DlRect::MakeLTRB(10.0f, 10.0f, 10.0f, 20.0f),
62 true,
false,
"Vertical");
63 test(10.0f, 10.0f, 20.0f, 20.0f,
DlRect::MakeLTRB(10.0f, 10.0f, 20.0f, 20.0f),
64 false,
false,
"Diagonal");
67TEST(DisplayListAccumulationRect, ThreePoints) {
72 bool should_be_empty,
bool should_overlap,
73 const std::string& label) {
80 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
82 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
92 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
94 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
99 test(10.0f, 10.0f, 10.0f, 10.0f, 10.0f, 10.0f,
101 test(10.0f, 10.0f, 20.0f, 10.0f, 15.0f, 10.0f,
103 test(10.0f, 10.0f, 10.0f, 20.0f, 10.0f, 15.0f,
105 test(10.0f, 10.0f, 20.0f, 20.0f, 25.0f, 15.0f,
107 test(10.0f, 10.0f, 20.0f, 20.0f, 15.0f, 15.0f,
111TEST(DisplayListAccumulationRect, EmptyRect) {
114 bool should_be_empty,
bool should_overlap,
115 const std::string& label) {
120 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
122 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
130 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
132 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
140 EXPECT_EQ(
content.is_empty(), should_be_empty) << label;
141 EXPECT_EQ(
content.GetBounds().IsEmpty(), should_be_empty) << label;
145 if (!should_be_empty) {
146 EXPECT_EQ(
content.GetBounds(), bounds) << label;
148 EXPECT_EQ(
content.overlap_detected(), should_overlap) << label;
153 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
155 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
161 true,
false,
"Singular");
163 true,
false,
"Horizontal Empty");
165 true,
false,
"Vertical Empty");
166 test(10.0f, 10.0f, 20.0f, 20.0f,
DlRect::MakeLTRB(10.0f, 10.0f, 20.0f, 20.0f),
167 false,
false,
"Non-Empty");
170TEST(DisplayListAccumulationRect, TwoRects) {
174 bool should_be_empty,
bool should_overlap,
175 const std::string& label) {
181 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
183 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
200 EXPECT_EQ(accumulator.
is_empty(), should_be_empty) << label;
202 EXPECT_EQ(accumulator.
GetBounds(), bounds) << label;
207 test(10.0f, 10.0f, 10.0f, 10.0f,
208 20.0f, 20.0f, 20.0f, 20.0f,
210 true,
false,
"Empty + Empty");
211 test(10.0f, 10.0f, 20.0f, 10.0f,
212 10.0f, 10.0f, 10.0f, 20.0f,
214 true,
false,
"Horizontal + Vertical");
215 test(10.0f, 10.0f, 10.0f, 10.0f,
216 15.0f, 15.0f, 20.0f, 20.0f,
218 false,
false,
"Empty + Non-Empty");
219 test(10.0f, 10.0f, 15.0f, 15.0f,
220 20.0f, 20.0f, 20.0f, 20.0f,
222 false,
false,
"Non-Empty + Empty");
223 test(10.0f, 10.0f, 15.0f, 15.0f,
224 15.0f, 15.0f, 20.0f, 20.0f,
226 false,
false,
"Abutting");
227 test(10.0f, 10.0f, 15.0f, 15.0f,
228 16.0f, 16.0f, 20.0f, 20.0f,
230 false,
false,
"Disjoint");
231 test(10.0f, 10.0f, 16.0f, 16.0f,
232 15.0f, 15.0f, 20.0f, 20.0f,
234 false,
true,
"Overlapping");