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