Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: cc/surfaces/surface_hittest_unittest.cc

Issue 1996783002: Make cc::SurfaceId unguessable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed more build targets Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 std::unique_ptr<CompositorFrame> root_frame = 69 std::unique_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;
75 child_surface_id.id = 0xdeadbeef; 75 child_surface_id.local_id = 0xdeadbeef;
76 gfx::Rect child_rect(200, 200); 76 gfx::Rect child_rect(200, 200);
77 CreateSurfaceDrawQuad(root_pass, 77 CreateSurfaceDrawQuad(root_pass,
78 gfx::Transform(), 78 gfx::Transform(),
79 root_rect, 79 root_rect,
80 child_rect, 80 child_rect,
81 child_surface_id); 81 child_surface_id);
82 82
83 // Submit the root frame. 83 // Submit the root frame.
84 SurfaceIdAllocator root_allocator(2); 84 SurfaceIdAllocator root_allocator(2);
85 SurfaceId root_surface_id = root_allocator.GenerateId(); 85 SurfaceId root_surface_id = root_allocator.GenerateId();
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 arraysize(test_expectations_with_accept_insets)); 591 arraysize(test_expectations_with_accept_insets));
592 592
593 // Verify that insets have affected hit targeting. 593 // Verify that insets have affected hit targeting.
594 EXPECT_EQ(0, accept_delegate.reject_target_overrides()); 594 EXPECT_EQ(0, accept_delegate.reject_target_overrides());
595 EXPECT_EQ(2, accept_delegate.accept_target_overrides()); 595 EXPECT_EQ(2, accept_delegate.accept_target_overrides());
596 596
597 factory.Destroy(root_surface_id); 597 factory.Destroy(root_surface_id);
598 } 598 }
599 599
600 } // namespace cc 600 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698