OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
8 #include "cc/surfaces/surface.h" | 8 #include "cc/surfaces/surface.h" |
9 #include "cc/surfaces/surface_factory.h" | 9 #include "cc/surfaces/surface_factory.h" |
10 #include "cc/surfaces/surface_factory_client.h" | 10 #include "cc/surfaces/surface_factory_client.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 CreateSurfaceDrawQuad(root_pass, | 79 CreateSurfaceDrawQuad(root_pass, |
80 gfx::Transform(), | 80 gfx::Transform(), |
81 root_rect, | 81 root_rect, |
82 child_rect, | 82 child_rect, |
83 child_surface_id); | 83 child_surface_id); |
84 | 84 |
85 // Submit the root frame. | 85 // Submit the root frame. |
86 SurfaceIdAllocator root_allocator; | 86 SurfaceIdAllocator root_allocator; |
87 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); | 87 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); |
88 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); | 88 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); |
89 root_factory.Create(root_local_frame_id); | |
90 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), | 89 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), |
91 SurfaceFactory::DrawCallback()); | 90 SurfaceFactory::DrawCallback()); |
92 | 91 |
93 { | 92 { |
94 SurfaceHittest hittest(nullptr, &manager); | 93 SurfaceHittest hittest(nullptr, &manager); |
95 // It is expected this test will complete without crashes. | 94 // It is expected this test will complete without crashes. |
96 gfx::Transform transform; | 95 gfx::Transform transform; |
97 EXPECT_EQ(root_surface_id, | 96 EXPECT_EQ(root_surface_id, |
98 hittest.GetTargetSurfaceAtPoint( | 97 hittest.GetTargetSurfaceAtPoint( |
99 root_surface_id, gfx::Point(100, 100), &transform)); | 98 root_surface_id, gfx::Point(100, 100), &transform)); |
100 } | 99 } |
101 | |
102 root_factory.Destroy(root_local_frame_id); | |
103 } | 100 } |
104 | 101 |
105 TEST(SurfaceHittestTest, Hittest_SingleSurface) { | 102 TEST(SurfaceHittestTest, Hittest_SingleSurface) { |
106 SurfaceManager manager; | 103 SurfaceManager manager; |
107 | 104 |
108 // Set up root FrameSink. | 105 // Set up root FrameSink. |
109 EmptySurfaceFactoryClient root_client; | 106 EmptySurfaceFactoryClient root_client; |
110 FrameSinkId root_frame_sink_id(1, 1); | 107 FrameSinkId root_frame_sink_id(1, 1); |
111 SurfaceFactory root_factory(root_frame_sink_id, &manager, &root_client); | 108 SurfaceFactory root_factory(root_frame_sink_id, &manager, &root_client); |
112 | 109 |
113 // Creates a root surface. | 110 // Creates a root surface. |
114 gfx::Rect root_rect(300, 300); | 111 gfx::Rect root_rect(300, 300); |
115 RenderPass* root_pass = nullptr; | 112 RenderPass* root_pass = nullptr; |
116 CompositorFrame root_frame = CreateCompositorFrame(root_rect, &root_pass); | 113 CompositorFrame root_frame = CreateCompositorFrame(root_rect, &root_pass); |
117 | 114 |
118 // Submit the root frame. | 115 // Submit the root frame. |
119 SurfaceIdAllocator root_allocator; | 116 SurfaceIdAllocator root_allocator; |
120 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); | 117 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); |
121 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); | 118 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); |
122 root_factory.Create(root_local_frame_id); | |
123 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), | 119 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), |
124 SurfaceFactory::DrawCallback()); | 120 SurfaceFactory::DrawCallback()); |
125 TestCase tests[] = { | 121 TestCase tests[] = { |
126 { | 122 { |
127 root_surface_id, | 123 root_surface_id, |
128 gfx::Point(100, 100), | 124 gfx::Point(100, 100), |
129 root_surface_id, | 125 root_surface_id, |
130 gfx::Point(100, 100) | 126 gfx::Point(100, 100) |
131 }, | 127 }, |
132 }; | 128 }; |
133 | 129 |
134 RunTests(nullptr, &manager, tests, arraysize(tests)); | 130 RunTests(nullptr, &manager, tests, arraysize(tests)); |
135 | |
136 root_factory.Destroy(root_local_frame_id); | |
137 } | 131 } |
138 | 132 |
139 TEST(SurfaceHittestTest, Hittest_ChildSurface) { | 133 TEST(SurfaceHittestTest, Hittest_ChildSurface) { |
140 SurfaceManager manager; | 134 SurfaceManager manager; |
141 | 135 |
142 // Set up root FrameSink. | 136 // Set up root FrameSink. |
143 EmptySurfaceFactoryClient root_client; | 137 EmptySurfaceFactoryClient root_client; |
144 FrameSinkId root_frame_sink_id(1, 1); | 138 FrameSinkId root_frame_sink_id(1, 1); |
145 SurfaceFactory root_factory(root_frame_sink_id, &manager, &root_client); | 139 SurfaceFactory root_factory(root_frame_sink_id, &manager, &root_client); |
146 | 140 |
(...skipping 18 matching lines...) Expand all Loading... |
165 0.0f, 0.0f, 1.0f, 0.0f, | 159 0.0f, 0.0f, 1.0f, 0.0f, |
166 0.0f, 0.0f, 0.0f, 1.0f), | 160 0.0f, 0.0f, 0.0f, 1.0f), |
167 root_rect, | 161 root_rect, |
168 child_rect, | 162 child_rect, |
169 child_surface_id); | 163 child_surface_id); |
170 | 164 |
171 // Submit the root frame. | 165 // Submit the root frame. |
172 SurfaceIdAllocator root_allocator; | 166 SurfaceIdAllocator root_allocator; |
173 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); | 167 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); |
174 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); | 168 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); |
175 root_factory.Create(root_local_frame_id); | |
176 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), | 169 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), |
177 SurfaceFactory::DrawCallback()); | 170 SurfaceFactory::DrawCallback()); |
178 | 171 |
179 // Creates a child surface. | 172 // Creates a child surface. |
180 RenderPass* child_pass = nullptr; | 173 RenderPass* child_pass = nullptr; |
181 CompositorFrame child_frame = CreateCompositorFrame(child_rect, &child_pass); | 174 CompositorFrame child_frame = CreateCompositorFrame(child_rect, &child_pass); |
182 | 175 |
183 // Add a solid quad in the child surface. | 176 // Add a solid quad in the child surface. |
184 gfx::Rect child_solid_quad_rect(100, 100); | 177 gfx::Rect child_solid_quad_rect(100, 100); |
185 CreateSolidColorDrawQuad( | 178 CreateSolidColorDrawQuad( |
186 child_pass, | 179 child_pass, |
187 gfx::Transform(1.0f, 0.0f, 0.0f, 50.0f, | 180 gfx::Transform(1.0f, 0.0f, 0.0f, 50.0f, |
188 0.0f, 1.0f, 0.0f, 50.0f, | 181 0.0f, 1.0f, 0.0f, 50.0f, |
189 0.0f, 0.0f, 1.0f, 0.0f, | 182 0.0f, 0.0f, 1.0f, 0.0f, |
190 0.0f, 0.0f, 0.0f, 1.0f), | 183 0.0f, 0.0f, 0.0f, 1.0f), |
191 root_rect, child_solid_quad_rect); | 184 root_rect, child_solid_quad_rect); |
192 | 185 |
193 // Submit the frame. | 186 // Submit the frame. |
194 child_factory.Create(child_local_frame_id); | |
195 child_factory.SubmitCompositorFrame(child_local_frame_id, | 187 child_factory.SubmitCompositorFrame(child_local_frame_id, |
196 std::move(child_frame), | 188 std::move(child_frame), |
197 SurfaceFactory::DrawCallback()); | 189 SurfaceFactory::DrawCallback()); |
198 | 190 |
199 TestCase tests[] = { | 191 TestCase tests[] = { |
200 { | 192 { |
201 root_surface_id, | 193 root_surface_id, |
202 gfx::Point(10, 10), | 194 gfx::Point(10, 10), |
203 root_surface_id, | 195 root_surface_id, |
204 gfx::Point(10, 10) | 196 gfx::Point(10, 10) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 EXPECT_EQ(gfx::Point(100, 100), point); | 256 EXPECT_EQ(gfx::Point(100, 100), point); |
265 | 257 |
266 gfx::Point point_in_target_space(100, 100); | 258 gfx::Point point_in_target_space(100, 100); |
267 gfx::Transform target_transform; | 259 gfx::Transform target_transform; |
268 EXPECT_TRUE(hittest.GetTransformToTargetSurface( | 260 EXPECT_TRUE(hittest.GetTransformToTargetSurface( |
269 root_surface_id, child_surface_id, &target_transform)); | 261 root_surface_id, child_surface_id, &target_transform)); |
270 target_transform.TransformPoint(&point_in_target_space); | 262 target_transform.TransformPoint(&point_in_target_space); |
271 EXPECT_NE(transform, target_transform); | 263 EXPECT_NE(transform, target_transform); |
272 EXPECT_EQ(gfx::Point(25, 25), point_in_target_space); | 264 EXPECT_EQ(gfx::Point(25, 25), point_in_target_space); |
273 } | 265 } |
274 | |
275 root_factory.Destroy(root_local_frame_id); | |
276 child_factory.Destroy(child_local_frame_id); | |
277 } | 266 } |
278 | 267 |
279 // This test verifies that hit testing will progress to the next quad if it | 268 // This test verifies that hit testing will progress to the next quad if it |
280 // encounters an invalid RenderPassDrawQuad for whatever reason. | 269 // encounters an invalid RenderPassDrawQuad for whatever reason. |
281 TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) { | 270 TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) { |
282 SurfaceManager manager; | 271 SurfaceManager manager; |
283 | 272 |
284 // Set up root FrameSink. | 273 // Set up root FrameSink. |
285 EmptySurfaceFactoryClient root_client; | 274 EmptySurfaceFactoryClient root_client; |
286 FrameSinkId root_frame_sink_id(1, 1); | 275 FrameSinkId root_frame_sink_id(1, 1); |
(...skipping 27 matching lines...) Expand all Loading... |
314 0.0f, 0.0f, 1.0f, 0.0f, | 303 0.0f, 0.0f, 1.0f, 0.0f, |
315 0.0f, 0.0f, 0.0f, 1.0f), | 304 0.0f, 0.0f, 0.0f, 1.0f), |
316 root_rect, | 305 root_rect, |
317 child_rect, | 306 child_rect, |
318 child_surface_id); | 307 child_surface_id); |
319 | 308 |
320 // Submit the root frame. | 309 // Submit the root frame. |
321 SurfaceIdAllocator root_allocator; | 310 SurfaceIdAllocator root_allocator; |
322 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); | 311 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); |
323 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); | 312 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); |
324 root_factory.Create(root_local_frame_id); | |
325 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), | 313 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), |
326 SurfaceFactory::DrawCallback()); | 314 SurfaceFactory::DrawCallback()); |
327 | 315 |
328 // Creates a child surface. | 316 // Creates a child surface. |
329 RenderPass* child_pass = nullptr; | 317 RenderPass* child_pass = nullptr; |
330 CompositorFrame child_frame = CreateCompositorFrame(child_rect, &child_pass); | 318 CompositorFrame child_frame = CreateCompositorFrame(child_rect, &child_pass); |
331 | 319 |
332 // Add a solid quad in the child surface. | 320 // Add a solid quad in the child surface. |
333 gfx::Rect child_solid_quad_rect(100, 100); | 321 gfx::Rect child_solid_quad_rect(100, 100); |
334 CreateSolidColorDrawQuad(child_pass, | 322 CreateSolidColorDrawQuad(child_pass, |
335 gfx::Transform(1.0f, 0.0f, 0.0f, 50.0f, | 323 gfx::Transform(1.0f, 0.0f, 0.0f, 50.0f, |
336 0.0f, 1.0f, 0.0f, 50.0f, | 324 0.0f, 1.0f, 0.0f, 50.0f, |
337 0.0f, 0.0f, 1.0f, 0.0f, | 325 0.0f, 0.0f, 1.0f, 0.0f, |
338 0.0f, 0.0f, 0.0f, 1.0f), | 326 0.0f, 0.0f, 0.0f, 1.0f), |
339 root_rect, | 327 root_rect, |
340 child_solid_quad_rect); | 328 child_solid_quad_rect); |
341 | 329 |
342 // Submit the frame. | 330 // Submit the frame. |
343 child_factory.Create(child_local_frame_id); | |
344 child_factory.SubmitCompositorFrame(child_local_frame_id, | 331 child_factory.SubmitCompositorFrame(child_local_frame_id, |
345 std::move(child_frame), | 332 std::move(child_frame), |
346 SurfaceFactory::DrawCallback()); | 333 SurfaceFactory::DrawCallback()); |
347 | 334 |
348 TestCase tests[] = { | 335 TestCase tests[] = { |
349 { | 336 { |
350 root_surface_id, | 337 root_surface_id, |
351 gfx::Point(10, 10), | 338 gfx::Point(10, 10), |
352 root_surface_id, | 339 root_surface_id, |
353 gfx::Point(10, 10) | 340 gfx::Point(10, 10) |
(...skipping 24 matching lines...) Expand all Loading... |
378 }, | 365 }, |
379 { | 366 { |
380 root_surface_id, | 367 root_surface_id, |
381 gfx::Point(290, 290), | 368 gfx::Point(290, 290), |
382 root_surface_id, | 369 root_surface_id, |
383 gfx::Point(290, 290) | 370 gfx::Point(290, 290) |
384 } | 371 } |
385 }; | 372 }; |
386 | 373 |
387 RunTests(nullptr, &manager, tests, arraysize(tests)); | 374 RunTests(nullptr, &manager, tests, arraysize(tests)); |
388 | |
389 root_factory.Destroy(root_local_frame_id); | |
390 child_factory.Destroy(child_local_frame_id); | |
391 } | 375 } |
392 | 376 |
393 TEST(SurfaceHittestTest, Hittest_RenderPassDrawQuad) { | 377 TEST(SurfaceHittestTest, Hittest_RenderPassDrawQuad) { |
394 SurfaceManager manager; | 378 SurfaceManager manager; |
395 EmptySurfaceFactoryClient client; | 379 EmptySurfaceFactoryClient client; |
396 FrameSinkId root_frame_sink_id(kArbitraryFrameSinkId); | 380 FrameSinkId root_frame_sink_id(kArbitraryFrameSinkId); |
397 SurfaceFactory factory(root_frame_sink_id, &manager, &client); | 381 SurfaceFactory factory(root_frame_sink_id, &manager, &client); |
398 | 382 |
399 // Create a CompostiorFrame with two RenderPasses. | 383 // Create a CompostiorFrame with two RenderPasses. |
400 gfx::Rect root_rect(300, 300); | 384 gfx::Rect root_rect(300, 300); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 gfx::Rect child_solid_quad_rect(100, 100); | 417 gfx::Rect child_solid_quad_rect(100, 100); |
434 CreateSolidColorDrawQuad(child_render_pass, | 418 CreateSolidColorDrawQuad(child_render_pass, |
435 gfx::Transform(), | 419 gfx::Transform(), |
436 gfx::Rect(100, 100), | 420 gfx::Rect(100, 100), |
437 child_solid_quad_rect); | 421 child_solid_quad_rect); |
438 | 422 |
439 // Submit the root frame. | 423 // Submit the root frame. |
440 SurfaceIdAllocator root_allocator; | 424 SurfaceIdAllocator root_allocator; |
441 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); | 425 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); |
442 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); | 426 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); |
443 factory.Create(root_local_frame_id); | |
444 factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), | 427 factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), |
445 SurfaceFactory::DrawCallback()); | 428 SurfaceFactory::DrawCallback()); |
446 | 429 |
447 TestCase tests[] = { | 430 TestCase tests[] = { |
448 // These tests just miss the RenderPassDrawQuad. | 431 // These tests just miss the RenderPassDrawQuad. |
449 { | 432 { |
450 root_surface_id, | 433 root_surface_id, |
451 gfx::Point(49, 49), | 434 gfx::Point(49, 49), |
452 root_surface_id, | 435 root_surface_id, |
453 gfx::Point(49, 49) | 436 gfx::Point(49, 49) |
(...skipping 28 matching lines...) Expand all Loading... |
482 }, | 465 }, |
483 { | 466 { |
484 root_surface_id, | 467 root_surface_id, |
485 gfx::Point(100, 100), | 468 gfx::Point(100, 100), |
486 root_surface_id, | 469 root_surface_id, |
487 gfx::Point(100, 100) | 470 gfx::Point(100, 100) |
488 } | 471 } |
489 }; | 472 }; |
490 | 473 |
491 RunTests(nullptr, &manager, tests, arraysize(tests)); | 474 RunTests(nullptr, &manager, tests, arraysize(tests)); |
492 | |
493 factory.Destroy(root_local_frame_id); | |
494 } | 475 } |
495 | 476 |
496 TEST(SurfaceHittestTest, Hittest_SingleSurface_WithInsetsDelegate) { | 477 TEST(SurfaceHittestTest, Hittest_SingleSurface_WithInsetsDelegate) { |
497 SurfaceManager manager; | 478 SurfaceManager manager; |
498 | 479 |
499 // Set up root FrameSink. | 480 // Set up root FrameSink. |
500 EmptySurfaceFactoryClient root_client; | 481 EmptySurfaceFactoryClient root_client; |
501 FrameSinkId root_frame_sink_id(1, 1); | 482 FrameSinkId root_frame_sink_id(1, 1); |
502 SurfaceFactory root_factory(root_frame_sink_id, &manager, &root_client); | 483 SurfaceFactory root_factory(root_frame_sink_id, &manager, &root_client); |
503 | 484 |
(...skipping 17 matching lines...) Expand all Loading... |
521 gfx::Transform(1.0f, 0.0f, 0.0f, 50.0f, | 502 gfx::Transform(1.0f, 0.0f, 0.0f, 50.0f, |
522 0.0f, 1.0f, 0.0f, 50.0f, | 503 0.0f, 1.0f, 0.0f, 50.0f, |
523 0.0f, 0.0f, 1.0f, 0.0f, | 504 0.0f, 0.0f, 1.0f, 0.0f, |
524 0.0f, 0.0f, 0.0f, 1.0f), | 505 0.0f, 0.0f, 0.0f, 1.0f), |
525 root_rect, child_rect, child_surface_id); | 506 root_rect, child_rect, child_surface_id); |
526 | 507 |
527 // Submit the root frame. | 508 // Submit the root frame. |
528 SurfaceIdAllocator root_allocator; | 509 SurfaceIdAllocator root_allocator; |
529 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); | 510 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); |
530 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); | 511 SurfaceId root_surface_id(root_frame_sink_id, root_local_frame_id); |
531 root_factory.Create(root_local_frame_id); | |
532 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), | 512 root_factory.SubmitCompositorFrame(root_local_frame_id, std::move(root_frame), |
533 SurfaceFactory::DrawCallback()); | 513 SurfaceFactory::DrawCallback()); |
534 | 514 |
535 // Creates a child surface. | 515 // Creates a child surface. |
536 RenderPass* child_pass = nullptr; | 516 RenderPass* child_pass = nullptr; |
537 CompositorFrame child_frame = CreateCompositorFrame(child_rect, &child_pass); | 517 CompositorFrame child_frame = CreateCompositorFrame(child_rect, &child_pass); |
538 | 518 |
539 // Add a solid quad in the child surface. | 519 // Add a solid quad in the child surface. |
540 gfx::Rect child_solid_quad_rect(190, 190); | 520 gfx::Rect child_solid_quad_rect(190, 190); |
541 CreateSolidColorDrawQuad( | 521 CreateSolidColorDrawQuad( |
542 child_pass, | 522 child_pass, |
543 gfx::Transform(1.0f, 0.0f, 0.0f, 5.0f, 0.0f, 1.0f, 0.0f, 5.0f, 0.0f, 0.0f, | 523 gfx::Transform(1.0f, 0.0f, 0.0f, 5.0f, 0.0f, 1.0f, 0.0f, 5.0f, 0.0f, 0.0f, |
544 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f), | 524 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f), |
545 root_rect, child_solid_quad_rect); | 525 root_rect, child_solid_quad_rect); |
546 | 526 |
547 // Submit the frame. | 527 // Submit the frame. |
548 child_factory.Create(child_local_frame_id); | |
549 child_factory.SubmitCompositorFrame(child_local_frame_id, | 528 child_factory.SubmitCompositorFrame(child_local_frame_id, |
550 std::move(child_frame), | 529 std::move(child_frame), |
551 SurfaceFactory::DrawCallback()); | 530 SurfaceFactory::DrawCallback()); |
552 | 531 |
553 TestCase test_expectations_without_insets[] = { | 532 TestCase test_expectations_without_insets[] = { |
554 {root_surface_id, gfx::Point(55, 55), child_surface_id, gfx::Point(5, 5)}, | 533 {root_surface_id, gfx::Point(55, 55), child_surface_id, gfx::Point(5, 5)}, |
555 {root_surface_id, gfx::Point(60, 60), child_surface_id, | 534 {root_surface_id, gfx::Point(60, 60), child_surface_id, |
556 gfx::Point(10, 10)}, | 535 gfx::Point(10, 10)}, |
557 {root_surface_id, gfx::Point(239, 239), child_surface_id, | 536 {root_surface_id, gfx::Point(239, 239), child_surface_id, |
558 gfx::Point(189, 189)}, | 537 gfx::Point(189, 189)}, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 | 598 |
620 TestSurfaceHittestDelegate accept_delegate; | 599 TestSurfaceHittestDelegate accept_delegate; |
621 accept_delegate.AddInsetsForAcceptSurface(child_surface_id, | 600 accept_delegate.AddInsetsForAcceptSurface(child_surface_id, |
622 gfx::Insets(5, 5, 5, 5)); | 601 gfx::Insets(5, 5, 5, 5)); |
623 RunTests(&accept_delegate, &manager, test_expectations_with_accept_insets, | 602 RunTests(&accept_delegate, &manager, test_expectations_with_accept_insets, |
624 arraysize(test_expectations_with_accept_insets)); | 603 arraysize(test_expectations_with_accept_insets)); |
625 | 604 |
626 // Verify that insets have affected hit targeting. | 605 // Verify that insets have affected hit targeting. |
627 EXPECT_EQ(0, accept_delegate.reject_target_overrides()); | 606 EXPECT_EQ(0, accept_delegate.reject_target_overrides()); |
628 EXPECT_EQ(2, accept_delegate.accept_target_overrides()); | 607 EXPECT_EQ(2, accept_delegate.accept_target_overrides()); |
629 | |
630 root_factory.Destroy(root_local_frame_id); | |
631 child_factory.Destroy(child_local_frame_id); | |
632 } | 608 } |
633 | 609 |
634 } // namespace cc | 610 } // namespace cc |
OLD | NEW |