| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 SurfaceFactory factory(&manager, &client); | 64 SurfaceFactory factory(&manager, &client); |
| 65 | 65 |
| 66 // Creates a root surface. | 66 // Creates a root surface. |
| 67 gfx::Rect root_rect(300, 300); | 67 gfx::Rect root_rect(300, 300); |
| 68 RenderPass* root_pass = nullptr; | 68 RenderPass* root_pass = nullptr; |
| 69 scoped_ptr<CompositorFrame> root_frame = | 69 scoped_ptr<CompositorFrame> root_frame = |
| 70 CreateCompositorFrame(root_rect, &root_pass); | 70 CreateCompositorFrame(root_rect, &root_pass); |
| 71 | 71 |
| 72 // Add a reference to a non-existant child surface on the root surface. | 72 // Add a reference to a non-existant child surface on the root surface. |
| 73 SurfaceIdAllocator child_allocator(3); | 73 SurfaceIdAllocator child_allocator(3); |
| 74 SurfaceId child_surface_id; | 74 SurfaceId child_surface_id = SurfaceId::FromUnsafeValue(0xdeadbeef); |
| 75 child_surface_id.id = 0xdeadbeef; | |
| 76 gfx::Rect child_rect(200, 200); | 75 gfx::Rect child_rect(200, 200); |
| 77 CreateSurfaceDrawQuad(root_pass, | 76 CreateSurfaceDrawQuad(root_pass, |
| 78 gfx::Transform(), | 77 gfx::Transform(), |
| 79 root_rect, | 78 root_rect, |
| 80 child_rect, | 79 child_rect, |
| 81 child_surface_id); | 80 child_surface_id); |
| 82 | 81 |
| 83 // Submit the root frame. | 82 // Submit the root frame. |
| 84 SurfaceIdAllocator root_allocator(2); | 83 SurfaceIdAllocator root_allocator(2); |
| 85 SurfaceId root_surface_id = root_allocator.GenerateId(); | 84 SurfaceId root_surface_id = root_allocator.GenerateId(); |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 RunTests(&delegate, &manager, test_expectations_with_insets, | 586 RunTests(&delegate, &manager, test_expectations_with_insets, |
| 588 arraysize(test_expectations_with_insets)); | 587 arraysize(test_expectations_with_insets)); |
| 589 | 588 |
| 590 // Verify that insets have affected hit targeting. | 589 // Verify that insets have affected hit targeting. |
| 591 EXPECT_EQ(2, delegate.target_overrides()); | 590 EXPECT_EQ(2, delegate.target_overrides()); |
| 592 | 591 |
| 593 factory.Destroy(root_surface_id); | 592 factory.Destroy(root_surface_id); |
| 594 } | 593 } |
| 595 | 594 |
| 596 } // namespace cc | 595 } // namespace cc |
| OLD | NEW |