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

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

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Changed SurfaceManager::kRootSurfaceId to a private field to avoid static initialization Created 4 years, 1 month 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
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_id.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
OLDNEW
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698