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

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

Issue 1496103002: Reusing base::IdType<...> to implement SurfaceId. Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-id-base
Patch Set: Created 5 years 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 "cc/output/compositor_frame.h" 5 #include "cc/output/compositor_frame.h"
6 #include "cc/surfaces/surface.h" 6 #include "cc/surfaces/surface.h"
7 #include "cc/surfaces/surface_factory.h" 7 #include "cc/surfaces/surface_factory.h"
8 #include "cc/surfaces/surface_factory_client.h" 8 #include "cc/surfaces/surface_factory_client.h"
9 #include "cc/surfaces/surface_hittest.h" 9 #include "cc/surfaces/surface_hittest.h"
10 #include "cc/surfaces/surface_id_allocator.h" 10 #include "cc/surfaces/surface_id_allocator.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 SurfaceFactory factory(&manager, &client); 59 SurfaceFactory factory(&manager, &client);
60 60
61 // Creates a root surface. 61 // Creates a root surface.
62 gfx::Rect root_rect(300, 300); 62 gfx::Rect root_rect(300, 300);
63 RenderPass* root_pass = nullptr; 63 RenderPass* root_pass = nullptr;
64 scoped_ptr<CompositorFrame> root_frame = 64 scoped_ptr<CompositorFrame> root_frame =
65 CreateCompositorFrame(root_rect, &root_pass); 65 CreateCompositorFrame(root_rect, &root_pass);
66 66
67 // Add a reference to a non-existant child surface on the root surface. 67 // Add a reference to a non-existant child surface on the root surface.
68 SurfaceIdAllocator child_allocator(3); 68 SurfaceIdAllocator child_allocator(3);
69 SurfaceId child_surface_id; 69 SurfaceId child_surface_id = SurfaceId::FromUnsafeValue(0xdeadbeef);
70 child_surface_id.id = 0xdeadbeef;
71 gfx::Rect child_rect(200, 200); 70 gfx::Rect child_rect(200, 200);
72 CreateSurfaceDrawQuad(root_pass, 71 CreateSurfaceDrawQuad(root_pass,
73 gfx::Transform(), 72 gfx::Transform(),
74 root_rect, 73 root_rect,
75 child_rect, 74 child_rect,
76 child_surface_id); 75 child_surface_id);
77 76
78 // Submit the root frame. 77 // Submit the root frame.
79 SurfaceIdAllocator root_allocator(2); 78 SurfaceIdAllocator root_allocator(2);
80 SurfaceId root_surface_id = root_allocator.GenerateId(); 79 SurfaceId root_surface_id = root_allocator.GenerateId();
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 gfx::Point(100, 100) 457 gfx::Point(100, 100)
459 } 458 }
460 }; 459 };
461 460
462 RunTests(&manager, tests, arraysize(tests)); 461 RunTests(&manager, tests, arraysize(tests));
463 462
464 factory.Destroy(root_surface_id); 463 factory.Destroy(root_surface_id);
465 } 464 }
466 465
467 } // namespace cc 466 } // 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