Lines Matching full:rect
44 r.Union(gfx::Rect(35, 35, 1, 1));
51 r.Union(gfx::Rect(30, 30, 10, 10));
58 r.Union(gfx::Rect(31, 40, 10, 10));
73 r.Union(gfx::Rect(42, 40, 10, 10));
93 r.Union(gfx::Rect(5, 0, 10, 10));
94 r.Union(gfx::Rect(0, 5, 10, 10));
95 r.Subtract(gfx::Rect(7, 7, 10, 0));
98 EXPECT_FALSE(it.rect().IsEmpty());
122 TEST_NO_INTERSECT(gfx::Rect(), gfx::Rect());
123 TEST_NO_INTERSECT(gfx::Rect(), gfx::Rect(0, 0, 1, 1));
124 TEST_NO_INTERSECT(gfx::Rect(), gfx::Rect(1, 1, 1, 1));
126 TEST_NO_INTERSECT(gfx::Rect(-1, -1, 2, 2), gfx::Rect());
128 r.Union(gfx::Rect(0, 0, 1, 1));
129 TEST_NO_INTERSECT(r, gfx::Rect());
130 TEST_INTERSECT(r, gfx::Rect(0, 0, 1, 1));
131 TEST_INTERSECT(r, gfx::Rect(0, 0, 2, 2));
132 TEST_INTERSECT(r, gfx::Rect(-1, 0, 2, 2));
133 TEST_INTERSECT(r, gfx::Rect(-1, -1, 2, 2));
134 TEST_INTERSECT(r, gfx::Rect(0, -1, 2, 2));
135 TEST_INTERSECT(r, gfx::Rect(-1, -1, 3, 3));
137 r.Union(gfx::Rect(0, 0, 3, 3));
138 r.Union(gfx::Rect(10, 0, 3, 3));
139 r.Union(gfx::Rect(0, 10, 13, 3));
140 TEST_NO_INTERSECT(r, gfx::Rect());
141 TEST_INTERSECT(r, gfx::Rect(1, 1, 1, 1));
142 TEST_INTERSECT(r, gfx::Rect(0, 0, 2, 2));
143 TEST_INTERSECT(r, gfx::Rect(1, 0, 2, 2));
144 TEST_INTERSECT(r, gfx::Rect(1, 1, 2, 2));
145 TEST_INTERSECT(r, gfx::Rect(0, 1, 2, 2));
146 TEST_INTERSECT(r, gfx::Rect(0, 0, 3, 3));
147 TEST_INTERSECT(r, gfx::Rect(-1, -1, 2, 2));
148 TEST_INTERSECT(r, gfx::Rect(2, -1, 2, 2));
149 TEST_INTERSECT(r, gfx::Rect(2, 2, 2, 2));
150 TEST_INTERSECT(r, gfx::Rect(-1, 2, 2, 2));
152 TEST_INTERSECT(r, gfx::Rect(11, 1, 1, 1));
153 TEST_INTERSECT(r, gfx::Rect(10, 0, 2, 2));
154 TEST_INTERSECT(r, gfx::Rect(11, 0, 2, 2));
155 TEST_INTERSECT(r, gfx::Rect(11, 1, 2, 2));
156 TEST_INTERSECT(r, gfx::Rect(10, 1, 2, 2));
157 TEST_INTERSECT(r, gfx::Rect(10, 0, 3, 3));
158 TEST_INTERSECT(r, gfx::Rect(9, -1, 2, 2));
159 TEST_INTERSECT(r, gfx::Rect(12, -1, 2, 2));
160 TEST_INTERSECT(r, gfx::Rect(12, 2, 2, 2));
161 TEST_INTERSECT(r, gfx::Rect(9, 2, 2, 2));
163 TEST_INTERSECT(r, gfx::Rect(0, -1, 13, 5));
164 TEST_INTERSECT(r, gfx::Rect(1, -1, 11, 5));
165 TEST_INTERSECT(r, gfx::Rect(2, -1, 9, 5));
166 TEST_INTERSECT(r, gfx::Rect(2, -1, 8, 5));
167 TEST_INTERSECT(r, gfx::Rect(3, -1, 8, 5));
168 TEST_NO_INTERSECT(r, gfx::Rect(3, -1, 7, 5));
170 TEST_INTERSECT(r, gfx::Rect(0, 1, 13, 1));
171 TEST_INTERSECT(r, gfx::Rect(1, 1, 11, 1));
172 TEST_INTERSECT(r, gfx::Rect(2, 1, 9, 1));
173 TEST_INTERSECT(r, gfx::Rect(2, 1, 8, 1));
174 TEST_INTERSECT(r, gfx::Rect(3, 1, 8, 1));
175 TEST_NO_INTERSECT(r, gfx::Rect(3, 1, 7, 1));
177 TEST_INTERSECT(r, gfx::Rect(0, 0, 13, 13));
178 TEST_INTERSECT(r, gfx::Rect(0, 1, 13, 11));
179 TEST_INTERSECT(r, gfx::Rect(0, 2, 13, 9));
180 TEST_INTERSECT(r, gfx::Rect(0, 2, 13, 8));
181 TEST_INTERSECT(r, gfx::Rect(0, 3, 13, 8));
182 TEST_NO_INTERSECT(r, gfx::Rect(0, 3, 13, 7));
189 r.Union(gfx::Rect(400, 300, 1, 800));
190 r.Union(gfx::Rect(785, 585, 1, 1));
191 r.Union(gfx::Rect(787, 585, 1, 1));
192 r.Union(gfx::Rect(0, 587, 16, 162));
193 r.Union(gfx::Rect(26, 590, 300, 150));
194 r.Union(gfx::Rect(196, 750, 1, 1));
195 r.Union(gfx::Rect(0, 766, 1, 1));
196 r.Union(gfx::Rect(0, 782, 1, 1));
197 r.Union(gfx::Rect(745, 798, 1, 1));
198 r.Union(gfx::Rect(795, 882, 10, 585));
199 r.Union(gfx::Rect(100, 1499, 586, 1));
200 r.Union(gfx::Rect(100, 1500, 585, 784));
201 // This query rect goes past the bottom of the Region, causing the
204 TEST_NO_INTERSECT(r, gfx::Rect(0, 2184, 1, 150));
224 TEST_CONTAINS(gfx::Rect(), gfx::Rect());
225 TEST_CONTAINS(gfx::Rect(0, 0, 1, 1), gfx::Rect());
226 TEST_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect());
228 TEST_NO_CONTAINS(gfx::Rect(), gfx::Rect(0, 0, 1, 1));
229 TEST_NO_CONTAINS(gfx::Rect(), gfx::Rect(1, 1, 1, 1));
231 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(11, 10, 1, 1));
232 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(10, 11, 1, 1));
233 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(9, 10, 1, 1));
234 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(10, 9, 1, 1));
235 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(9, 9, 2, 2));
236 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(10, 9, 2, 2));
237 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(9, 10, 2, 2));
238 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(10, 10, 2, 2));
239 TEST_NO_CONTAINS(gfx::Rect(10, 10, 1, 1), gfx::Rect(9, 9, 3, 3));
243 h_lines.Union(gfx::Rect(i, 10, 1, 10));
245 TEST_CONTAINS(gfx::Rect(10, 10, 9, 10), h_lines);
246 TEST_NO_CONTAINS(gfx::Rect(10, 10, 9, 9), h_lines);
247 TEST_NO_CONTAINS(gfx::Rect(10, 11, 9, 9), h_lines);
248 TEST_NO_CONTAINS(gfx::Rect(10, 10, 8, 10), h_lines);
249 TEST_NO_CONTAINS(gfx::Rect(11, 10, 8, 10), h_lines);
253 v_lines.Union(gfx::Rect(10, i, 10, 1));
255 TEST_CONTAINS(gfx::Rect(10, 10, 10, 9), v_lines);
256 TEST_NO_CONTAINS(gfx::Rect(10, 10, 9, 9), v_lines);
257 TEST_NO_CONTAINS(gfx::Rect(11, 10, 9, 9), v_lines);
258 TEST_NO_CONTAINS(gfx::Rect(10, 10, 10, 8), v_lines);
259 TEST_NO_CONTAINS(gfx::Rect(10, 11, 10, 8), v_lines);
264 grid.Union(gfx::Rect(i, j, 1, 1));
266 TEST_CONTAINS(gfx::Rect(10, 10, 9, 9), grid);
267 TEST_NO_CONTAINS(gfx::Rect(10, 10, 9, 8), grid);
268 TEST_NO_CONTAINS(gfx::Rect(10, 11, 9, 8), grid);
269 TEST_NO_CONTAINS(gfx::Rect(10, 10, 8, 9), grid);
270 TEST_NO_CONTAINS(gfx::Rect(11, 10, 8, 9), grid);
283 TEST_CONTAINS(h_lines, gfx::Rect(i, 10, 1, 10));
286 TEST_CONTAINS(v_lines, gfx::Rect(10, i, 10, 1));
290 TEST_CONTAINS(grid, gfx::Rect(i, j, 1, 1));
293 container.Union(gfx::Rect(0, 0, 40, 20));
294 container.Union(gfx::Rect(0, 20, 41, 20));
295 TEST_CONTAINS(container, gfx::Rect(5, 5, 30, 30));
298 container.Union(gfx::Rect(0, 0, 10, 10));
299 container.Union(gfx::Rect(0, 30, 10, 10));
300 container.Union(gfx::Rect(30, 30, 10, 10));
301 container.Union(gfx::Rect(30, 0, 10, 10));
302 TEST_NO_CONTAINS(container, gfx::Rect(5, 5, 30, 30));
305 container.Union(gfx::Rect(0, 0, 10, 10));
306 container.Union(gfx::Rect(0, 30, 10, 10));
307 container.Union(gfx::Rect(30, 0, 10, 40));
308 TEST_NO_CONTAINS(container, gfx::Rect(5, 5, 30, 30));
311 container.Union(gfx::Rect(30, 0, 10, 10));
312 container.Union(gfx::Rect(30, 30, 10, 10));
313 container.Union(gfx::Rect(0, 0, 10, 40));
314 TEST_NO_CONTAINS(container, gfx::Rect(5, 5, 30, 30));
317 container.Union(gfx::Rect(0, 0, 10, 40));
318 container.Union(gfx::Rect(30, 0, 10, 40));
319 TEST_NO_CONTAINS(container, gfx::Rect(5, 5, 30, 30));
322 container.Union(gfx::Rect(0, 0, 40, 40));
323 TEST_NO_CONTAINS(container, gfx::Rect(10, -1, 20, 10));
326 container.Union(gfx::Rect(0, 0, 40, 40));
327 TEST_NO_CONTAINS(container, gfx::Rect(10, 31, 20, 10));
330 container.Union(gfx::Rect(0, 0, 40, 20));
331 container.Union(gfx::Rect(0, 20, 41, 20));
332 TEST_NO_CONTAINS(container, gfx::Rect(-1, 10, 10, 20));
335 container.Union(gfx::Rect(0, 0, 40, 20));
336 container.Union(gfx::Rect(0, 20, 41, 20));
337 TEST_NO_CONTAINS(container, gfx::Rect(31, 10, 10, 20));
340 container.Union(gfx::Rect(0, 0, 40, 40));
341 container.Subtract(gfx::Rect(0, 20, 60, 0));
342 TEST_NO_CONTAINS(container, gfx::Rect(31, 10, 10, 20));
345 container.Union(gfx::Rect(0, 0, 60, 20));
346 container.Union(gfx::Rect(30, 20, 10, 20));
347 TEST_NO_CONTAINS(container, gfx::Rect(0, 0, 10, 39));
348 TEST_NO_CONTAINS(container, gfx::Rect(0, 0, 10, 40));
349 TEST_NO_CONTAINS(container, gfx::Rect(0, 0, 10, 41));
350 TEST_NO_CONTAINS(container, gfx::Rect(29, 0, 10, 39));
351 TEST_CONTAINS(container, gfx::Rect(30, 0, 10, 40));
352 TEST_NO_CONTAINS(container, gfx::Rect(31, 0, 10, 41));
353 TEST_NO_CONTAINS(container, gfx::Rect(49, 0, 10, 39));
354 TEST_NO_CONTAINS(container, gfx::Rect(50, 0, 10, 40));
355 TEST_NO_CONTAINS(container, gfx::Rect(51, 0, 10, 41));
358 container.Union(gfx::Rect(30, 0, 10, 20));
359 container.Union(gfx::Rect(0, 20, 60, 20));
360 TEST_NO_CONTAINS(container, gfx::Rect(0, 0, 10, 39));
361 TEST_NO_CONTAINS(container, gfx::Rect(0, 0, 10, 40));
362 TEST_NO_CONTAINS(container, gfx::Rect(0, 0, 10, 41));
363 TEST_NO_CONTAINS(container, gfx::Rect(29, 0, 10, 39));
364 TEST_CONTAINS(container, gfx::Rect(30, 0, 10, 40));
365 TEST_NO_CONTAINS(container, gfx::Rect(31, 0, 10, 41));
366 TEST_NO_CONTAINS(container, gfx::Rect(49, 0, 10, 39));
367 TEST_NO_CONTAINS(container, gfx::Rect(50, 0, 10, 40));
368 TEST_NO_CONTAINS(container, gfx::Rect(51, 0, 10, 41));
375 // A rect uniting a contained rect does not change the region.
376 r2 = r = gfx::Rect(0, 0, 50, 50);
377 r2.Union(gfx::Rect(20, 20, 10, 10));
380 // A rect uniting a containing rect gives back the containing rect.
381 r = gfx::Rect(0, 0, 50, 50);
382 r.Union(gfx::Rect(0, 0, 100, 100));
383 EXPECT_EQ(Region(gfx::Rect(0, 0, 100, 100)), r);
385 // A complex region uniting a contained rect does not change the region.
386 r = gfx::Rect(0, 0, 50, 50);
387 r.Union(gfx::Rect(100, 0, 50, 50));
389 r2.Union(gfx::Rect(20, 20, 10, 10));
392 // A complex region uniting a containing rect gives back the containing rect.
393 r = gfx::Rect(0, 0, 50, 50);
394 r.Union(gfx::Rect(100, 0, 50, 50));
395 r.Union(gfx::Rect(0, 0, 500, 500));
396 EXPECT_EQ(Region(gfx::Rect(0, 0, 500, 500)), r);
401 EXPECT_TRUE(Region(gfx::Rect()).IsEmpty());
403 EXPECT_TRUE(Region(gfx::Rect(10, 10, 10, 0)).IsEmpty());
404 EXPECT_TRUE(Region(gfx::Rect(10, 10, 0, 10)).IsEmpty());
405 EXPECT_TRUE(Region(gfx::Rect(-10, 10, 10, 0)).IsEmpty());
406 EXPECT_TRUE(Region(gfx::Rect(-10, 10, 0, 10)).IsEmpty());
407 EXPECT_FALSE(Region(gfx::Rect(-1, -1, 1, 1)).IsEmpty());
408 EXPECT_FALSE(Region(gfx::Rect(0, 0, 1, 1)).IsEmpty());
409 EXPECT_FALSE(Region(gfx::Rect(0, 0, 2, 2)).IsEmpty());
423 r = gfx::Rect(0, 0, 50, 50);
428 r = gfx::Rect(0, 0, 50, 50);
429 r.Union(gfx::Rect(100, 0, 50, 50));
430 r.Union(gfx::Rect(0, 0, 500, 500));
439 r1 = gfx::Rect(0, 0, 50, 50);
442 EXPECT_EQ(r2.ToString(), Region(gfx::Rect(0, 0, 50, 50)).ToString());
444 r1 = gfx::Rect(0, 0, 50, 50);
445 r1.Union(gfx::Rect(100, 0, 50, 50));
446 r1.Union(gfx::Rect(0, 0, 500, 500));
449 EXPECT_EQ(r1.ToString(), Region(gfx::Rect(0, 0, 50, 50)).ToString());