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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 EmptySurfaceFactoryClient client; | 65 EmptySurfaceFactoryClient client; |
66 FrameSinkId root_frame_sink_id(kArbitraryFrameSinkId); | 66 FrameSinkId root_frame_sink_id(kArbitraryFrameSinkId); |
67 SurfaceFactory root_factory(root_frame_sink_id, &manager, &client); | 67 SurfaceFactory root_factory(root_frame_sink_id, &manager, &client); |
68 | 68 |
69 // Creates a root surface. | 69 // Creates a root surface. |
70 gfx::Rect root_rect(300, 300); | 70 gfx::Rect root_rect(300, 300); |
71 RenderPass* root_pass = nullptr; | 71 RenderPass* root_pass = nullptr; |
72 CompositorFrame root_frame = CreateCompositorFrame(root_rect, &root_pass); | 72 CompositorFrame root_frame = CreateCompositorFrame(root_rect, &root_pass); |
73 | 73 |
74 // Add a reference to a non-existant child surface on the root surface. | 74 // Add a reference to a non-existant child surface on the root surface. |
75 SurfaceId child_surface_id(kArbitraryFrameSinkId, | 75 SurfaceId child_surface_id( |
76 LocalFrameId(0xdeadbeef, 0)); | 76 kArbitraryFrameSinkId, |
| 77 LocalFrameId(0xdeadbeef, base::UnguessableToken::Create())); |
77 gfx::Rect child_rect(200, 200); | 78 gfx::Rect child_rect(200, 200); |
78 CreateSurfaceDrawQuad(root_pass, | 79 CreateSurfaceDrawQuad(root_pass, |
79 gfx::Transform(), | 80 gfx::Transform(), |
80 root_rect, | 81 root_rect, |
81 child_rect, | 82 child_rect, |
82 child_surface_id); | 83 child_surface_id); |
83 | 84 |
84 // Submit the root frame. | 85 // Submit the root frame. |
85 SurfaceIdAllocator root_allocator; | 86 SurfaceIdAllocator root_allocator; |
86 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); | 87 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 | 625 |
625 // Verify that insets have affected hit targeting. | 626 // Verify that insets have affected hit targeting. |
626 EXPECT_EQ(0, accept_delegate.reject_target_overrides()); | 627 EXPECT_EQ(0, accept_delegate.reject_target_overrides()); |
627 EXPECT_EQ(2, accept_delegate.accept_target_overrides()); | 628 EXPECT_EQ(2, accept_delegate.accept_target_overrides()); |
628 | 629 |
629 root_factory.Destroy(root_local_frame_id); | 630 root_factory.Destroy(root_local_frame_id); |
630 child_factory.Destroy(child_local_frame_id); | 631 child_factory.Destroy(child_local_frame_id); |
631 } | 632 } |
632 | 633 |
633 } // namespace cc | 634 } // namespace cc |
OLD | NEW |