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( | 75 SurfaceId child_surface_id(kArbitraryFrameSinkId, |
76 kArbitraryFrameSinkId, | 76 LocalFrameId(0xdeadbeef, 0)); |
77 LocalFrameId(0xdeadbeef, base::UnguessableToken::Create())); | |
78 gfx::Rect child_rect(200, 200); | 77 gfx::Rect child_rect(200, 200); |
79 CreateSurfaceDrawQuad(root_pass, | 78 CreateSurfaceDrawQuad(root_pass, |
80 gfx::Transform(), | 79 gfx::Transform(), |
81 root_rect, | 80 root_rect, |
82 child_rect, | 81 child_rect, |
83 child_surface_id); | 82 child_surface_id); |
84 | 83 |
85 // Submit the root frame. | 84 // Submit the root frame. |
86 SurfaceIdAllocator root_allocator; | 85 SurfaceIdAllocator root_allocator; |
87 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); | 86 LocalFrameId root_local_frame_id = root_allocator.GenerateId(); |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 624 |
626 // Verify that insets have affected hit targeting. | 625 // Verify that insets have affected hit targeting. |
627 EXPECT_EQ(0, accept_delegate.reject_target_overrides()); | 626 EXPECT_EQ(0, accept_delegate.reject_target_overrides()); |
628 EXPECT_EQ(2, accept_delegate.accept_target_overrides()); | 627 EXPECT_EQ(2, accept_delegate.accept_target_overrides()); |
629 | 628 |
630 root_factory.Destroy(root_local_frame_id); | 629 root_factory.Destroy(root_local_frame_id); |
631 child_factory.Destroy(child_local_frame_id); | 630 child_factory.Destroy(child_local_frame_id); |
632 } | 631 } |
633 | 632 |
634 } // namespace cc | 633 } // namespace cc |
OLD | NEW |